Не получается остановить виртуальную среду в Python (VS code)
Всем привет, недавно начала изучать виртуальные среды в питоне. Нужно создать новую папку .venv и там инсталлировать Django определенной версии. На мою команду в терминале:
PS C:\Users\marin\Python\courses> pipenv install django==4.0.8
получаю ответ:
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically
use that environment, instead of creating its own for any project.
You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment
and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing django==4.0.8...
Resolving django==4.0.8...
Installation Succeeded
Installing dependencies from Pipfile.lock (11356d)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Новая виртуальная среда не создается, путь новой виртуальной среды не создался.
Ищу местоположение виртуальной среды:
PS C:\Users\marin\Python\courses> pipenv --venv
получаю:
Courtesy Notice: Pipenv found itself running within a virtual environment,
so it will automatically use that environment,
instead of creating its own for any project.
You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment
and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
C:\Users\marin\.virtualenvs\Python-MrqR-F-V
и вот я нахожу путь к действующей виртуальной среде, но как бы я не пыталась ее остановить, ничего не получается, ни через exit ни через deactivate. Буду очень признательна за помощь.
Ответы (1 шт):
Открой командную строку
Создай папку проекта
mkdir new_project
Перейди в папку проекта
cd new_project
Создай виртуальное окружение
python -m venv venv
Перейди в папку Scripts
cd venv/Scripts
Активируй виртуальное окружение
activate
Итог: (venv) D:\new_project\venv\Scripts>
перейди в папку проекта
cd ..
cd ..
установи Django
pip install django
создай проект
django-admin startproject mysite