美文网首页
python modules or packages的安装与卸载

python modules or packages的安装与卸载

作者: 爱回忆的小六 | 来源:发表于2018-03-02 09:35 被阅读0次

一、官方安装卸载手段

pip install xxx

pip uninstall xxx

如果遇到如下错误,可能用到的解决方案:

    Downloading/unpacking pexpect

          Cannot fetch index base URL https://pypi.python.org/simple/

          Could not find any downloads that satisfy the requirement pexpect

    Cleaning up...

        No distributions at all found for pexpect

        Storing debug log for failure in C:\Users\easylu\pip\pip.log

1、升级pip:python -m pip install --upgrade pip

2、如果连上面的升级都执行失败,看下浏览器是否被设置了代理,暂时去掉吧。

二、第三方安装卸载手段

解压目录/python setup.py install

解压目录/python setup.py uninstall

不幸的是有时你会发现uninstall不成功,那么就需要手动删除了

三、手工删除

第一步:找到python的目录

>>> import sys

>>> print sys.path

第二步:找到module or packages的目录,手动删除

以python2.7为例,一般在python安装目录/lib/site-packages下,本文以删除pexpect为例,在该目录下找到安装目录(pexpect)及配置目录(pexpect-4.4.0.dist-info),删除掉。

第三步:删除安装配置行

在python安装目录/lib/site-packages/easy-install.pth文件中找到pexpect对应的行,删除即可。

四、.whl文件的安装卸载

依然使用pip:

    pip install xxx.whl

    pip uninstall xxx.whl

附录:pip可安装的所有包https://pypi.python.org/simple/

相关文章

网友评论

      本文标题:python modules or packages的安装与卸载

      本文链接:https://www.haomeiwen.com/subject/jgtqxftx.html