Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:\users\james\appdata\local\programs\python\python37\lib\site-packages\
        pip\_vendor\pkg_resources\__init__.py", line 2584, in version
            return self._version
          File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
        pip\_vendor\pkg_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:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_internal\commands\install.py", line 503, in _warn_about_conflicts
        package_set, _dep_info = check_install_conflicts(to_install)
      File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_internal\operations\check.py", line 108, in check_install_conflicts
        package_set, _ = create_package_set_from_installed()
      File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_internal\operations\check.py", line 47, in create_package_set_from_installe
    d
        package_set[name] = PackageDetails(dist.version, dist.requires())
      File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_vendor\pkg_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:\users\james\appdata\local\programs\python\python37\lib\site-package
    s))



C:\Users\James>pip list
    Exception:
    Traceback (most recent call last):
      File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_vendor\pkg_resources\__init__.py", line 2584, in version
        return self._version
      File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_vendor\pkg_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:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_internal\cli\base_command.py", line 176, in main
        status = self.run(options, args)
      File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_internal\commands\list.py", line 148, in run
        self.output_package_listing(packages, options)
      File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_internal\commands\list.py", line 205, in output_package_listing
        data, header = format_for_columns(packages, options)
      File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_internal\commands\list.py", line 271, in format_for_columns
        row = [proj.project_name, proj.version]
      File "c:\users\james\appdata\local\programs\python\python37\lib\site-packages\
    pip\_vendor\pkg_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:\users\james\appdata\local\programs\python\python37\lib\site-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!

like image 348
James Avatar asked Jan 31 '19 06:01

James


People also ask

How do I check pip installation list?

For the full list of pip options, simply run pip --help in your terminal and the command will return the usage information. Usage:pip <command> [options]Commands: install Install packages.

Why pip install is not working?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.

What does pip install E does?

pip install -e . This will install the current package in your Python environment in an editable mode. You can keep changing this package at its source directory and your changes will be immediately reflected in your environment.


1 Answers

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

The recommendation in your case would be to go into

c:\users\james\appdata\local\programs\python\python37\lib\site-packages

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

like image 167
longbowking Avatar answered Sep 26 '22 21:09

longbowking