当我尝试这样做时,我试图解决另一个问题 pip uninstall scikit-learn
完成后,我收到了红色文本,例如:
pip install --upgrade pip
Error checking for conflicts.
Traceback (most recent call last):
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_vendorpkg_resources__init__.py", line 2584, in version
return self._version
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_vendorpkg_resources__init__.py", line 2691, in __getattr__
raise AttributeError(attr)
AttributeError: _version
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_internalcommandsinstall.py", line 503, in _warn_about_conflicts
package_set, _dep_info = check_install_conflicts(to_install)
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_internaloperationscheck.py", line 108, in check_install_conflicts
package_set, _ = create_package_set_from_installed()
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_internaloperationscheck.py", line 47, in create_package_set_from_installe
d
package_set[name] = PackageDetails(dist.version, dist.requires())
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_vendorpkg_resources__init__.py", line 2589, in version
raise ValueError(tmpl % self.PKG_INFO, self)
ValueError: ("Missing 'Version:' header and/or METADATA file", Unknown [unknown
version] (c:usersjamesappdatalocalprogramspythonpython37libsite-package
s))
C:UsersJames>pip list
Exception:
Traceback (most recent call last):
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_vendorpkg_resources__init__.py", line 2584, in version
return self._version
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_vendorpkg_resources__init__.py", line 2691, in __getattr__
raise AttributeError(attr)
AttributeError: _version
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_internalclibase_command.py", line 176, in main
status = self.run(options, args)
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_internalcommandslist.py", line 148, in run
self.output_package_listing(packages, options)
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_internalcommandslist.py", line 205, in output_package_listing
data, header = format_for_columns(packages, options)
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_internalcommandslist.py", line 271, in format_for_columns
row = [proj.project_name, proj.version]
File "c:usersjamesappdatalocalprogramspythonpython37libsite-packages
pip_vendorpkg_resources__init__.py", line 2589, in version
raise ValueError(tmpl % self.PKG_INFO, self)
ValueError: ("Missing 'Version:' header and/or METADATA file", Unknown [unknown
version] (c:usersjamesappdatalocalprogramspythonpython37libsite-package
s))
关于我将如何解决此问题的任何建议(Windows)。我什至不知道要搜索此错误的内容。任何建议都将是祝福!
此问题在 pip GitHub 存储库上解决了类似的问题。
在您的情况下,建议进入
c:usersjamesappdatalocalprogramspythonpython37libsite-packages
并且,对于以"-"开头的每个文件夹,将其删除并重新安装相应的包。