打包python应用程序以使其可以进行pip安装时出错

时间:2012-08-24 14:40:54

标签: python django git github pip

我是git的新手,并通过github部署了我的第一个python-django应用程序: https://github.com/staticdev/django-crud-utils

问题在于,当我尝试安装它时,我收到错误:

$ pip install -e git://github.com/staticdev/django-crud-utils.git#egg=django-crud-utils
Obtaining django-crud-utils from git+git://github.com/staticdev/django-crud-utils.git#egg=django-crud-utils
  Updating /home/static/virtualenvs/prp2/src/django-crud-utils clone
  Running setup.py egg_info for package django-crud-utils
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/home/static/virtualenvs/prp2/src/django-crud-utils/setup.py", line 15, in <module>
        DESC = " ".join(__import__('crud_utils').__doc__.splitlines()).strip()
    AttributeError: 'NoneType' object has no attribute 'splitlines'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/home/static/virtualenvs/prp2/src/django-crud-utils/setup.py", line 15, in <module>

    DESC = " ".join(__import__('crud_utils').__doc__.splitlines()).strip()

AttributeError: 'NoneType' object has no attribute 'splitlines'

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/static/virtualenvs/prp2/src/django-crud-utils
Storing complete log in /home/static/.pip/pip.log

有任何帮助吗? 请事先提前。

1 个答案:

答案 0 :(得分:2)

您在crud_utils软件包上没有文档字符串,因此安装失败。

只需在本地运行setup.py模块即可获得相同的错误:

python setup.py

将文档字符串添加到crud_utils/__init__.py module

"""Some docstring here would help"""

<子> P.S。您还将.pyc字节编译的缓存文件签入GitHub,您可能希望删除它们。