简体   繁体   English

外部库上pydev的DistributionNotFound错误

[英]DistributionNotFound error with pydev on external lib

I am trying to do my first python program using an external Ckan library . 我正在尝试使用外部Ckan库执行我的第一个python程序。 I added the library and it seems to be working because the command import ckanap does not give me no errors. 我添加了该库,它似乎正在工作,因为命令import ckanap不会给我任何错误。 BUT when i try to run the program, i get this error 但是当我尝试运行程序时,出现此错误

pkg_resources.DistributionNotFound: ckanapi pkg_resources.DistributionNotFound:ckanapi

the full error message (if needed) is this 完整的错误消息(如果需要)是这个

Finding files... done.
Traceback (most recent call last):
  File "/home/ilias/Programming/Eclipse/eclipse/plugins/org.python.pydev_4.1.0.201505270003/pysrc/pydev_runfiles.py", line 468, in __get_module_from_str
    mod = __import__(modname)
  File "/home/ilias/EclipseWorkspace/PythonFirst/root/nested/example.py", line 14, in <module>
    import ckanapi
  File "/home/ilias/Downloads/ckanapi-master/ckanapi/__init__.py", line 19, in <module>
    from ckanapi.remoteckan import RemoteCKAN
  File "/home/ilias/Downloads/ckanapi-master/ckanapi/remoteckan.py", line 11, in <module>
    from ckanapi.version import __version__
  File "/home/ilias/Downloads/ckanapi-master/ckanapi/version.py", line 3, in <module>
    __version__ = pkg_resources.require("ckanapi")[0].version
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 725, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 628, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: ckanapi
ERROR: Module: example could not be imported (file: /home/ilias/EclipseWorkspace/PythonFirst/root/nested/example.py).
Importing test modules ... done.
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK

I have search the internet about it, but the error is not much helpfull, let alone that i am complete newbie to python. 我已经在网上搜索了一下,但是错误并没有太大帮助,更不用说我是python的新手了。

by the way, i get this error even with no commands at all, just with the import statement 顺便说一句,我什至根本没有任何命令,只是使用import语句会出现此错误

Edit 编辑
Output of command python -c "import sys ; print( '\\n'.join(sorted(sys.path)))" 命令python -c "import sys ; print( '\\n'.join(sorted(sys.path)))"

/usr/lib/pymodules/python2.7
/usr/lib/python2.7
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/PILcompat
/usr/lib/python2.7/dist-packages/gtk-2.0
/usr/lib/python2.7/dist-packages/ubuntu-sso-client
/usr/lib/python2.7/lib-dynload
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/local/lib/python2.7/dist-packages

I think this is an installation issue with ckanapi... 我认为这是ckanapi的安装问题...

It seems it has many dependencies: https://github.com/ckan/ckanapi/blob/master/requirements.txt 似乎它具有许多依赖性: https : //github.com/ckan/ckanapi/blob/master/requirements.txt

How did you install it? 您是如何安装的? Have you tried pip install ckanapi? 您是否尝试过pip install ckanapi?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM