Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
202 views
in Technique[技术] by (71.8m points)

python - Different error messages when using pip install, pip list ect

I was attempting to fix another issue when i tried to do pip uninstall scikit-learn After doing that I received red text such as:

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\_internalcliase_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))

Any advise on how I would fix this (Windows). I do not even know what to search for this error. Any advice would be a blessing!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

A similar problem is addressed in this Issue on the pip GitHub repository.

The recommendation in your case would be to go into

c:usersjamesappdatalocalprogramspythonpython37libsite-packages

and, for each folder that starts with "-", delete it and reinstall the corresponding package.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...