pip 安装six 报错 ModuleNotFoundError: No module named 'pip._internal.cli.main'
1、对 pip 进行升级
python -m pip install --upgrade pip
发现报错
Collecting pip Downloading https://files.pythonhosted.org/packages/54/2e/df11ea7e23e7e761d484ed3740285a34e38548cf2bad2bed3dd5768ec8b9/pip-20.1-py2.py3-none-any.whl (1.5MB) |████████████████████████████████| 1.5MB 595kB/s Installing collected packages: pip Found existing installation: pip 19.3.1 Uninstalling pip-19.3.1: Successfully uninstalled pip-19.3.1 Rolling back uninstall of pip Moving to d:\program files\python3.6\lib\site-packages\pip-19.3.1-py3.6.egg from d:\program files\python3.6\lib\site-packages\~ip-19.3.1-py3.6.egg Moving to d:\program files\python3.6\scripts\pip.exe from C:\Users\Public\Documents\iSkysoft\CreatorTemp\pip-uninstall-39tpl7uw\pip.exe Moving to d:\program files\python3.6\scripts\pip3.6-script.py from C:\Users\Public\Documents\iSkysoft\CreatorTemp\pip-uninstall-39tpl7uw\pip3.6-script.py Moving to d:\program files\python3.6\scripts\pip3.6.exe from C:\Users\Public\Documents\iSkysoft\CreatorTemp\pip-uninstall-39tpl7uw\pip3.6.exe Moving to d:\program files\python3.6\scripts\pip3.exe from C:\Users\Public\Documents\iSkysoft\CreatorTemp\pip-uninstall-39tpl7uw\pip3.exe ERROR: Exception: Traceback (most recent call last): File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_internal\cli\base_command.py", line 153, in _main status = self.run(options, args) File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_internal\commands\install.py", line 455, in run use_user_site=options.use_user_site, File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_internal\req\__init__.py", line 62, in install_given_reqs **kwargs File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_internal\req\req_install.py", line 861, in install use_user_site=use_user_site, pycompile=pycompile, File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_internal\req\req_install.py", line 495, in move_wheel_files warn_script_location=warn_script_location, File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_internal\wheel.py", line 594, in move_wheel_files generated_console_scripts = maker.make_multiple(scripts_to_generate) File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_vendor\distlib\scripts.py", line 402, in make_multiple filenames.extend(self.make(specification, options)) File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_internal\wheel.py", line 330, in make return super(PipScriptMaker, self).make(specification, options) File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_vendor\distlib\scripts.py", line 391, in make self._make_script(entry, filenames, options=options) File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_vendor\distlib\scripts.py", line 295, in _make_script self._write_script(scriptnames, shebang, script, filenames, ext) File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_vendor\distlib\scripts.py", line 231, in _write_script launcher = self._get_launcher('t') File "D:\Program Files\Python3.6\lib\site-packages\pip-19.3.1-py3.6.egg\pip\_vendor\distlib\scripts.py", line 370, in _get_launcher result = finder(distlib_package).find(name).bytes AttributeError: 'NoneType' object has no attribute 'bytes'
接着对pip 进行强制升级
python -m pip install -U --force-reinstall pip Collecting pip Using cached pip-20.1-py2.py3-none-any.whl (1.5 MB) Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 20.1 Uninstalling pip-20.1: Successfully uninstalled pip-20.1 Successfully installed pip-20.1
到这里终于对 pip 升级的问题解决
接下来看刚开始的问题是否解决
pip install six Requirement already satisfied: six in d:\program files\python3.6\lib\site-packages (1.12.0) Could not build wheels for six, since package 'wheel' is not installed.
看执行解决似乎已经解决,但是新的问题又出现了 说wheel 没有被安装,接下来安装wheel
pip install wheel Collecting wheel Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB) Installing collected packages: wheel Successfully installed wheel-0.34.2
安装成功,至此问题解决
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具