前提・実現したいこと
Django Girlsのチュートリアルで、デプロイの章をやっています。
Pythonanywhereにgithubからコードをプルする段階で仮想環境がつくれなくて困っています。
pythonは3.9です。
初心者です。
発生している問題・エラーメッセージ
< Creating virtualenv with Python3.6 > \ ~<:>>>>>>>>> /usr/local/bin/virtualenvwrapper.sh: line 230: : command not found virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON= and that PATH is set properly. ERROR: virtualenvwrapper could not find virtualenv in your path Traceback (most recent call last): File "/home/tk800000000/.local/bin/pa_autoconfigure_django.py", line 54, in <module> nuke=arguments.get('--nuke') File "/home/tk800000000/.local/bin/pa_autoconfigure_django.py", line 33, in main project.create_virtualenv(nuke=nuke) File "/home/tk800000000/.local/lib/python3.6/site-packages/pythonanywhere/django_project.py", line 45, in create_virtualenv self.virtualenv.create(nuke=nuke) File "/home/tk800000000/.local/lib/python3.6/site-packages/pythonanywhere/virtualenvs.py", line 22, in create subprocess.check_call(["bash", "-c", f"source virtualenvwrapper.sh && {command}"]) File "/usr/local/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['bash', '-c', 'source virtualenvwrapper.sh && mkvirtualenv --python=python3.6 tk800000000.pythonanywhere.com']' returned non-zero exit status 1. 15:54 ~ $
該当のソースコード
15:52 ~ $ pa_autoconfigure_django.py --python=3.6 https://github.com/tk800000000/my_first_blog.git < Running API sanity checks > \ ~<:>>>>>>>>> Cloning into '/home/tk800000000/tk800000000.pythonanywhere.com'... remote: Enumerating objects: 17, done. remote: Counting objects: 100% (17/17), done. remote: Compressing objects: 100% (16/16), done. remote: Total 17 (delta 0), reused 17 (delta 0), pack-reused 0 Unpacking objects: 100% (17/17), 4.07 KiB | 11.00 KiB/s, done. < Creating virtualenv with Python3.6 > \ ~<:>>>>>>>>> /usr/local/bin/virtualenvwrapper.sh: line 230: : command not found virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON= and that PATH is set properly. ERROR: virtualenvwrapper could not find virtualenv in your path Traceback (most recent call last): File "/home/tk800000000/.local/bin/pa_autoconfigure_django.py", line 54, in <module> nuke=arguments.get('--nuke') File "/home/tk800000000/.local/bin/pa_autoconfigure_django.py", line 33, in main project.create_virtualenv(nuke=nuke) File "/home/tk800000000/.local/lib/python3.6/site-packages/pythonanywhere/django_project.py", line 45, in create_virtualenv self.virtualenv.create(nuke=nuke) File "/home/tk800000000/.local/lib/python3.6/site-packages/pythonanywhere/virtualenvs.py", line 22, in create subprocess.check_call(["bash", "-c", f"source virtualenvwrapper.sh && {command}"]) File "/usr/local/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['bash', '-c', 'source virtualenvwrapper.sh && mkvirtualenv --python=python3.6 tk800000000.pythonanywhere.com']' returned non-zero exit status 1.
試したこと
virtualenvというのが入ってないと思ったので
pip3.6 install virtualenv
と入力したところ
15:52 ~ $ pip3.6 install virtualenv Defaulting to user installation because normal site-packages is not writeable Looking in links: /usr/share/pip-wheels Requirement already satisfied: virtualenv in /usr/local/lib/python3.6/site-packages (20.4.7) Requirement already satisfied: filelock<4,>=3.0.0 in /usr/local/lib/python3.6/site-packages (from virtualenv) (3.0.12) Requirement already satisfied: distlib<1,>=0.3.1 in /usr/local/lib/python3.6/site-packages (from virtualenv) (0.3.1) Requirement already satisfied: six<2,>=1.9.0 in /usr/local/lib/python3.6/site-packages (from virtualenv) (1.15.0) Requirement already satisfied: importlib-metadata>=0.12 in /usr/local/lib/python3.6/site-packages (from virtualenv) (3.10.1) Requirement already satisfied: appdirs<2,>=1.4.3 in /usr/local/lib/python3.6/site-packages (from virtualenv) (1.4.4) Requirement already satisfied: importlib-resources>=1.0 in /usr/local/lib/python3.6/site-packages (from virtualenv) (5.1.4) Requirement already satisfied: typing-extensions>=3.6.4 in /usr/local/lib/python3.6/site-packages (from importlib-metadata>=0.12->virtualenv) (3.7.4) Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.6/site-packages (from importlib-metadata>=0.12->virtualenv) (3.4.1)
これでいいかなと思い、また問題の
pa_autoconfigure_django.py --python=3.6 https://github.com/tk800000000/my_first_blog.git
を実行しても特に変わりませんでした。
回答1件
あなたの回答
tips
プレビュー