How to fix ".dist-info directory not found" in my package?
Asked Answered
B

2

7

I have a Python 2 package that I'm trying to upgrade to Python 3. It was written by someone who used to work on the same team I'm on now but who is no longer with the company, and unfortunately nobody left on the team is able to help out.

After running 2to3 on the files of the package, I ran python setup.py sdist to create a package, placed the package in a local repository, then attempted to use pip install to install the package. It ended up erroring out with the following:

Exception:
Traceback (most recent call last):
  File "/home/user/project/lib/python3.5/site-packages/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/home/user/project/lib/python3.5/site-packages/pip/commands/install.py", line 297, in run
    root=options.root_path,
  File "/home/user/project/lib/python3.5/site-packages/pip/req/req_set.py", line 622, in install
    **kwargs
  File "/home/user/project/lib/python3.5/site-packages/pip/req/req_install.py", line 808, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/home/user/project/lib/python3.5/site-packages/pip/req/req_install.py", line 1003, in move_wheel_files
    isolated=self.isolated,
  File "/home/user/project/lib/python3.5/site-packages/pip/wheel.py", line 340, in move_wheel_files
    assert info_dir, "%s .dist-info directory not found" % req
AssertionError: my-package-name .dist-info directory not found

The old Python 2 version of the package didn't have anything called .dist-info in the .tgz archive, and it installed just fine. Does anyone know what's going on here and how to fix it?

Bigamous answered 30/5, 2017 at 19:25 Comment(1)
I had a similar issue, and it turned out that the installation was ok despite of the error. Just give it a try.Resultant
A
4

In my case this was resolved by deleting AppData\Local\pip\Cache folder (windows). Should be fairly similar for other operating systems.

Alcatraz answered 20/3, 2019 at 15:6 Comment(1)
see here for other operating systems: https://mcmap.net/q/49603/-pip-uses-incorrect-cached-package-version-instead-of-the-user-specified-versionFrederickson
G
0

It is expected to be a cache problem, but in the end I solved it with pip3.

First,

pip3 install --upgrade pip

and retry it.

Ginny answered 19/6, 2023 at 6:15 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Thorianite

© 2022 - 2024 — McMap. All rights reserved.