やりたいこと/問題
python、django初心者になります。
PythonAnywhereにオリジナルブログをデプロイしたいと思っているのですが、途中で下記の様なエラーが発生いたしました。
・ModuleNotFoundError:Crispy Formsがインストールされていないと怒られる
・subprocess.CalledProcessError: non-zero exit status 1が返される
両エラーの回避方法につき、アドバイス頂けますと幸いです。
これまでに行ったこと
(1)ブログアプリの作成
・Corey Schafer氏のDjango Tutorialsをベースにアプリを作成
・アプリ内で、Django Crispy Formsを使用
・Vagrantを用いたローカル開発環境では動作することは確認済
(参考)Corey Schafer氏の再生リスト
https://www.youtube.com/playlist?list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p
(2)デプロイ準備
・Django Girlsのチュートリアルに従い、PythonAnywhereを利用
・PythonAnywhereにアカウントを作り、APIトークンを作成し、GitHubにコードをアップ
(参考)Django Girlsのチュートリアル
https://tutorial.djangogirls.org/ja/deploy/
躓いたところ
・Bashにてpa_autoconfigure_django.py --python=3.6 https://github.com/<github-username>/<github-repository name> --nukeを実行
・下記の様なエラーが発生
< Running API sanity checks >
~<:>>>>>>>>>
Cloning into '/home/wayway/wayway.pythonanywhere.com'...
remote: Enumerating objects: 55, done.
remote: Counting objects: 100% (55/55), done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 55 (delta 11), reused 55 (delta 11), pack-reused 0
Unpacking objects: 100% (55/55), done.
Checking connectivity... done.
< Creating virtualenv with Python3.6 >
~<:>>>>>>>>>
Removing wayway.pythonanywhere.com...
Running virtualenv with interpreter /usr/bin/python3.6
Already using interpreter /usr/bin/python3.6
Using base prefix '/usr'
New python executable in /home/wayway/.virtualenvs/wayway.pythonanywhere.com/bin/python3.6
Also creating executable in /home/wayway/.virtualenvs/wayway.pythonanywhere.com/bin/python
Installing setuptools, pip, wheel...
done.
virtualenvwrapper.user_scripts creating /home/wayway/.virtualenvs/wayway.pythonanywhere.com/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/wayway/.virtualenvs/wayway.pythonanywhere.com/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/wayway/.virtualenvs/wayway.pythonanywhere.com/bin/preactivate
virtualenvwrapper.user_scripts creating /home/wayway/.virtualenvs/wayway.pythonanywhere.com/bin/postactivate
virtualenvwrapper.user_scripts creating /home/wayway/.virtualenvs/wayway.pythonanywhere.com/bin/get_env_details
< Pip installing django (this may take a couple of minutes) >
<:>>>>>>>>>=3.2.10
Looking in links: /usr/share/pip-wheels
Collecting django
Using cached Django-3.1-py3-none-any.whl (7.8 MB)
Collecting sqlparse>=0.2.2
Using cached sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
Collecting pytz
Using cached pytz-2020.1-py2.py3-none-any.whl (510 kB)
Collecting asgiref
Using cached asgiref-3.2.10-py3-none-any.whl (19 kB)
Installing collected packages: sqlparse, pytz, asgiref, django
Successfully installed asgiref-3.2.10 django-3.1 pytz-2020.1 sqlparse-0.3.1
< Creating web app via API >
~<:>>>>>>>>>
< Adding static files mappings for /static/ and /media/ >
~<:>>>>>>>>>
< Updating wsgi file at /var/www/wayway_pythonanywhere_com_wsgi.py >
~<:>>>>>>>>>
< Updating settings.py >
~<:>>>>>>>>>
< Running collectstatic >
~<:>>>>>>>>>
Traceback (most recent call last):
File "/home/wayway/wayway.pythonanywhere.com/manage.py", line 21, in <module>
main()
File "/home/wayway/wayway.pythonanywhere.com/manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/home/wayway/.virtualenvs/wayway.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/home/wayway/.virtualenvs/wayway.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/init.py", line 377, in execute
django.setup()
File "/home/wayway/.virtualenvs/wayway.pythonanywhere.com/lib/python3.6/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/wayway/.virtualenvs/wayway.pythonanywhere.com/lib/python3.6/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/home/wayway/.virtualenvs/wayway.pythonanywhere.com/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/home/wayway/.virtualenvs/wayway.pythonanywhere.com/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crispy_forms'
Traceback (most recent call last):
File "/home/wayway/.local/bin/pa_autoconfigure_django.py", line 47, in <module>
main(arguments['<git-repo-url>'], arguments['--domain'], arguments['--python'], nuke=arguments.get('--nuke'))
File "/home/wayway/.local/bin/pa_autoconfigure_django.py", line 37, in main
project.run_collectstatic()
File "/home/wayway/.local/lib/python3.6/site-packages/pythonanywhere/django_project.py", line 87, in run_collectstatic
'--noinput',
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/wayway/.virtualenvs/wayway.pythonanywhere.com/bin/python', '/home/wayway/wayway.pythonanywhere.com/manage.py', 'collectstatic', '--noinput']' returned non-zero exit status 1.
###質問内容
・ModuleNotFoundError、subprocess.CalledProcessErrorは、どうすれば回避できるのでしょうか?
###実行環境
Django 3.0.8
Python 3.6.5
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。