Python/IPython 导入错误 : no module named site

标签 python linux ubuntu-12.04 ipython importerror

我的 python 2.7.3ipython 1.2 在我的 Linux 系统(ubuntu 12.04) 但正在尝试安装类(class)作业所需的更新版本的 matplotlab。

在终端运行此代码行后

user$ sudo easy_install -U distribute
user$ export PYTHONHOME=/usr/lib/python2.7/

现在每次我尝试运行 pythonipython 时都会收到错误消息

ImportError: no module named site

我如何扭转/解决这个问题?我迷路了。我查看了其他类似的问题,但没有其他人使用 Linux 并且我不确定该怎么做。

最佳答案

尝试取消设置您的 python 路径...

在 Linux/Mac 中,您可以使用以下命令:

unset PYTHONPATH
unset PYTHONHOME

关于Python/IPython 导入错误 : no module named site,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21874407/

相关文章:

python - 如何在 python 中的 PyArrow 和 C++ 中的 Arrow 之间进行接口(interface)时将 PyArrow 表转换为 Arrow 表

Python Seaborn FacetGrid 不同的 y 轴

linux - npm 安装失败

json - 将 json 传递到 AWS CLI 无效的 JSON

linux - Puppet 和 Facter 默认系统事实

apache2 - 'sites-enabled' 和 'sites-available' 目录有什么区别?

Python 相当于 Ruby 的 ||=

python - 使用 Python 将 Pandas DataFrame 导出为 PDF 文件

linux - Ubuntu 16.04 lightdm 段错误

c# - 通过网络进行命令行控制