Skip to content

Instantly share code, notes, and snippets.

@bradtraversy
Last active April 1, 2024 03:09
Show Gist options
  • Save bradtraversy/c70a93d6536ed63786c434707b898d55 to your computer and use it in GitHub Desktop.
Save bradtraversy/c70a93d6536ed63786c434707b898d55 to your computer and use it in GitHub Desktop.
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell

Check version of Python

python --version

Check path

python
>>> import sys
>>> sys.executable
quit()

Install a package

pipenv install camelcase

Check local packages

pipenv lock -r

Uninstall a package

pipenv uninstall camelcase

Install a dev package

pipenv install nose --dev

Install from requirements.txt

pipenv install -r ./requirements.txt

Check security vulnerabilities

pipenv check

Check dependency graph

pipenv graph

Ignore pipfile

pipenv install --ignore-pipfile

Set lockfile - before deployment

pipenv lock

Exiting the virtualenv

exit

Run with pipenv

pipenv run *
@IdanBanani
Copy link

IdanBanani commented May 24, 2020

Hey Brad, Is it possible/ a good idea to make VScode/ Pycharm automatically create and activate for you a pipenv virtual environment?
it's not so easy to do it with vscode [I guess editing settings.json isn't enough, and launch.json needs to be edited also]
any idea why I keep getting the virtual environment created in the same folder like a singleton and can't see any pipfile.lock file? even tough modules are being added to it? (to the same one)

@dev-code0101
Copy link

dev-code0101 commented Jan 31, 2023

pipenv shell
creates one if none is present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment