我有一个 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
,并且安装得很好。有谁知道这里发生了什么以及如何解决它?