SublimeText3 cannot find Python modules (numpy) installed with MacPorts
Question: I installed Python 3.5 using MacPorts. I am trying to use SublimeText3 as an
editor. (Anything better and more integrated tan ST3 for python development??)

From the MacOSX terminal, I can 'import numpy' just fine, but SublimeText3
cannot find the packages.

Is it because the python packages are installed as 'Frameworks'?, because the
Path for finding those modules is not right?, other????

Here's what terminal shows:

    
    
    $ type -a python3
    python3 is /opt/local/bin/python3
    python3 is /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
    python3 is /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
    python3 is /usr/local/bin/python3
    

Here's what ST3 shows:

    
    
    File "/Users/xxx/Desktop/python_work/array_play.py", line 1, in <module>
        import numpy
    
    ImportError: No module named 'numpy'
    [Finished in 0.0s with exit code 1]
    
    [cmd: ['/Library/Frameworks/Python.framework/Versions/3.5/bin/python3', '-u', '/Users/xxx/Desktop/python_work/array_play.py']]
    
    [dir: /Users/xxx/Desktop/python_work]
    
    [path: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin::/Library/Frameworks/Python.framework/Versions/3.5/bin/python3/site-packages]
    

As you can see, I tried to add

    
    
    /opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages
    

to the Path variable, since this is the location of the numpy folder, but this
doesn't work...

Should I just ignore this message in ST3 and use it only as an editor??? Seems
rather silly to have an IDE and not be able to build and run programs from
it...


Answer: First, you need to find out which python3 you are using in terminal. You can
do this by running command `which python3`. Suppose the output is:
`/Users/username/.anaconda3/bin/python3`.

Second, try to set PYTHONPATH environment variable in Sublime's settings. Go
to `Preferences -> Settings User`, and add the following lines at the end of
the settings file (but inside of the last `}` symbol).

    
    
    "env":
    {
        "PYTHONPATH":"/Users/username/.anaconda3/bin"
    }
    

