manjaro无法启动anaconda-navigator - Wed, Apr 1, 2020
manjaro无法启动anaconda-navigator
manjaro启动anaconda-navigator报错
Traceback (most recent call last):
File "/opt/anaconda/lib/python3.7/site-packages/anaconda_navigator/widgets/main_window.py", line 541, in setup
self.post_setup(conda_data=conda_data)
File "/opt/anaconda/lib/python3.7/site-packages/anaconda_navigator/widgets/main_window.py", line 578, in post_setup
self.tab_home.setup(conda_data)
File "/opt/anaconda/lib/python3.7/site-packages/anaconda_navigator/widgets/tabs/home.py", line 169, in setup
self.set_applications(applications, packages)
File "/opt/anaconda/lib/python3.7/site-packages/anaconda_navigator/widgets/tabs/home.py", line 204, in set_applications
apps = self.api.process_apps(applications, prefix=self.current_prefix)
File "/opt/anaconda/lib/python3.7/site-packages/anaconda_navigator/api/anaconda_api.py", line 848, in process_apps
app = app(config=self.config, process_api=self._process_api, conda_api=self._conda_api)
File "/opt/anaconda/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py", line 48, in __init__
**kwargs
File "/opt/anaconda/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/base.py", line 43, in __init__
self.init()
File "/opt/anaconda/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/base.py", line 60, in init
SUBDIR, INST_EXT, INST_DIR = self._find_linux_install_dir()
File "/opt/anaconda/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py", line 168, in _find_linux_install_dir
if DISTRO_NAME in ['ubuntu', 'debian']:
UnboundLocalError: local variable 'DISTRO_NAME' referenced before assignment
修改"…/anaconda3//lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py"
在for循环外侧,添加DISTRO_NAME = None
def _find_linux_install_dir(self):
INST_DIR = None
exe = os.path.join('/snap', 'bin', 'code')
if os.path.lexists(exe):
INST_DIR = '/snap'
DISTRO_NAME = None ## Adding this line... takes care of the bug in my case
for distro in self.distro_map.keys():
_distro_regex = ".*{}/([^ ]*)".format(distro)
m = re.match(_distro_regex, self._conda_api.user_agent)
if m:
DISTRO_NAME = distro
DISTRO_VER = m.group(1)
break
if DISTRO_NAME in ['ubuntu', 'debian']:
_pkg_type = 'deb'
else:
_pkg_type = 'rpm'