pip常用命令
今日使用pip list,出现一堆错误:
Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 134, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip/commands/list.py", line 80, in run self.run_listing(options) File "/Library/Python/2.7/site-packages/pip/commands/list.py", line 127, in run_listing self.output_package_listing(installed_packages) File "/Library/Python/2.7/site-packages/pip/commands/list.py", line 136, in output_package_listing if dist_is_editable(dist): File "/Library/Python/2.7/site-packages/pip/util.py", line 347, in dist_is_editable req = FrozenRequirement.from_dist(dist, []) File "/Library/Python/2.7/site-packages/pip/__init__.py", line 194, in from_dist assert len(specs) == 1 and specs[0][0] == '==' AssertionError
使用下面命令更新pip自己:
sudo -H pip install --upgrade pip sudo -H pip install --upgrade setuptools sudo pip install --upgrade distribute
问题解决。
安装新包:
pip install PackageName
检查更新:
pip list --outdated
更新包:
pip install --upgrade PackageName
卸载包:
pip uninstall PackageName