0

我是一个完整的初学者,但我在 django-cookiecutter 的帮助下使用 Python / Django 创建了一个小型网站,包括部署到 Heroku 的说明。我正在第一次将它部署到 Heroku,但是,在运行 setup.py install for django-appconf 时构建失败,这表明这是由于 Heroku 已经拥有“六”包。

我收到的错误消息如下:

 Running setup.py install for django-appconf: finished with status 'error'
           Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tzjhtkga/django-appconf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-y2i8uuc4-record/install-record.txt --single-version-externally-managed --compile --without-c-extensions:
           usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
              or: -c --help [cmd1 cmd2 ...]
              or: -c --help-commands
              or: -c cmd --help

           error: option --without-c-extensions not recognized

           ----------------------------------------
       Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tzjhtkga/django-appconf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-y2i8uuc4-record/install-record.txt --single-version-externally-managed --compile --without-c-extensions" failed with error code 1 in /tmp/pip-build-tzjhtkga/django-appconf/
 !     Hello! Your requirements.txt file contains the six package.
 !     This library is automatically installed by Heroku and shouldn't be in
 !     Your requirements.txt file. This can cause unexpected behavior.
 !       -- Much Love, Heroku.
 !     Push rejected, failed to compile Python app.
 !     Push failed

我确实在 requirements/base.txt 文件中单独列出了“六”包,但我已经删除了它。我确实在日志中进一步确定了 django-appconf 似乎生成了另一个对“Six”包的请求。我也删除了这个,希望看看构建是否会通过,但没有,但我在 argon2 中的日志中发现了另一个“Six”包实例,如下所示:

Collecting six (from argon2-cffi==18.1.0->-r 
/tmp/build_f411039f49a317bf73319f22d11e792e/XXXXXXXXXX-
78bf146/requirements/base.txt (line 26))
Downloading six-1.11.0.tar.gz

我的简单网站目前没有使用任何形式的用户登录身份验证,但我仍然不愿意删除它。我知道这两个包都是标准的 django-cookiecutter 包,那么还有其他人有同样的问题吗?

我在 Django 1.11 和 python 3.6 上使用 windows。

谢谢阿拉斯代尔的回复。当我在阅读您的评论后收集要求时,我正在查看 "rcssmin==1.0.6 --install-option="--without-c-extensions"" 这行是否是潜在的罪魁祸首?

需求文件内容:

wheel==0.30.0
django==1.11.9 # pyup: <2.0
# django-environ==0.4.4 
whitenoise==3.3.1
django-crispy-forms==1.7.0
django-model-utils==3.1.1
Pillow==5.0.0
# argon2-cffi==18.1.0 
django-allauth==0.34.0
awesome-slugify==1.6.5
pytz==2017.3
django-redis==4.8.0
redis==2.10.6
celery==3.1.25
rcssmin==1.0.6 --install-option="--without-c-extensions"
django-compressor==2.2
cookiecutter==1.6.0
coverage==4.4.2
decorator==4.2.1
defusedxml==0.5.0
django-appconf==1.0.2
django-bootstrap-datepicker==1.2.3
django-bower==5.2.0
django-coverage-plugin==1.5.0
django-debug-toolbar==1.9.1
django-extensions==1.9.9
django-test-plus==1.0.22
docutils==0.14
factory-boy==2.9.2
Faker==0.8.10
future==0.16.0
icalendar==4.0.0
idna==2.6
imagesize==0.7.1
invoke==0.22.0
ipdb==0.10.3
ipython==6.2.1
ipython-genutils==0.2.0
jedi==0.11.1
Jinja2==2.10
jinja2-time==0.2.0
kombu==3.0.37
MarkupSafe==1.0
oauthlib==2.0.6
olefile==0.44
parso==0.1.1
pickleshare==0.7.4
pluggy==0.6.0
poyo==0.4.1
prompt-toolkit==1.0.15
psycopg2==2.7.3.2
py==1.5.2
pycparser==2.18
Pygments==2.2.0
pytest==3.3.2
pytest-django==3.1.2
pytest-sugar==0.9.0
python-dateutil==2.6.1
python3-openid==3.1.0
regex==2018.1.10
requests==2.18.4
requests-oauthlib==0.8.0
rjsmin==1.0.12
simplegeneric==0.8.1
snowballstemmer==1.2.1
Sphinx==1.6.6
sphinxcontrib-websupport==1.0.1
sqlparse==0.2.4
termcolor==1.1.0
text-unidecode==1.1
traitlets==4.3.2
typing==3.6.2
Unidecode==0.4.21
urllib3==1.22
wcwidth==0.1.7
Werkzeug==0.14.1
whichcraft==0.4.1
wincertstore==0.2

更新:从 rcssmin==1.0.6 中删除 "--install-option="--without-c-extensions"" 部分似乎已经清除了该特定错误,谢谢您的帮助(我现在正在处理另一个错误:(,希望对我来说没有那么具有挑战性)。

4

1 回答 1

0

在 Heroku 中安装要求时,您应该删除--install-option="--without-c-extensions".

请注意,在 Windows 中安装要求时确实需要该选项。

于 2018-02-21T11:04:16.813 回答