它突然搞砸了我的所有装置。
我已使用pip BeautifulSoup4
安装了它,例如
它继续安装 - 当我使用python并导入它时;它没有正确导入它。
然而;不知怎的,我的请求有效。我想我弄乱了我的PATH变量。
>>> import sys
>>> print '\n'.join(sys.path)
/usr/local/Library/Python/2.7/site-packages
/usr/local/lib/python2.7/site-packages
/Library/python2.7/site-packages
/Library/python2.7/site-packages/usr/local/lib/python2.7/site-packages
/usr/lib/python2.7/site-packages/Library/python2.7/site-packages
/usr/lib/python2.7/site-packages/Users/biplovdahal/Library/Python/2.7/lib/python/site-packages
/Users/biplovdahal/Library/Python/2.7/lib/python/site-packages
/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
^我如何设置我的pip来收听特定的网站包并继续将我未来的模块安装在那个网站包中。我不想让它混淆了。我也想尽可能地解决所有权限问题,以便我可以安全地安装我的包并使用它。
答案 0 :(得分:-1)
你可以通过像这样的
前缀python路径来调用pip /usr/local/bin/python pip install <package name>
以上命令将site-packages放在/usr/local/lib/python2.7/site-packages/
文件夹中。如果要将其更改为安装到其他库,则更改pip
命令中的python路径