You are not logged in.

#1 2016-12-24 03:31:44

deathwilldie
Member
Registered: 2016-12-24
Posts: 1

Sublime Text 3 Python import error

Whenever I try to  import a module (like numpy) I get

ImportError: No module named 'numpy'
[Finished in 0.1s with exit code 1]
[shell_cmd: python -u "/home/isaac/Dropbox/Thesis/Python/angle_of_obs.py"]
[dir: /home/isaac/Dropbox/Thesis/Python]
[path: /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl]

Numpy should be there since I installed anaconda using

 yaourt -S anaconda 

When I run

 which numpy 

I get

 which: no numpy in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl) 

I'm not sure how to point my compiler to use the path that has all the anaconda modules. I've tried using

export PYTHONPATH=/opt/anaconda/bin/python

but it doesn't seem to change anything. Any suggestions?

Offline

#2 2016-12-25 21:19:23

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Sublime Text 3 Python import error

PYTHONPATH is not the same as PATH, it is the location which python looks for modules (by default in /usr/lib/python3.5/site-packages).

If you want anaconda's python executable to be used, make sure your PATH starts with the location of your anaconda installation.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB