问题 链接
如何使用pip更新python的所有包
没有内置的标志可以实现
但是你可以这么做
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U
问题 链接
pip, setuptools/easy_install的另一种选择,提供uninstall命令
首先,移除依赖
$ easy_install -m [PACKAGE]
然后,手动删除egg文件
$ rm -rf .../python2.X/site-packages/[PACKAGE].egg
问题 链接
参考 How to Install Django" documentation
可以在shell中执行
python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
更好的可读性
from distutils.sysconfig import get_python_lib
print(get_python_lib())
问题 链接
使用下面命令安装的包如何卸载
python setup.py install
手工删除的话
python setup.py install --record files.txt
cat files.txt | xargs rm -rf
问题 链接
>>> help('modules')
问题 链接
有一条推文
Don't use easy_install, unless you like stabbing yourself in the face. Use pip.
Pip简介
All packages are downloaded before installation. Partially-completed installation doesn’t occur as a result.
Care is taken to present useful output on the console.
The reasons for actions are kept track of. For instance, if a package is being installed, pip keeps track of why that package was required.
Error messages should be useful.
The code is relatively concise and cohesive, making it easier to use programmatically.
Packages don’t have to be installed as egg archives, they can be installed flat (while keeping the egg metadata).
Native support for other version control systems (Git, Mercurial and Bazaar)
Uninstallation of packages.
Simple to define fixed sets of requirements and reliably reproduce a set of packages.
其他原因:
Another—as of yet unmentioned—reason for favoring pip is because it is the new hotness and will continue to be used in the future.
pip提供unstall命令
如果中途安装失败,pip will leave you in a clean state.