manjaro无法启动anaconda-navigator

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'

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 wind.kaisa@gmail.com

文章标题:manjaro无法启动anaconda-navigator

本文作者:kaisawind

发布时间:2020-04-01, 01:59:04

最后更新:2020-07-21, 14:35:46

原始链接:https://kaisawind.gitee.io/2020/03/31/2020-04-01-anaconda/

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。

目录
×

喜欢就点赞,疼爱就打赏