Skip to content

Instantly share code, notes, and snippets.

@LowerDeez
Last active September 16, 2019 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LowerDeez/6c4a28076b977fa02a781fabbafc856d to your computer and use it in GitHub Desktop.
Save LowerDeez/6c4a28076b977fa02a781fabbafc856d to your computer and use it in GitHub Desktop.
Pipenv
sudo apt-get install python3-pip
sudo pip3 install pipenv

If you have any problems with pip or pip3, edit /usr/bin/pip or /usr/bin/pip3 and change the import statement by changing

from pip import main

to

from pip._internal import main

like this:

#!/usr/bin/python3
# GENERATED BY DEBIAN

import sys

# Run the main entry point, similarly to how setuptools does it, but because
# we didn't install the actual entry point from setup.py, don't use the
# pkg_resources API.
from pip._internal import main
if __name__ == '__main__':
    sys.exit(main())

Once pip/pip3 is working, install pipenve using the --user option:

matt@sys:/usr/bin$ pip install --user pipenv
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pipenv
  Downloading https://files.pythonhosted.org/packages/bb/15/b155a5c0d19ce41609f50bb70a37e0de092b453ec4bd2eac59e53a2c3227/pipenv-2018.11.26-py2-none-any.whl (5.2MB)
    100% |████████████████████████████████| 5.2MB 3.2MB/s 
Requirement already satisfied: enum34; python_version < "3" in /usr/lib/python2.7/dist-packages (from pipenv) (1.1.6)
Collecting virtualenv (from pipenv)
  Downloading https://files.pythonhosted.org/packages/6a/d1/e0d142ce7b8a5c76adbfad01d853bca84c7c0240e35577498e20bc2ade7d/virtualenv-16.2.0-py2.py3-none-any.whl (1.9MB)
    100% |████████████████████████████████| 1.9MB 2.6MB/s 
Collecting typing; python_version < "3.5" (from pipenv)
  Downloading https://files.pythonhosted.org/packages/cc/3e/29f92b7aeda5b078c86d14f550bf85cff809042e3429ace7af6193c3bc9f/typing-3.6.6-py2-none-any.whl
Collecting certifi (from pipenv)
  Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
    100% |████████████████████████████████| 163kB 2.6MB/s 
Collecting virtualenv-clone>=0.2.5 (from pipenv)
  Downloading https://files.pythonhosted.org/packages/e3/d9/d9c56deb483c4d3289a00b12046e41428be64e8236fa210111a1f57cc42d/virtualenv_clone-0.5.1-py2.py3-none-any.whl
Requirement already satisfied: pip>=9.0.1 in /home/matt/.local/lib/python2.7/site-packages (from pipenv) (19.0.1)
Requirement already satisfied: setuptools>=36.2.1 in /usr/lib/python2.7/dist-packages (from pipenv) (39.0.1)
Installing collected packages: virtualenv, typing, certifi, virtualenv-clone, pipenv
  The script virtualenv is installed in '/home/matt/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The script virtualenv-clone is installed in '/home/matt/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The scripts pipenv and pipenv-resolver are installed in '/home/matt/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed certifi-2018.11.29 pipenv-2018.11.26 typing-3.6.6 virtualenv-16.2.0 virtualenv-clone-0.5.1

And then, modify .bashrc in your home directory in accordance with the suggested additions to your PATH:

export PATH="/home/matt/.local/bin:$PATH"

Install Pipenv:

sudo -H pip install -U pipenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment