Bash

在 Pop!_OS 上安裝了 Anaconda,但它沒有執行

  • July 9, 2020

我已經正確安裝了 Conda,它正在工作。

我做了

    singh@zeppelin:~$ source~/anaconda3/bin/activate root
    (base) singh@zeppelin:~$ anaconda-navigator

我得到了表明程序正在初始化的 Anaconda Ring,然後我在終端中得到了它。:

  Traceback (most recent call last):
   File "/home/singh/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/singh/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/singh/anaconda3/lib/python3.7/site-packages/anaconda_navigator/widgets/tabs/home.py", line 169, in setup
self.set_applications(applications, packages)

 File "/home/singh/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/singh/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/singh/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py", line 48, in __init__
**kwargs


File "/home/singh/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/base.py", line 43, in __init__
self.init()


File "/home/singh/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/singh/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

謝謝您的幫助。

要解決此錯誤消息:

UnboundLocalError: local variable "DISTRO_NAME" referenced before assignment

conda update anaconda-navigator在終端中執行並再次anaconda-navigator執行。

如果這不起作用在文本編輯器中打開,並在語句/home/singh/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py之後和之前的第 168行添加此行:if``for``DISTRO_NAME='ubuntu'

如果前兩個建議不起作用,請重新安裝和更新 conda、anaconda navigator 和 navigator updater。

引用自:https://unix.stackexchange.com/questions/597518