Configure a pipenv environment
Pipenv is a tool that provides all necessary means to create a virtual environment for your Python project. It automatically manages project packages through the Pipfile file as you install or uninstall packages.
Pipenv also generates the Pipfile.lock file, which is used to produce deterministic builds and create a snapshot of your working environment. This might be particularly helpful for security sensitive deployment, when project requirements and packages versions are critical. For more information about pipenv, refer to the project documentation at pipenv.pypa.io.
To use pipenv with PyCharm, you need to implement several preparation steps.
Install pipenv
- Run the following command to ensure you have pip installed in your system: $ pip —version You should expect to receive a system response indicating the pip version. If no pip is discovered, install it as described in the Installation Instructions. Alternatively, you can download and install Python from http://python.org.
- Install pipenv by running the following command: $ pip install —user pipenv When installation completes, you will see the following message:
- For your convenience, you might add the user base’s binary directory to your PATH environmental variable. If you skip this procedure, PyCharm will prompt you to specify the path to the pipenv executable when adding a pipenv environment.
- Run the following command: $ py -m site —user-site A sample output can be: C:\Users\jetbrains\AppData\Roaming\Python\Python37\site-packages
- Replace site-packages with Scripts in this path to receive a string for adding to the PATH variable, for example: $ setx PATH «%PATH%;C:\Users\jetbrains\AppData\Roaming\Python\Python37\Scripts» Running the above command in PowerShell will overwrite the user PATH variable. To avoid that, use $ setx PATH «$env:PATH;C:\Users\jetbrains\AppData\Roaming\Python\Python37\Scripts» instead. However, you should keep in mind that this command has a side effect of duplicating the content of the system PATH variable in the user PATH variable. For more information about managing environment variables in PowerShell, refer to the PowerShell documentation.
- Run the following command to find the user base’s binary directory: $ python -m site —user-base An example of output can be /Users/jetbrains/.local (macOS) or /home/jetbrains/.local (Linux)
- Add bin to this path to receive a string for adding to the ~/.bashrc file, for example: $ export PATH=»$PATH:/Users/jetbrains/.local/bin»
- Run the following command to make the changes effective: $ source ~/.bashrc
- Ensure you have enabled bashrc in your bash_profile .
At any time you can alter the specified path to the pipenv executable in the project settings. In the Settings dialog ( Control+Alt+S ), navigate to Tools | Python Integrated Tools , and type the target path in the Path to Pipenv executable field.
After the preparation steps are done, you can use pipenv to create a virtual environment for new or existing projects.
You can also set up pipenv for any of your earlier created projects.
Configure pipenv for an existing Python project

- Do one of the following:
- Click the Python Interpreter selector and choose Add New Interpreter .
- Press Control+Alt+S to open Settings and go to Project: | Python Interpreter . Click the Add Interpreter link next to the list of the available interpreters.
- Click the Python Interpreter selector and choose Interpreter Settings . Click the Add Interpreter link next to the list of the available interpreters.
- Select Add Local Interpreter .
- In the left-hand pane of the Add Python Interpreter dialog, select Pipenv Environment .
- Choose the base interpreter from the list, or click and find the desired Python executable in your file system.
- If your project contains Pipfile , you can choose whether you want to install the packages listed in it by enabling or disabling the Install packages from Pipfile checkbox. By default, the checkbox is enabled.
- If you have added the base binary directory to your PATH environmental variable, you don’t need to set any additional options: the path to the pipenv executable will be autodetected. If the pipenv executable is not found, follow the pipenv installation procedure to discover the executable path, and then paste it in the Pipenv executable field.
- Click OK to complete the task.
When you have set the pipenv virtual environment as a Python interpreter, all available packages are added from the source defined in Pipfile . The packages are installed, removed, and updated in the list of the packages through pipenv rather than through pip.
PyCharm can create a pipenv environment for your project based on the project requirements recorded in Pipfile.
Create an environment using the Pipfile

- When you open a project that contains Pipfile , but no project interpreter is configured, PyCharm suggests that you create a pipenv environment.
- Click Create a pipenv environment using Pipfile if you want PyCharm to configure pipenv for you automatically. Alternatively, you can click Configure Python interpreter to follow the standard workflow.
- If PyCharm cannot autodetect the pipenv executable, specify the path to it and click OK .
A new pipenv environment will be configured for your project and the packages listed in Pipfile will be installed.
PyCharm supports environment variables, for example, PIPENV_VENV_IN_PROJECT . You can add PIPENV_VENV_IN_PROJECT=true to your ~/.profile , or ~/.bash_profile or ~/.bashrc and re-login to your OS in order for all the GUI processes to inherit new environment variables from your shell config.
For any of the configured Python interpreters (but Docker-based), you can:
- Manage interpreter paths
- Install, uninstall, and upgrade packages
pip не является внешней или внутренней командой / не распознано как имя командлета, функции, файла сценария или выполняемой программы
Когда я пытаюсь установить модуль, выдает: «pip не является внешней или внутренней командой, исполняемой программой или пакетным файлом. Я прокладывал полный путь. Установщик пакетов, вроде, не нужно устанавливать отдельно. Windows 7.
Отслеживать
13.7k 12 12 золотых знаков 43 43 серебряных знака 75 75 бронзовых знаков
задан 6 фев 2017 в 19:14
Даниил Василевский Даниил Василевский
141 1 1 золотой знак 1 1 серебряный знак 4 4 бронзовых знака
Да просто инсталлятор не прописал путь в PATH
6 фев 2017 в 19:43
5 ответов 5
Сортировка: Сброс на вариант по умолчанию
Вам нужно установить путь к pip в переменные окружения, это можно сделать при установке python выбрав пункт Add Python to PATH.
Если вы уже установили, но забыли выбрать этот пункт, можно добавить путь вручную:
Панель управления -> Система -> Дополнительные параметры системы -> Переменные среды
Вы увидите 2 окошка, Переменные среды пользователя для и Системные переменные , вам нужно первое, нажимаем на переменную Path -> Изменить , далее вы увидите поле Значение переменной , в конец поставьте разделитель ; и добавьте путь к директории где находится pip (например, C:\Python\Scripts , путь к директории Python может отличаться).
Отслеживать
47.8k 17 17 золотых знаков 56 56 серебряных знаков 100 100 бронзовых знаков
ответ дан 13 мая 2018 в 7:31
Pavel Durmanov Pavel Durmanov
5,728 3 3 золотых знака 21 21 серебряный знак 44 44 бронзовых знака
При установке Python вам необходимо установить pip и, возможно, отметить Add Python to PATH.
Отслеживать
ответ дан 7 фев 2017 в 13:51
user234958 user234958
python3 -m pip -V
Если вернёт версию, то устанавливать можно так
python3 -m pip install pip
Рекомендую использовать совместно с Virtual Environment
Отслеживать
ответ дан 21 янв 2020 в 15:08
4,962 1 1 золотой знак 8 8 серебряных знаков 27 27 бронзовых знаков
Это сообщение означает, что система не может найти файл pip, который вы пытаетесь запустить. Возможно, у вас не установлен Python или переменная среды PATH не содержит директорию, в которой находится установленный Python.
Чтобы установить Python, перейдите на сайт https://www.python.org/ и скачайте и установите самую последнюю версию. Убедитесь, что установка добавит Python в переменную среды PATH.
После установки Python вы должны быть в состоянии запускать pip, чтобы устанавливать модули. Например, чтобы установить модуль requests, выполните следующую команду:
pip install requests
Если у вас возникают проблемы с установкой модулей с помощью pip, попробуйте выполнить команду pip install -U pip, чтобы обновить версию pip до самой последней.
how to add pip to PATH
I installed Python using the «Windows x86-64 executable installer» from https://www.python.org/downloads/release/python-383/ . That, however, did not modify the Windows Path variable so I decided to modify it myself. The python executable lives here: C:\Users\neubert\AppData\Local\Programs\Python\Python38\ But there is no pip executable in that directory. It’s my understanding that «Windows x86-64 executable installer» was supposed to include pip. So where is it? Here’s the directory listing of this directory:
Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 6/10/2020 7:54 AM DLLs d----- 6/10/2020 7:53 AM Doc d----- 6/10/2020 7:53 AM include d----- 6/10/2020 7:53 AM Lib d----- 6/10/2020 7:53 AM libs d----- 6/10/2020 7:54 AM Scripts d----- 6/10/2020 7:54 AM tcl d----- 6/10/2020 7:53 AM Tools -a---- 5/13/2020 10:43 PM 31453 LICENSE.txt -a---- 5/13/2020 10:43 PM 905782 NEWS.txt -a---- 5/13/2020 10:42 PM 100424 python.exe -a---- 5/13/2020 10:42 PM 58952 python3.dll -a---- 5/13/2020 10:42 PM 4208200 python38.dll -a---- 5/13/2020 10:42 PM 98888 pythonw.exe -a---- 5/13/2020 10:43 PM 100880 vcruntime140.dll -a---- 5/13/2020 10:43 PM 44320 vcruntime140_1.dll
asked Jun 10, 2020 at 13:16
6,983 35 35 gold badges 78 78 silver badges 142 142 bronze badges
It does not mention pip on the page you linked.
Jun 10, 2020 at 13:24
@DavidPostill — the installer mentions it: i.stack.imgur.com/94Qqv.png
Jun 10, 2020 at 13:28
OK. Then I don’t know.
Jun 10, 2020 at 13:29
2 Answers 2
Assuming you chose the option to install pip via the installer, pip.exe should be located under the Scripts directory:

So you should be able to add ex.:
C:\Users\neubert\AppData\Local\Programs\Python\Python38\Scripts
to your environment variables if you want to allow access to the executables in Scripts globally via the command line.
However, while adding the Scripts directory to your Windows environment is useful (and I would recommend you do this for potential access to other exectuables created by Python), I would recommend NOT accessing pip like this.
Instead, you should use python -m pip in place of just pip . In short, this can help avoid possible headaches with «missing» modules when more than one copy of Python is installed on Windows (ex. if you need to use a copy of Python in a Python virtual environment for an isolated project).
How to add virtualenv to path
I am trying to find out why my virtualenv and/or virtualenv wrapper — installed using pip using homebrew — cannot be found. I think it’s because it’s not added to my PATH:
$ which virtualenv $
$ virtualenv someDir $ -bash: virtualenv: command not found
I installed pip using homebrew , and virtualenv using pip , without problems. I tried reinstalling virtualenv , but that did not work either. How do I know what path to add to PATH ? Just the path that virtualenv.py seems to be installed into? That seems to be:
/usr/local/lib/python2.7/site-packages/virtualenv.py
I also found this guide, which suggests this:
$ ln -s ../Cellar/python/2.7/Frameworks/Python.framework/Versions/2.7/bin/virtualenv virtualenv
