PIP安装“错误:包目录'X'不存在”

时间:2014-08-16 01:27:50

标签: python pip packaging easy-install

我正在尝试通过PIP安装this package。它给了我以下错误:

error: package directory 'RTbatch' does not exist

我觉得这很奇怪,因为the relevant setup.py没有提到任何packages变量,只有py_modules

怎么了?你能帮我吗?

以下是pip install -e RTbatch的完整输出:

Obtaining file:///home/chymera/RTbatch
  Running setup.py (path:/home/chymera/RTbatch/setup.py) egg_info for package from file:///home/chymera/RTbatch
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'heywords'
      warnings.warn(msg)

    error: package directory 'RTbatch' does not exist
    Complete output from command python setup.py egg_info:
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'heywords'

  warnings.warn(msg)

running egg_info

creating RTbatch.egg-info

writing requirements to RTbatch.egg-info/requires.txt

writing RTbatch.egg-info/PKG-INFO

writing top-level names to RTbatch.egg-info/top_level.txt

writing dependency_links to RTbatch.egg-info/dependency_links.txt

writing manifest file 'RTbatch.egg-info/SOURCES.txt'

warning: manifest_maker: standard file '-c' not found



error: package directory 'RTbatch' does not exist

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/chymera/RTbatch
Storing debug log for failure in /home/chymera/.pip/pip.log

4 个答案:

答案 0 :(得分:7)

py_modules获取模块名称列表,而不是文件。您的通话会查找RTBatch/py.pyRTBatch_cli/py.py

答案 1 :(得分:1)

就我而言,我用于安装的文件夹已损坏。它没有完全安装。我在笔记本电脑上下载了它,然后将其移到了服务器上。但它被打破了。所以我再次下载它,一切顺利。

答案 2 :(得分:0)

就我而言,我在Windows上,当前目录位于其他驱动器中,python <full path including drive>/setup.py install失败,不得不更改为驱动器和文件夹,而改用python setup.py

答案 3 :(得分:0)

您似乎在 setup.py 中添加了项目文件夹 (RTbatch) 作为包。只需确保 setup.py 中的包列表仅包含 python 包(例如:带有 init.py 的文件夹)。

希望这能解决问题。