如何在我的包中修复“找不到.dist-info目录”?

时间:2017-05-30 19:25:08

标签: 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

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

1 个答案:

答案 0 :(得分:0)

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