【发布时间】:2023-03-31 19:36:01
【问题描述】:
这一切都在 iMac OSX 10.9.2 上
在进行 python2.7 的 Homebrew 安装时,一切似乎都在正确创建。但是,在完成并尝试使用 pip 或 easy_install 进行任何操作后,我不断收到以下错误:
$ pip install virtualenv
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
我已尝试卸载并重新安装 Brewed python,结果相同。我还使用 -v 运行了安装,结果如下:
==> Verifying python-2.7.6.mavericks.bottle.tar.gz checksum
==> Pouring python-2.7.6.mavericks.bottle.tar.gz
tar xf /Library/Caches/Homebrew/python-2.7.6.mavericks.bottle.tar.gz
==> Caveats
Python demo
/usr/local/share/python/Extras
Setuptools and Pip have been installed. To update them
pip install --upgrade setuptools
pip install --upgrade pip
You can install Python packages with (the outdated easy_install or)
`pip install <your_favorite_package>`
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python
.app bundles were installed.
Run `brew linkapps` to symlink these to /Applications.
==> Finishing up
ln -s ../Cellar/python/2.7.6/bin/smtpd2.py smtpd2.py
ln -s ../Cellar/python/2.7.6/bin/smtpd2.7.py smtpd2.7.py
ln -s ../Cellar/python/2.7.6/bin/smtpd.py smtpd.py
ln -s ../Cellar/python/2.7.6/bin/pythonw2.7 pythonw2.7
ln -s ../Cellar/python/2.7.6/bin/pythonw2 pythonw2
ln -s ../Cellar/python/2.7.6/bin/pythonw pythonw
ln -s ../Cellar/python/2.7.6/bin/python2.7-config python2.7-config
ln -s ../Cellar/python/2.7.6/bin/python2.7 python2.7
ln -s ../Cellar/python/2.7.6/bin/python2-config python2-config
ln -s ../Cellar/python/2.7.6/bin/python2 python2
ln -s ../Cellar/python/2.7.6/bin/python-config python-config
ln -s ../Cellar/python/2.7.6/bin/python python
ln -s ../Cellar/python/2.7.6/bin/pydoc2.7 pydoc2.7
ln -s ../Cellar/python/2.7.6/bin/pydoc2 pydoc2
ln -s ../Cellar/python/2.7.6/bin/pydoc pydoc
ln -s ../Cellar/python/2.7.6/bin/pip2.7 pip2.7
ln -s ../Cellar/python/2.7.6/bin/pip2 pip2
ln -s ../Cellar/python/2.7.6/bin/pip pip
ln -s ../Cellar/python/2.7.6/bin/idle2.7 idle2.7
ln -s ../Cellar/python/2.7.6/bin/idle2 idle2
ln -s ../Cellar/python/2.7.6/bin/idle idle
ln -s ../Cellar/python/2.7.6/bin/easy_install-2.7 easy_install-2.7
ln -s ../Cellar/python/2.7.6/bin/easy_install easy_install
ln -s ../Cellar/python/2.7.6/bin/2to3-2.7 2to3-2.7
ln -s ../Cellar/python/2.7.6/bin/2to3-2 2to3-2
ln -s ../Cellar/python/2.7.6/bin/2to3 2to3
ln -s ../Cellar/python/2.7.6/share/python python
ln -s ../../../Cellar/python/2.7.6/share/man/man1/python2.7.1 python2.7.1
ln -s ../../../Cellar/python/2.7.6/share/man/man1/python2.1 python2.1
ln -s ../../../Cellar/python/2.7.6/share/man/man1/python.1 python.1
ln -s ../../../Cellar/python/2.7.6/Frameworks/Python.framework/Versions/Current Current
ln -s ../../../Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7 2.7
ln -s ../../Cellar/python/2.7.6/Frameworks/Python.framework/Resources Resources
ln -s ../../Cellar/python/2.7.6/Frameworks/Python.framework/Python Python
ln -s ../../Cellar/python/2.7.6/Frameworks/Python.framework/Headers Headers
ln -s ../../Cellar/python/2.7.6 python
ln -s ../Cellar/python/2.7.6 python
==> Summary
???? /usr/local/Cellar/python/2.7.6: 3790 files, 59M
我注意到 Homebrew Python 页面指出“brew install python”应该在“/usr/local/lib/python2.7/site-packages”创建一个站点包文件夹。但是,当我导航到“/usr/local/lib”并使用“ls -a”时,没有与 python 相关的文件夹。
brew doctor 没有报告错误
提前感谢您,请让我知道可能需要哪些其他信息。
【问题讨论】:
标签: python-2.7 homebrew osx-mavericks