我剛買了一臺帶有OSX 10.11 El Capitan
的新MacBook Pro。ImportError:Mac OSX上沒有任何名爲lxml的模塊10.11
我正在運行Google App Engine
本地開發啓動python,這是我在日誌中看到它時,它到達import lxml
。
"ImportError: No module named lxml"
我跟着從lxml website
sudo pip install lxml
包安裝的指示,但不能由路徑蟒蛇可以看出。我更新了我的路在.bashrc
和.bash_profile
有:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/lib/python2.7/site-packages/:$PATH
然後發現這篇文章Installing lxml on Mac OSX (10.11) inside a virtualenv with pip
$ STATIC_DEPS=true pip install lxml
它再次安裝,但無法找到。
我甚至嘗試從源代碼編譯和安裝macports
,因爲它嵌入,但仍然沒有運氣。
我看了lxml團隊感到很沮喪,OSX
和過時的庫和所有的混亂。
UPDATE
關於所提出的意見,它不是一個app.yaml的庫聲明,其不可能的具體到GAE的問題,因爲它似乎Python和OXS-elcapitan之間的可能性較大。
也是我得到這個不尋常的消息
The directory '/Users/[username]/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
我嘗試使用sudo -H但沒有任何解決的路徑。
但它確實表明10.11的變化可能是問題的一部分。
您運行'source〜/ .bash_profile'加載更新的路徑嗎? – Forge
可能重複[ImportError:No Module named simplejson](http://stackoverflow.com/questions/2604841/importerror-no-module-named-simplejson) –
這與appengine有什麼關係? –