Maneth Pathirana
Maneth Pathirana

Reputation: 41

How to use pipenv shell ? I'm getting an Error

I typed this on cmd

pipenv shell

but it says an error like this

Usage: pipenv shell [OPTIONS] [SHELL_ARGS]...

ERROR:: --system is intended to be used for pre-existing Pipfile installation, not installation of specific packages. Aborting.

Upvotes: 0

Views: 1604

Answers (1)

Dan Swain
Dan Swain

Reputation: 3108

Type: python3 -m pipenv shell

The -m option stands for module. The above tells Python to execute the pipenv module, and shell is a parameter to pipenv that tells it to switch to the virtual environment. To exit the venv and get back to the regular bash shell, just type exit.

As an aside, the above is distinct from doing Python command line operations on your Django project, e.g., after the virtual environment is activated by the above commands, you can then use the Django management command python3 manage.py shell to open a Python command line in order to work on your Django project. This Django management command opens the Python shell with all of your Django project settings, models, etc. available.

Upvotes: 2

Related Questions