Skip to content

Instantly share code, notes, and snippets.

@tuanngominh
Last active April 19, 2019 05:05
Show Gist options
  • Save tuanngominh/dec31df94eaf3d4aebe36451364ce3b0 to your computer and use it in GitHub Desktop.
Save tuanngominh/dec31df94eaf3d4aebe36451364ce3b0 to your computer and use it in GitHub Desktop.
pipenv
# DEBUG --------------------
# remove all packages from virtualenv but keep the Pipfile unchanged
pipenv uninstall --all
# show the dependency from installed package in virtual env, not the package in Pipefile or Pipefile.lock
pipenv graph
# using iterm session log to store log to file
pipenv lock --verbose
# Pipfile.lock -------------------------
# https://github.com/pypa/pipenv/issues/1649
# pipenv install using Pipfile.lock when hashed of Pipfile match with Pipfile.lock's hash info
# OTHERS ---------------------
# Detect virtual environment location
pipenv shell
pipenv install factory_boy
# Generate requirements.txt
pipenv lock -r > requirements.txt
# Uninstalls all packages not specified in Pipfile.lock.
pipenv clean
# run specific test
pipenv run ./manage.py test module_name.tests.file_name
pipenv run ./manage.py test projects.tests.test_permission
# Pipenv -----------------
# Debug old pipenv issue.
# Pipenv should be managed by homebrew which provide latest version
brew install pipenv
brew upgrade pipenv
# Tuan use a old version of pipenv from python install
pip install pipenv
# that pipenv old version has issue with pip 18.1
# https://github.com/pypa/pipenv/issues/2924
# pip 18.1 causes "TypeError: 'module' object is not callable" #2924
# so Tuan switch to pip==18.0
pipenv run pip install pip==18.0
# Solution, remove pip in python
pip uninstall pipenv
# then system will use pipenv from homebrew
# the latest pipenv '2018.11.26' work with pip 18.1
# view installed path
which pipenv
# view version
pipenv --version
# view path, version .. of brew package
brew info pipenv
# view PATH
echo $PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment