python3 不小心 卸载了 pip,重装 pip 办法
2023-06-13 09:18:39 时间
日志记录
1. 手残了,多打了 pip,而且还没看提示,一路 Y(Mac OS)
(joyoo) yinzhuoqundeMacBook-Pro:joyoo yinzhuoqun$ pip uninstall pip install django-celery-results
Uninstalling pip-19.3.1:
Would remove:
/Users/yinzhuoqun/.pyenv/joyoo/bin/pip
/Users/yinzhuoqun/.pyenv/joyoo/bin/pip3
/Users/yinzhuoqun/.pyenv/joyoo/bin/pip3.6
/Users/yinzhuoqun/.pyenv/joyoo/lib/python3.6/site-packages/pip-19.3.1.dist-info/*
/Users/yinzhuoqun/.pyenv/joyoo/lib/python3.6/site-packages/pip/*
Proceed (y/n)? y
Successfully uninstalled pip-19.3.1
WARNING: Skipping install as it is not installed.
Uninstalling django-celery-results-1.1.2:
Would remove:
/Users/yinzhuoqun/.pyenv/joyoo/lib/python3.6/site-packages/django_celery_results-1.1.2.dist-info/*
/Users/yinzhuoqun/.pyenv/joyoo/lib/python3.6/site-packages/django_celery_results/*
Proceed (y/n)?
Your response ('') was not one of the expected responses: y, n
Proceed (y/n)? y
Successfully uninstalled django-celery-results-1.1.2
(joyoo) yinzhuoqundeMacBook-Pro:joyoo yinzhuoqun$ pip uninstall django-celery-results
-bash: /Users/yinzhuoqun/.pyenv/joyoo/bin/pip: No such file or directory
(joyoo) yinzhuoqundeMacBook-Pro:joyoo yinzhuoqun$ pip
-bash: /Users/yinzhuoqun/.pyenv/joyoo/bin/pip: No such file or directory
2. 升级 pip 因目录或文件权限问题,卸载了旧版 pip 但是没装上新版 pip(Windows)
(joyoo) E:\yinzhuoqun\djangos\joyoo>pip install --upgrade pip
Collecting pip
Downloading pip-20.1.1-py2.py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 29 kB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Uninstalling pip-20.0.2:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'e:\\py_virtualenv\\joyoo\\scripts\\pip.exe'
Consider using the `--user` option or check the permissions.
(joyoo) E:\yinzhuoqun\djangos\joyoo>pip uninstall djangorestframework
Traceback (most recent call last):
File "d:\program files\python36\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\program files\python36\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "E:\py_virtualenv\joyoo\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
重装 pip
Mac: cd 到 该 python 环境的 bin 目录(/Users/yinzhuoqun/.pyenv/joyoo/bin)
执行:./easy_install pip
yinzhuoqundeMacBook-Pro:bin yinzhuoqun$ ./easy_install pip
Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl#sha256=6917c65fc3769ecdc61405d3dfd97afdedd75808d200b2838d7d961cebc0c2c7
Best match: pip 19.3.1
Processing pip-19.3.1-py2.py3-none-any.whl
Installing pip-19.3.1-py2.py3-none-any.whl to /Users/yinzhuoqun/.pyenv/joyoo/lib/python3.6/site-packages
Adding pip 19.3.1 to easy-install.pth file
Installing pip script to /Users/yinzhuoqun/.pyenv/joyoo/bin
Installing pip3 script to /Users/yinzhuoqun/.pyenv/joyoo/bin
Installing pip3.7 script to /Users/yinzhuoqun/.pyenv/joyoo/bin
Installed /Users/yinzhuoqun/.pyenv/joyoo/lib/python3.6/site-packages/pip-19.3.1-py3.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
Windows:cd 到 该 python 环境的 Scripts 目录
执行:easy_install.exe pip
(joyoo) E:\py_virtualenv\joyoo\Scripts>easy_install.exe pip
Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl#sha256=b27c4dedae8c41aa59108f2fa38bf78e0890e590545bc8ece7cdceb4ba60f6e4
Best match: pip 20.1.1
Processing pip-20.1.1-py2.py3-none-any.whl
Installing pip-20.1.1-py2.py3-none-any.whl to e:\py_virtualenv\joyoo\lib\site-packages
Adding pip 20.1.1 to easy-install.pth file
Installing pip-script.py script to e:\py_virtualenv\joyoo\Scripts
Installing pip.exe script to e:\py_virtualenv\joyoo\Scripts
Installing pip3-script.py script to e:\py_virtualenv\joyoo\Scripts
Installing pip3.exe script to e:\py_virtualenv\joyoo\Scripts
Installing pip3.8-script.py script to e:\py_virtualenv\joyoo\Scripts
Installing pip3.8.exe script to e:\py_virtualenv\joyoo\Scripts
Installed e:\py_virtualenv\joyoo\lib\site-packages\pip-20.1.1-py3.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
相关文章
- Python3对多股票的投资组合进行分析「建议收藏」
- Python3 编程笔记
- 3.Python3扩展知识之笔试操作总结(三)
- 1.Python3扩展知识之笔试操作总结(一)
- 4.Python3基础入门学习笔记(四)
- Python3爬虫学习.md
- python3安装后没有pip_解决Centos7安装python3后pip工具无法使用「建议收藏」
- python3中eval函数用法简介[通俗易懂]
- 群晖 NAS Python3 PIP
- ImportError: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/local/python3/lib...
- Python3 hasattr()、getattr()、setattr()函数简介详解编程语言
- Python3 pip出现Fatal error in launcher: Unable to create process using ‘”‘详解编程语言
- Python3 itchat微信获取好友、公众号、群聊的基础信息详解编程语言
- Python3.x与Python2.x的区别详解编程语言
- Python3.x:BeautifulSoup()解析网页内容出现乱码详解编程语言
- Python3.x与Python2.x的差异用法详解编程语言
- Linux 中实现 Pip 安装的简易指南(pip安装linux)
- Linux 安装PIP的简易步骤(linux怎么安装pip)
- 在 CentOS 6 系统上安装最新版 Python3 软件包的 3 种方法