2

I am unable to use conda commands after upgrading from Python 3.6 to Python 3.7. For example, when I wanted to see the active environment using conda env list, I get the following error:

Traceback (most recent call last):
  File "$HOME/anaconda3/bin/conda", line 12, in <module>
    from conda.cli import main
ModuleNotFoundError: No module named 'conda'

The same error appears for all conda commands.

Running python shows:

Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux

When I check the system path for Python 3.7 at $HOME/anaconda3/lib/python3.7/site-packages/, I don't find the conda directories but I find the same in the older Python version which I was previously using: $HOME/anaconda3/lib/python3.6/site-packages/conda.

I thought to perform a clean uninstall and install of Anaconda starting with anaconda-clean. But I get the following error:

Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "$HOME/anaconda3/lib/python3.7/io.py", line 52, in <module>
  File "$HOME/anaconda3/lib/python3.7/abc.py", line 147
print(f"Class: {cls.__module__}.{cls.__qualname__}", file=file)
                                                      ^
SyntaxError: invalid syntax
Aborted (core dumped)

Is there a way I can fix these issues? Thanks.

nish-ant
  • 119
  • 3
  • 15
  • 2
    every python's version has own folder for modules and `anaconda` may do the same. You may have to install new conda for Python3.7 - https://docs.conda.io/projects/conda/en/latest/user-guide/install/ – furas Aug 02 '19 at 19:08
  • 1
    Possible duplicate of [After Anaconda installation, conda command fails with "ImportError: no module named conda.cli"](https://stackoverflow.com/questions/19825250/after-anaconda-installation-conda-command-fails-with-importerror-no-module-na) – Akaisteph7 Aug 02 '19 at 20:06

0 Answers0