小编Gar*_*ins的帖子

"/lib/python2.7/site-packages/不支持.pth文件"在MacOS上安装pip

我在我的mac上使用pip遇到了一些问题,并完全卸载了它.

现在当我尝试重新安装它时,运行$sudo easy_install pip我得到:

TEST FAILED: /lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

    ''
Run Code Online (Sandbox Code Playgroud)

[此粘贴输出因简洁而缩短]


我尝试使用./profile和./bash_profile将列出的目录(/lib/python2.7/site-packages/)添加到我的pythonpath中,但是当我运行python时它既不会影响sys.path变量,只包括

/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Library/Python/2.7/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC …
Run Code Online (Sandbox Code Playgroud)

python macos pip easy-install

2
推荐指数
1
解决办法
3560
查看次数

标签 统计

easy-install ×1

macos ×1

pip ×1

python ×1