Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install fail on Windows 10 because of the ill handling of the path str. #6392

Closed
ghost opened this issue Apr 9, 2019 · 6 comments
Closed
Labels
auto-locked Outdated issues that have been locked by automation OS: windows Windows specific resolution: duplicate Duplicate of an existing issue/PR

Comments

@ghost
Copy link

ghost commented Apr 9, 2019

Environment

  • pip version: 19.0.3 19.0.1 (python 3.7)
  • Python version: Python 3.7.3 from python.org
  • OS: Windows10 Home 10.0.171314 build 17134

Description
Any pip install fail with the "FileNotFoundError: [Errno 2] No such file or directory: 'c:\users\path\to\python37\site-packages\pip-19.0.1.dist-info\{METADATA,RECORD}'"

I feel strange the base name of the path is in uppercase while the other part of the path is in lower case (exactly mistakes).

Expected behavior
Do not convert the dirname part to lower case and success to install.

How to Reproduce

  1. Clean install Python 3.7.3 by using the executable install package on www.python.org
  2. run pip install --upgrade pip in the command prompt.

Output exampled

Kazuy is my user name at the machine.

C:\Users\Kazuy>pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl
Error checking for conflicts.
Traceback (most recent call last):
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2897, in _dep_map
    return self.__dep_map
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2691, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2888, in _parsed_pkg_info
    return self._pkg_info
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2691, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\kazuy\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\kazuy\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\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\check.py", line 47, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2635, in requires
    dm = self._dep_map
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2899, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2908, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2890, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1410, in get_metadata
    value = self._get(self._fn(self.egg_info, name))
  File "c:\users\kazuy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1522, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\users\\kazuy\\appdata\\roaming\\python\\python37\\site-packages\\pip-19.0.1.dist-info\\METADATA'
Installing collected packages: pip
  Found existing installation: pip 19.0.1
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'c:\\users\\kazuy\\appdata\\roaming\\python\\python37\\site-packages\\pip-19.0.1.dist-info\\RECORD'
@cjerdonek
Copy link
Member

What do you get when you list the contents of the directory in the error message?

c:\users\path\to\python37\site-packages\pip-19.0.1.dist-info\

@cjerdonek cjerdonek added S: needs triage Issues/PRs that need to be triaged OS: windows Windows specific labels Apr 13, 2019
@ghost
Copy link
Author

ghost commented Apr 13, 2019

After reporting this issue, once I uninstall python.org's Python and install Miniconda'sPython.
And now, to reproduce the problem, I re-installed python.org.Python, but I could not reproduce the problem (installations succeeded).

That is because pip-19.0.3 is installed, by installing the latest version of Python3 in python.org.

So re-installing solve this issue for me.

But, the problem was reproduced by downgrading pip to version 19.0.1.
And the contents of the directory c:\Users\Kazuy\\AppData\Roaming\Python\Python37\site-packages\pip-19.0.1.dist-info is as below.

> dir c:\Users\Kazuy\\AppData\Roaming\Python\Python37\site-packages\pip-19.0.1.dist-info\

...

2019/04/13  17:48    <DIR>          .
2019/04/13  17:48    <DIR>          ..
2019/04/13  17:47    <DIR>          pip-19.0.1.dist-info

and the content of the nested pip-19.0.1.dist-info directory is as below.

dir c:\Users\Kazuy\\AppData\Roaming\Python\Python37\site-packages\pip-19.0.1.dist-info\pip-19.0.1.dist-info

...

2019/04/13  17:47    <DIR>          .
2019/04/13  17:47    <DIR>          ..
2019/04/13  17:47                98 entry_points.txt
2019/04/13  17:47                 4 INSTALLER
2019/04/13  17:47             1,090 LICENSE.txt
2019/04/13  17:47             3,189 METADATA
2019/04/13  17:47            47,768 RECORD
2019/04/13  17:47                 4 top_level.txt
2019/04/13  17:47               110 WHEEL

@cjerdonek
Copy link
Member

There was a bug in 19.0.1 that caused .dist-info directories to nest: #6194

That bug was fixed in 19.0.2, so it looks like you were seeing that when downgrading.

@ghost
Copy link
Author

ghost commented Apr 13, 2019

It seems that I used old pip for some reason.
I have no problem with the latest Python/pip set.

Thank you for Spending your precious time.

@ghost ghost closed this as completed Apr 13, 2019
@cjerdonek cjerdonek added resolution: duplicate Duplicate of an existing issue/PR and removed S: needs triage Issues/PRs that need to be triaged labels Apr 13, 2019
@cjerdonek
Copy link
Member

:)

@lock
Copy link

lock bot commented May 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation OS: windows Windows specific resolution: duplicate Duplicate of an existing issue/PR
Projects
None yet
Development

No branches or pull requests

1 participant