1

I have installed conda and now I want to use modul numpy in my python script, but I get the following error

ImportError: No module named numpy

I can see the module under conda list, I have my $PATH set to /path/to/anaconda2/bin, conda info -a says I have not set PYTHONHOME or PYTHONPATH as some answers suggest...

How to set conda / enviroment variables right co I can use numpy?

Michal
  • 671
  • 3
  • 9
  • 22

1 Answers1

1

The problem was in env variables and running the script as sudo as described here PYTHONPATH not working for sudo on GNU/Linux (works for root)

Community
  • 1
  • 1
Michal
  • 671
  • 3
  • 9
  • 22
  • Did you have to specify PYTHONPATH eventually?. I'm having the same problem, but adding `Defaults env_keep += "PYTHONPATH"` to sudoers doesn't fix it. – yousraHazem Oct 16 '18 at 19:48
  • Moreover `sudo python -c "import sys; print(sys.path)"` outputs the wrong path whereas the non sudo one prints the activated conda env – yousraHazem Oct 16 '18 at 19:50