管理Sublime text 3中的python包

管理Sublime text 3中的python包,python,sublimetext3,packages,sublimerepl,Python,Sublimetext3,Packages,Sublimerepl,使用Ubuntu 14.04 如何告诉Sublime text 3和SublimeREPL在哪里查找python包 从我的终端,pip list返回一个包含许多python包的列表,如下所示: numexpr (2.2.2) numpy (1.8.2) oauthlib (0.6.1) oneconf (0.3.7) openpyxl (2.2.5) PAM (0.4.2) pandas (0.16.2) 但是,在控制台上的升华文本3中: >>> import openpyx

使用Ubuntu 14.04

如何告诉Sublime text 3和SublimeREPL在哪里查找python包

从我的终端,
pip list
返回一个包含许多python包的列表,如下所示:

numexpr (2.2.2)
numpy (1.8.2)
oauthlib (0.6.1)
oneconf (0.3.7)
openpyxl (2.2.5)
PAM (0.4.2)
pandas (0.16.2)
但是,在控制台上的升华文本3中:

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

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

>>> import numpy
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'numpy'
导入openpyxl 回溯(最近一次呼叫最后一次): 文件“”,第1行,在 ImportError:没有名为“openpyxl”的模块 >>>进口大熊猫 回溯(最近一次呼叫最后一次): 文件“”,第1行,在 导入错误:没有名为“pandas”的模块 >>>进口numpy 回溯(最近一次呼叫最后一次): 文件“”,第1行,在 ImportError:没有名为“numpy”的模块 从SulbimeREPL控制台:

Python 3.3.6 (default, Jan 28 2015, 17:27:09) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'
>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'pandas'
>>> import openpyxl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'openpyxl'
Python 3.3.6(默认,2015年1月28日,17:27:09)
[GCC 4.8.2]在linux上
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>>进口numpy
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:没有名为“numpy”的模块
>>>进口大熊猫
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
导入错误:没有名为“pandas”的模块
>>>导入openpyxl
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:没有名为“openpyxl”的模块

因此,我假设需要设置一些东西。

您需要将SublimeRepl指向正确的解释器

添加到
Settings->Package Settings->submiterepl->Settings-User

{
    "default_extend_env": {"PATH": "{PATH}:/usr/lib/python2.7"}
}

你需要指向正确的解释器

添加到
Settings->Package Settings->submiterepl->Settings-User

{
    "default_extend_env": {"PATH": "{PATH}:/usr/lib/python2.7"}
}

导入系统的输出是什么;sys.executable?您使用的是虚拟机吗?如果是的话,它的可执行文件的路径是什么?@Railslide不,我不是在使用virtualenv,我是在virtualBox上使用Ubuntu。@另外,sublime text 3控制台中的输出是:
python3
,Sublimiterepl控制台上的输出是:
/usr/bin/python3.3
pip--version的输出是什么?@Railslide,来自pip的输出--version在我的终端中给了我:
PIP1.5.4 from/usr/lib/python2.7/dist-packages(python 2.7)
导入系统的输出是什么;sys.executable?您使用的是虚拟机吗?如果是的话,它的可执行文件的路径是什么?@Railslide不,我不是在使用virtualenv,我是在virtualBox上使用Ubuntu。@另外,sublime text 3控制台中的输出是:
python3
,Sublimiterepl控制台上的输出是:
/usr/bin/python3.3
pip--version的输出是什么?@Railslide,来自pip的输出--version在我的终端中给了我:
PIP1.5.4来自/usr/lib/python2.7/dist-packages(python 2.7)