我试图将我更新的django应用程序上传到heroku - 它在我的本地系统中运行,但是当我推送我的更改时,它告诉我它找不到特定的模块(phonenumber_field)。 / p>
仅当库和包名称不同时才会出现这种情况。例如,当我安装phonenumber_field时,我使用命令pip install django-phonenumber-field
,而在设置文件中,它是phonenumber_field
。
我已经运行了pip freeze > requirements.txt
,相关模块是django-phonenumber-field==2.0.0
。我不知道我哪里出错了,想知道是否有人可以为我揭开光明。
我不认为这是以下链接中的错误情况,因为我在使用CDN进行引导时使用了引导程序3的相同问题(引导程序中的bootstrap3,但是django-bootstrap3 == 9.1 .0 in requirements.tx)。 https://devcenter.heroku.com/articles/python-c-deps
错误消息
remote: -----> Python app detected
remote: -----> Found python-3.6.3, removing
remote: -----> Installing python-3.6.4
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 11.8.2…
remote: Installing dependencies from Pipfile.lock (af8c37)…
remote: -----> $ python manage.py collectstatic --noinput
remote: Traceback (most recent call last):
remote: File "manage.py", line 15, in <module>
remote: execute_from_command_line(sys.argv)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
remote: utility.execute()
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 347, in execute
remote: django.setup()
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
remote: apps.populate(settings.INSTALLED_APPS)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
remote: app_config = AppConfig.create(entry)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
remote: module = import_module(entry)
remote: File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
remote: return _bootstrap._gcd_import(name[level:], package, level)
remote: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
remote: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
remote: File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
remote: ModuleNotFoundError: No module named 'phonenumber_field'
REQUIREMENTS.TXT
asn1crypto==0.24.0
Babel==2.5.3
certifi==2018.1.18
cffi==1.11.4
chardet==3.0.4
cryptography==2.1.4
dj-database-url==0.4.2
Django==2.0.2
django-bootstrap3==9.1.0
django-phonenumber-field==2.0.0
gunicorn==19.7.1
idna==2.6
nexmo==2.0.0
phonenumberslite==8.9.0
pycparser==2.18
PyJWT==1.5.3
pytz==2018.3
requests==2.18.4
six==1.11.0
urllib3==1.22
whitenoise==3.3.1