如何修复我的包中的“.dist-info directory not found”?

Mas*_*ler 6 python pip python-2to3

我有一个 Python 2 包,我正在尝试升级到 Python 3。它是由曾经在我现在所在的同一团队工作但不再在公司工作的人编写的,不幸的是没有人离开团队能够提供帮助。

在包的文件上运行 2to3 后,我跑去python setup.py sdist创建一个包,将包放在本地存储库中,然后尝试使用pip install来安装包。它最终出现以下错误:

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
Run Code Online (Sandbox Code Playgroud)

该软件包的旧 Python 2 版本.dist-info在 .tgz 存档中没有任何内容,并且安装得很好。有谁知道这里发生了什么以及如何解决它?

Mic*_*ael 4

就我而言,这是通过删除AppData\Local\pip\Cache文件夹(Windows)解决的。其他操作系统应该非常相似。