Sublime Text console: Python Package import failin

2019-09-08 09:44发布

问题:

I am very new to SublimeText3.

I have Anaconda setup in my system and all the packages such as numpy, pandas and others are installed in /home/sam/anaconda/lib/site_packages..

Since my package distribution is in Anaconda's site packages, I created a new build system in sublime Text pointing to the Anaconda's Distribution. Now when I build the complete code- my imports, such as ..

import numpy 
import pandas 

works fine.

However, When I manually run the imports in the console of the sublime text. I see the below error.

>>> import numpy
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'nump

But, When I import packages like os, glob and others, I see no error.

I am not sure how to proceed, I would really appreciate any guidance.

回答1:

The Sublime Text console is an interactive console to its internal Python runtime, which is entirely separate from your system's Python. Or Anaconda's Python for that matter.

If you want an interactive console for your system Python within Sublime Text, you should check out the SublimeREPL package.