1

I have installed Conda properly, and it is working.

I did

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

I get the Anaconda Ring that says the program is initializing and then I get this in my terminal. :

   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

Thank you for your help.

1 Answers1

2

To solve this error message:

UnboundLocalError: local variable "DISTRO_NAME" referenced before assignment

run conda update anaconda-navigator in the terminal and run anaconda-navigator again.

If that doesn't work open /home/singh/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py in a text editor and in line 168 after the if statement and before for add this line: DISTRO_NAME='ubuntu'

If the first two suggestions don't work reinstall and update conda, anaconda navigator and navigator updater.

karel
  • 1,961
  • 2
  • 17
  • 26
  • Oh hey, it worked thank you so much. I recognize you, you answered my question last time. Thank you so much for answering. You're the best – Supreet Singh Jul 09 '20 at 09:10
  • 1
    This helped me as well. I'm using Pop 21.10 and downloaded Anaconda (1.19.12) fresh yesterday and it wouldn't start. The line 168 didn't look like it lined up with what you decribe (no for nearby but there was one up a few lines) so I inserted it here - def _find_linux_install_dir(self): INST_DIR = None exe = os.path.join('/snap', 'bin', 'code') DISTRO_NAME = 'ubuntu' – knussear Mar 27 '22 at 12:49