簡體   English   中英

ubuntu14.04中python2.7中的導入錯誤

[英]Import error in python2.7 in ubuntu14.04

每當我運行任何python2程序或打開python解釋器時,我都會收到以下錯誤。

$~/python> python setup.py
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

如果我執行以下命令

$ export PYTHONPATH=/usr/local/lib/python2.7

我收到以下錯誤

ImportError: No module named site

我也嘗試過使用以下命令重新安裝python

sudo apt-get install --reinstall python

但它根本沒有幫助。

提前致謝。

導出PYTHONHOME = / usr / local。 Python應該安裝在OS X上的/ usr / local中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM