![](/img/trans.png)
[英]Should Python 2.6 on OS X deal with multiple easy-install.pth files in $PYTHONPATH?
[英]Mac OS X error: directory that is not on PYTHONPATH and which Python does not read “.pth” files from
嘗試在Mac OS X 10.11.6上安裝FEnicS時出錯。 我已經閱讀了本網站上對類似問題的回復,並嘗試了建議的解決方案,但我必須做錯事。
在運行命令時:
curl -s https://fenicsproject.org/fenics-install.sh | bash
我在安裝cython包時遇到錯誤:
[cython] Building cython/e2t4ieqlgjl3, follow log with:
[cython] tail -f /Users/sophiaw/.hashdist/tmp/cython-e2t4ieqlgjl3-1/_hashdist/build.log
[cython|ERROR] Command '[u'/bin/bash', '_hashdist/build.sh']' returned non-zero exit status 1
[cython|ERROR] command failed (code=1); raising.
來自build.log的消息是:
在/Users/sophiaw/.hashdist/bld/cython/e2t4ieqlgjl3/lib/python2.7/site-packages/ /Users/sophiaw/.hashdist/bld/python/pf77qttkbtzn/bin/python-E中檢查.pth文件支持c通過
測試失敗:/Users/sophiaw/.hashdist/bld/cython/e2t4ieqlgjl3/lib/python2.7/site-packages/不支持.pth文件錯誤:安裝目錄錯誤或PYTHONPATH
您正在嘗試將程序包安裝到不在PYTHONPATH上的目錄以及哪些Python不從中讀取“.pth”文件。 您指定的安裝目錄(通過--install-dir, - prefix或distutils默認設置)是:
/Users/sophiaw/.hashdist/bld/cython/e2t4ieqlgjl3/lib/python2.7/site-packages/
並且您的PYTHONPATH環境變量當前包含:'/ Users / sophiaw / .hashdist / bld / cython / e2t4ieqlgjl3 /Python.framework / Version = 7.7 / lib / python2.7 / site-package:'
以下是一些糾正問題的方法:
您可以選擇其他安裝目錄,即PYTHONPATH上的目錄或支持.pth文件
您可以將安裝目錄添加到PYTHONPATH環境變量中。 (每當你運行Python並且想要使用你正在安裝的軟件包時,它也必須在PYTHONPATH上。)
您可以使用以下描述的方法之一設置安裝目錄以支持“.pth”文件:
https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations
請對您的系統進行適當的更改,然后重試。
我已經嘗試將此添加到bash_profile,但得到相同的錯誤:
export PYTHONPATH=/Users/sophiaw/.hashdist/bld/cython/e2t4ieqlgjl3/lib/python2.7/site-packages:$PYTHONPATH.
我該如何解決這個錯誤?
這是由fenics支持小組解決的。 要在OS X上安裝FEniCS,Docker是一個更方便的選擇。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.