Skip to content

Instantly share code, notes, and snippets.

@planetceres
Created February 3, 2019 21:31
Show Gist options
  • Save planetceres/8adb62494717c71e93c96d8adad26f5c to your computer and use it in GitHub Desktop.
Save planetceres/8adb62494717c71e93c96d8adad26f5c to your computer and use it in GitHub Desktop.
pipenv installation notes Ubuntu 18.04

Installation Notes for pipenv on Ubuntu 18.04

1. Add ~/.local/bin to PATH

pypa/pipenv#2122 (comment)

echo 'export PATH="${HOME}/.local/bin:$PATH"' >> ~/.bashrc

2. Install pip if not already installed

Python3

sudo apt install python3-pip

Python 2

sudo apt install python-pip

3. Install pipenv

for Python3:

python3 -m pip install --user pipenv

or for python2:

python -m pip install --user pipenv

Troubleshooting and removal

Installing pipenv will break pip, and attempting to use pip after a pipenv install will likely result in:

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
ImportError: cannot import name main

If installation fails and pip cannot be restored. Completely remove pip and reinstall:

Python 3

sudo apt remove python3-pip
sudo rm -rf ~/.local/lib/python3.6/site-packages/pip*
sudo apt install python3-pip

Python 2


sudo apt remove python-pip
sudo rm -rf ~/.local/lib/python2.7/site-packages/pip*
sudo apt install python-pip

@vjpr
Copy link

vjpr commented Mar 1, 2020

Quick note: You need to source ~/.bashrc after step 1.

@Jayant19967
Copy link

Uploading Screenshot_2024-02-21-15-53-55-497_com.dream11.fantasy.cricket.football.kabaddi.jpg…

@Jayant19967
Copy link

Need to first rank

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