0

我是 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

有什么帮助吗?提前谢谢。

4

1 回答 1

2

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

您可以通过在setup.py本地运行模块来获得相同的错误:

python setup.py

将文档字符串添加到您的crud_utils/__init__.py模块

"""Some docstring here would help"""

PS 您还检查了.pyc字节编译缓存文件到 GitHub,您可能想要删除这些。

于 2012-08-24T14:44:28.853 回答