I have ubuntu 2022LTS with python 3.10.4 and numpy installed.
But since I installed miniconda, I cannot get back to my original system installation of python even when I deactivate conda:
prokophapala@ProkopDesktop:~$ conda activate
(base) prokophapala@ProkopDesktop:~$ python --version
Python 3.9.12
(base) prokophapala@ProkopDesktop:~$ conda deactivate
prokophapala@ProkopDesktop:~$ python --version
Python 3.9.12
prokophapala@ProkopDesktop:~$ python3
Python 3.9.12 (main, Apr 5 2022, 06:56:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
>>>
CodePudding user response:
Activating a conda environment means that the location of the Python interpreter and the C-libraries (numpy) are temporarily added to the system path. After deactivation the old system path is restored.
Obviously during miniconda installation you enabled the option to "Add Python to the system path" which is not the default option and which is not recommended, since you can't access your previous Python any more.
So the solution is to check your system path, remove all miniconda Python references (except for the path to condabin) and add the path to your previous Python again. Note that you can have both interpreters in parallel on your system, but you always have to activate a conda environment before you can use it.