安装在 Linux Mint 19 中时 Anaconda 3 抛出错误

Anaconda 3 throwing error when installed in Linux Mint 19

我有以前版本的 Anaconda 2(使用 Python 2.7),我卸载了它以新安装 Anaconda 3(使用 Python 3.x)。

虽然之前的 Anaconda 2 运行良好,但新安装的 Anaconda 3 抛出以下错误:

Traceback (most recent call last):
  File "/home/partha/anaconda3/lib/python3.7/site-packages/anaconda_navigator/widgets/main_window.py", line 541, in setup
    self.post_setup(conda_data=conda_data)
  File "/home/partha/anaconda3/lib/python3.7/site-packages/anaconda_navigator/widgets/main_window.py", line 578, in post_setup
    self.tab_home.setup(conda_data)
  File "/home/partha/anaconda3/lib/python3.7/site-packages/anaconda_navigator/widgets/tabs/home.py", line 169, in setup
    self.set_applications(applications, packages)
  File "/home/partha/anaconda3/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 "/home/partha/anaconda3/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 "/home/partha/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py", line 48, in __init__
    **kwargs
  File "/home/partha/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/base.py", line 43, in __init__
    self.init()
  File "/home/partha/anaconda3/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 "/home/partha/anaconda3/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

对于开始新安装的任何帮助,我们将不胜感激。 我正在使用 Linux Mint 19 和以下信息:

...$ cat /etc/linuxmint/info
RELEASE=19
CODENAME=tara
EDITION="Xfce"
DESCRIPTION="Linux Mint 19 Tara"
DESKTOP=Gnome
TOOLKIT=GTK
NEW_FEATURES_URL=http://www.linuxmint.com/rel_tara_xfce_whatsnew.php
RELEASE_NOTES_URL=http://www.linuxmint.com/rel_tara_xfce.php
USER_GUIDE_URL=help:linuxmint
GRUB_TITLE=Linux Mint 19 Xfce
...$

快速 google 搜索显示几天前有一个关于您的问题的问题未解决 in github

幸好发布了解决方法:

Editing the file: ".../anaconda3//lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py"
By declaring the variable outside the loop.
Just add the line: DISTRO_NAME = None
on Line 159 and indent it in line with the if above it (Outside it)

今天早上我也有类似的经历。但是我能够通过在我的命令行界面 (CLI) 中输入它来解决我的问题。

conda update anaconda-navigator

我希望这对你有用。