ssato / python-anyconfig

Python library provides common APIs to load and dump configuration files in various formats
MIT License
277 stars 31 forks source link

0.9.9: anyconfig .dist-info directory not found #110

Closed ssbarnea closed 10 months ago

ssbarnea commented 5 years ago

pip3 install anyconfig fails with:

WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting anyconfig
Installing collected packages: anyconfig
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3.6/site-packages/pip/commands/install.py", line 365, in run
    strip_file_prefix=options.strip_file_prefix,
  File "/usr/lib/python3.6/site-packages/pip/req/req_set.py", line 789, in install
    **kwargs
  File "/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 854, in install
    strip_file_prefix=strip_file_prefix
  File "/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 1069, in move_wheel_files
    strip_file_prefix=strip_file_prefix,
  File "/usr/lib/python3.6/site-packages/pip/wheel.py", line 347, in move_wheel_files
    assert info_dir, "%s .dist-info directory not found" % req
AssertionError: anyconfig .dist-info directory not found

This is happening with pip 9.0.3, which happens to be the default version installed on the new rhel8.

Package metadata should be adapted so installation failure does not happen, even if pip is not the latest and greatest.

What makes this problem even worse is that if user attempts to upgrade pip with pip, it will rended pip unusable:

# pip3 install -U pip
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting pip
  Downloading https://files.pythonhosted.org/packages/62/ca/94d32a6516ed197a491d17d46595ce58a83cbb2fca280414e57cd86b84dc/pip-19.2.1-py2.py3-none-any.whl (1.4MB)
Installing collected packages: pip
Successfully installed pip-19.2.1
[root@leno ansible-role-container-registry]# pip3 install anyconfig
Traceback (most recent call last):
  File "/usr/bin/pip3", line 7, in <module>
    from pip import main
ImportError: cannot import name 'main'

This happens because pip installs exec into /usr/local/bin/pip3 but system has it under /usr/bin/pip3 and the shim script uses an old import method which crashes the old launcher.

Even afther finding workarounds to run with latest pip (19.2.1), I still get the same error.

ssbarnea commented 5 years ago

The problem happens with 0.9.9 and 0.9.8 versions, but i was able to install 0.9.7 without problems. Clearly the project needs a test which validates that package is installable with pip 9.0.1 (even if not even older than this).

ssato commented 5 years ago

Thanks a lot for your report!

I changed to use setup.cfg since 0.9.8 and it might cause the problem. I'll dig into it this weekend.

ssbarnea commented 5 years ago

@ssato Anychance of solving this? I keep getting into conflicts where Anyconfig 0.9.9 gets installed and breaks even when I mentioned anyconfig==0.9.7, the last one that had a valid metadata.

ssato commented 5 years ago

I'm not sure this issue was resolved but tried that and uploaded the 0.9.10. Could you please try it?

perlun commented 4 years ago

@ssbarnea Can you still reproduce this with anyconfig 0.9.10?