The error "'pipenv' is not recognized as an internal or external command,
operable program or batch file" occurs when we forget to install
running the command.
To solve the error, install the
pipenv package by running the
pip install pipenv command.
Make sure you have pipenv
installed by running the following command in
pip install pipenv # 👇️ for Python 3 pip3 install pipenv # 👇️ if you don't have pip in your PATH environment variable python -m pip install pipenv # 👇️ using py alias py -m pip install pipenv # 👇️ for Python 3 python3 -m pip install pipenv # 👇️ if you get permissions error pip install pipenv --user
You should now be able to use the
pipenv command as follows.
pipenv --help pipenv --version python -m pipenv --help python -m pipenv --version py -m pipenv --help py -m pipenv --version
If the installation command doesn't succeed, try running CMD as an administrator.
To open CMD as an administrator:
Click on the Search bar and type CMD.
Right-click on the Command Prompt application and click "Run as administrator".
If you get the error
"'pip' is not recognized as an internal or external command",
python -m command when installing
# 👇️ first uninstall virtualenv and pipenv python -m pip uninstall virtualenv pipenv -y py -m pip uninstall virtualenv pipenv -y python3 -m pip uninstall virtualenv pipenv -y # 👇️ now install pipenv python -m pip install pipenv py -m pip install pipenv python3 -m pip install pipenv
You can also try to upgrade the package with the
python -m pip install pipenv --upgrade py -m pip install pipenv --upgrade python3 -m pip install pipenv --upgrade
If you see an error message that "ps1 cannot be loaded because running scripts is disabled on this system", run the following command, type "yes" when prompted and rerun the activation command.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
pipenvmodule is installed by using the
pip show pipenvcommand.
pip show pipenv pip3 show pipenv python -m pip show pipenv py -m pip show pipenv python3 -m pip show pipenv
pip show pipenv command will either state that the package is not
installed or show a bunch of information about the package, including the
location where the package is installed.
If the error persists, you have to add Python to your user's PATH environment variable.
To add Python to your user's PATH environment variable:
python -c "import os, sys; print(os.path.dirname(sys.executable))" where python
For me, the path is the following.
Note that I have Python 3.10 installed, which is reflected in the PATH.
Scriptsdirectory that is located in your Python3X folder. This is where the executable files are located.
For me, it is the following path.
You might also have to restart your PC, but that's not always necessary.
If you still encounter issues, try to add Python to your PATH using the official installer.
Download the installer from the official python.org website.
If you have Python already installed, start the installer and click on "Modify".
You can leave the optional features ticked.
If that didn't work, your Python installation might be corrupted.
Start the installer again and click on "Uninstall".
Now that you don't have Python installed on your machine, start the installer again and make sure to tick the "Add python.exe to PATH" option.
The checkbox won't be checked by default.
Once the "Add python.exe to PATH" checkbox is checked, click on "Install Now".
After the installation, Python will be installed and configured properly.
You can learn more about the related topics by checking out the following tutorials: