我正在测试Python安装。我找到了两个sqlite3
和graph_tool
软件包,它们可以import
发出,但它们却从DistributionNotFound
发出了pkg_resources
错误(请参阅下面的控制台日志) )。
pkg_resources
的确切功能是什么,怎么会丢失已安装的模块?
控制台日志:
>>> import pkg_resources
>>> import graph_tool
>>> pkg_resources.get_distribution("graph_tool")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/anaconda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 481, in get_distribution
dist = get_provider(dist)
File "/anaconda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 357, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/anaconda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/anaconda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'graph_tool' distribution was not found and is required by the application
和
>>> import sqlite3
>>> pkg_resources.get_distribution("sqlite3")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/anaconda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 481, in get_distribution
dist = get_provider(dist)
File "/anaconda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 357, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/anaconda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/anaconda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'sqlite3' distribution was not found and is required by the application