$ docker-compose run --rm web pip install --upgrade pip Creating django_web_run ... done Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (21.1.3) Collecting pip Downloading pip-21.2.1-py3-none-any.whl (1.6 MB) |████████████████████████████████| 1.6 MB 39 kB/s Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 21.1.3 Uninstalling pip-21.1.3: Successfully uninstalled pip-21.1.3 Successfully installed pip-21.2.1 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
$ docker-compose run --rm web python -m pipenv install Creating django_web_run ... done Creating a virtualenv for this project... Pipfile: /code/Pipfile Using /usr/local/bin/python3.9 (3.9.5) to create virtualenv... ⠇ Creating virtual environment...created virtual environment CPython3.9.5.final.0-64 in 518ms creator CPython3Posix(dest=/root/.local/share/virtualenvs/code-_Py8Si6I, clear=False, no_vcs_ignore=False, global=False) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv) added seed packages: pip==21.1.3, setuptools==57.1.0, wheel==0.36.2 activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
✔ Successfully created virtual environment! Virtualenv location: /root/.local/share/virtualenvs/code-_Py8Si6I requirements.txt found, instead of Pipfile! Converting... ✔ Success! Warning: Your Pipfile now contains pinned versions, if your requirements.txt did. We recommend updating your Pipfile to specify the "*" version, instead. Pipfile.lock not found, creating... Locking [dev-packages] dependencies... Locking [packages] dependencies... Building requirements... Resolving dependencies... ✔ Success! Updated Pipfile.lock (1644d3)! Installing dependencies from Pipfile.lock (1644d3)... 🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 5/5 — 00:00:04 To activate this project's virtualenv, run pipenv shell. Alternatively, run a command inside the virtualenv with pipenv run.
実行が終わりました。PipfileとPipfile.lockも作成されています。
virtualenvについて
出力されたメッセージをみていて、気になる点がいくつかあります。
1 2
✔ Successfully created virtual environment! Virtualenv location: /root/.local/share/virtualenvs/code-_Py8Si6I
$ docker-compose run --rm web python -m pipenv --venv Creating django_web_run ... done No virtualenv has been created for this project(/code) yet! Aborted!
$ docker-compose run --rm web python -m pipenv uninstall --system --all Creating django_web_run ... done Creating a virtualenv for this project... Pipfile: /code/Pipfile Using /usr/local/bin/python3.9 (3.9.5) to create virtualenv... ⠇ Creating virtual environment...created virtual environment CPython3.9.5.final.0-64 in 521ms creator CPython3Posix(dest=/root/.local/share/virtualenvs/code-_Py8Si6I, clear=False, no_vcs_ignore=False, global=False) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv) added seed packages: pip==21.1.3, setuptools==57.1.0, wheel==0.36.2 activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
✔ Successfully created virtual environment! Virtualenv location: /root/.local/share/virtualenvs/code-_Py8Si6I Un-installing all [dev-packages] and [packages]... Found 0 installed package, skip purging. Environment now purged and fresh!
$ docker-compose run --rm web python -m pip uninstall django Creating django_web_run ... done Found existing installation: Django 3.2.4 Uninstalling Django-3.2.4: Would remove: /usr/local/bin/django-admin /usr/local/bin/django-admin.py /usr/local/lib/python3.9/site-packages/Django-3.2.4.dist-info/* /usr/local/lib/python3.9/site-packages/django/* Proceed (Y/n)? Y Successfully uninstalled Django-3.2.4 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv