question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pip3 breaks after pipenv install

See original GitHub issue

I have an issue where after a local install of pipenv, whenever I try to use the pip3 command it throws errors.

I’m not sure if this is an issue with pipenv itself, the Ubuntu distribution’s pip3 package, pip itself, or something I’m doing wrong, but it does seem to occur immediately after the pipenv isntall

I’m testing using Vagrant, and have tried to simplify the steps to reproduce (from a vanilla VM below)

Expected result

The system pip3 command to work after a local/user install of pipenv. e.g.

vagrant@ubuntu-artful:~$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
Actual result

The system pip3 throws errors such as:

vagrant@ubuntu-artful:~$ pip3 --version
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'
Steps to replicate
# On vanilla Ubuntu 17.10 Vagrant VM -> Update package lists and install Pip3
sudo apt-get update && sudo apt-get install --assume-yes python3-pip

# Log Pip3 info
pip3 --version  # outputs: pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
which pip3  # outputs: /usr/bin/pip3

# Install pipenv as user
pip3 install --user pipenv 

# Log Pip3 info
pip3 --version  # throws traceback above
which pip3  # outputs: /usr/bin/pip3
Full logs of steps to replicate:
sudo apt-get update && sudo apt-get install --assume-yes python3-pip
vagrant@ubuntu-artful:~$ # Update OS and install Pip3
vagrant@ubuntu-artful:~$ sudo apt-get update && sudo apt-get install --assume-yes python3-pip
Get:1 http://security.ubuntu.com/ubuntu artful-security InRelease [83.2 kB]
Get:2 http://security.ubuntu.com/ubuntu artful-security/main Sources [50.3 kB]
Get:3 http://security.ubuntu.com/ubuntu artful-security/multiverse Sources [1168 B]
Get:4 http://security.ubuntu.com/ubuntu artful-security/restricted Sources [960 B]
Get:5 http://security.ubuntu.com/ubuntu artful-security/universe Sources [16.9 kB]
Get:6 http://security.ubuntu.com/ubuntu artful-security/main amd64 Packages [156 kB]
Get:7 http://security.ubuntu.com/ubuntu artful-security/main Translation-en [67.8 kB]
Get:8 http://security.ubuntu.com/ubuntu artful-security/universe amd64 Packages [61.0 kB]
Get:9 http://security.ubuntu.com/ubuntu artful-security/universe Translation-en [36.1 kB]
Get:10 http://security.ubuntu.com/ubuntu artful-security/multiverse amd64 Packages [1824 B]
Get:11 http://security.ubuntu.com/ubuntu artful-security/multiverse Translation-en [1124 B]
Hit:12 http://archive.ubuntu.com/ubuntu artful InRelease
Get:13 http://archive.ubuntu.com/ubuntu artful-updates InRelease [88.7 kB]
Get:14 http://archive.ubuntu.com/ubuntu artful-backports InRelease [74.6 kB]
Get:15 http://archive.ubuntu.com/ubuntu artful/universe Sources [8721 kB]
Get:16 http://archive.ubuntu.com/ubuntu artful/multiverse Sources [182 kB]
Get:17 http://archive.ubuntu.com/ubuntu artful/restricted Sources [5392 B]
Get:18 http://archive.ubuntu.com/ubuntu artful/main Sources [849 kB]
Get:19 http://archive.ubuntu.com/ubuntu artful/universe amd64 Packages [8103 kB]
Get:20 http://archive.ubuntu.com/ubuntu artful/universe Translation-en [4789 kB]
Get:21 http://archive.ubuntu.com/ubuntu artful/multiverse amd64 Packages [150 kB]
Get:22 http://archive.ubuntu.com/ubuntu artful/multiverse Translation-en [108 kB]
Get:23 http://archive.ubuntu.com/ubuntu artful-updates/multiverse Sources [2892 B]
Get:24 http://archive.ubuntu.com/ubuntu artful-updates/main Sources [99.3 kB]
Get:25 http://archive.ubuntu.com/ubuntu artful-updates/universe Sources [35.1 kB]
Get:26 http://archive.ubuntu.com/ubuntu artful-updates/restricted Sources [960 B]
Get:27 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 Packages [251 kB]
Get:28 http://archive.ubuntu.com/ubuntu artful-updates/main Translation-en [111 kB]
Get:29 http://archive.ubuntu.com/ubuntu artful-updates/universe amd64 Packages [109 kB]
Get:30 http://archive.ubuntu.com/ubuntu artful-updates/universe Translation-en [60.9 kB]
Get:31 http://archive.ubuntu.com/ubuntu artful-updates/multiverse amd64 Packages [4128 B]
Get:32 http://archive.ubuntu.com/ubuntu artful-updates/multiverse Translation-en [2264 B]
Get:33 http://archive.ubuntu.com/ubuntu artful-backports/main Sources [1192 B]
Get:34 http://archive.ubuntu.com/ubuntu artful-backports/universe Sources [2480 B]
Get:35 http://archive.ubuntu.com/ubuntu artful-backports/main amd64 Packages [1516 B]
Get:36 http://archive.ubuntu.com/ubuntu artful-backports/main Translation-en [668 B]
Get:37 http://archive.ubuntu.com/ubuntu artful-backports/universe amd64 Packages [4076 B]
Get:38 http://archive.ubuntu.com/ubuntu artful-backports/universe Translation-en [2116 B]
Fetched 24.2 MB in 8s (3013 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-7 dpkg-dev fakeroot g++ g++-7 gcc gcc-7
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils libc-dev-bin
  libc6-dev libcc1-0 libcilkrts5 libdpkg-perl libexpat1-dev libfakeroot libfile-fcntllock-perl libgcc-7-dev libgomp1
  libisl15 libitm1 liblsan0 libmpc3 libmpx2 libpython3-dev libpython3.6-dev libquadmath0 libstdc++-7-dev libtsan0
  libubsan0 linux-libc-dev make manpages-dev python-pip-whl python3-crypto python3-dev python3-keyring
  python3-keyrings.alt python3-secretstorage python3-setuptools python3-wheel python3-xdg python3.6-dev
Suggested packages:
  binutils-doc cpp-doc gcc-7-locales debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg gcc-multilib
  autoconf automake libtool flex bison gdb gcc-doc gcc-7-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg
  libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg glibc-doc
  libstdc++-7-doc make-doc python3-crypto-dbg python-crypto-doc gnome-keyring libkf5wallet-bin gir1.2-gnomekeyring-1.0
  python-secretstorage-doc python-setuptools-doc
The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-7 dpkg-dev fakeroot g++ g++-7 gcc gcc-7
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils libc-dev-bin
  libc6-dev libcc1-0 libcilkrts5 libdpkg-perl libexpat1-dev libfakeroot libfile-fcntllock-perl libgcc-7-dev libgomp1
  libisl15 libitm1 liblsan0 libmpc3 libmpx2 libpython3-dev libpython3.6-dev libquadmath0 libstdc++-7-dev libtsan0
  libubsan0 linux-libc-dev make manpages-dev python-pip-whl python3-crypto python3-dev python3-keyring
  python3-keyrings.alt python3-pip python3-secretstorage python3-setuptools python3-wheel python3-xdg python3.6-dev
0 upgraded, 53 newly installed, 0 to remove and 29 not upgraded.
Need to get 42.0 MB of archives.
After this operation, 181 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu artful/main amd64 binutils-common amd64 2.29.1-4ubuntu1 [190 kB]
Get:2 http://archive.ubuntu.com/ubuntu artful/main amd64 libbinutils amd64 2.29.1-4ubuntu1 [502 kB]
Get:3 http://archive.ubuntu.com/ubuntu artful/main amd64 binutils-x86-64-linux-gnu amd64 2.29.1-4ubuntu1 [1824 kB]
Get:4 http://archive.ubuntu.com/ubuntu artful/main amd64 binutils amd64 2.29.1-4ubuntu1 [3342 B]
Get:5 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libc-dev-bin amd64 2.26-0ubuntu2.1 [69.5 kB]
Get:6 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 linux-libc-dev amd64 4.13.0-39.44 [960 kB]
Get:7 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libc6-dev amd64 2.26-0ubuntu2.1 [2526 kB]
Get:8 http://archive.ubuntu.com/ubuntu artful/main amd64 libisl15 amd64 0.18-1 [545 kB]
Get:9 http://archive.ubuntu.com/ubuntu artful/main amd64 libmpc3 amd64 1.0.3-2 [39.5 kB]
Get:10 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 cpp-7 amd64 7.2.0-8ubuntu3.2 [6732 kB]
Get:11 http://archive.ubuntu.com/ubuntu artful/main amd64 cpp amd64 4:7.2.0-1ubuntu1 [27.6 kB]
Get:12 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libcc1-0 amd64 7.2.0-8ubuntu3.2 [38.7 kB]
Get:13 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libgomp1 amd64 7.2.0-8ubuntu3.2 [76.4 kB]
Get:14 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libitm1 amd64 7.2.0-8ubuntu3.2 [27.6 kB]
Get:15 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libatomic1 amd64 7.2.0-8ubuntu3.2 [8950 B]
Get:16 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libasan4 amd64 7.2.0-8ubuntu3.2 [360 kB]
Get:17 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 liblsan0 amd64 7.2.0-8ubuntu3.2 [133 kB]
Get:18 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libtsan0 amd64 7.2.0-8ubuntu3.2 [282 kB]
Get:19 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libubsan0 amd64 7.2.0-8ubuntu3.2 [126 kB]
Get:20 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libcilkrts5 amd64 7.2.0-8ubuntu3.2 [42.6 kB]
Get:21 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libmpx2 amd64 7.2.0-8ubuntu3.2 [11.7 kB]
Get:22 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libquadmath0 amd64 7.2.0-8ubuntu3.2 [133 kB]
Get:23 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libgcc-7-dev amd64 7.2.0-8ubuntu3.2 [2368 kB]
Get:24 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 gcc-7 amd64 7.2.0-8ubuntu3.2 [7418 kB]
Get:25 http://archive.ubuntu.com/ubuntu artful/main amd64 gcc amd64 4:7.2.0-1ubuntu1 [5124 B]
Get:26 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 libstdc++-7-dev amd64 7.2.0-8ubuntu3.2 [1456 kB]
Get:27 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 g++-7 amd64 7.2.0-8ubuntu3.2 [7555 kB]
Get:28 http://archive.ubuntu.com/ubuntu artful/main amd64 g++ amd64 4:7.2.0-1ubuntu1 [1482 B]
Get:29 http://archive.ubuntu.com/ubuntu artful/main amd64 make amd64 4.1-9.1 [154 kB]
Get:30 http://archive.ubuntu.com/ubuntu artful/main amd64 libdpkg-perl all 1.18.24ubuntu1 [209 kB]
Get:31 http://archive.ubuntu.com/ubuntu artful/main amd64 dpkg-dev all 1.18.24ubuntu1 [608 kB]
Get:32 http://archive.ubuntu.com/ubuntu artful/main amd64 build-essential amd64 12.4ubuntu1 [4758 B]
Get:33 http://archive.ubuntu.com/ubuntu artful/main amd64 libfakeroot amd64 1.21-1ubuntu2 [25.9 kB]
Get:34 http://archive.ubuntu.com/ubuntu artful/main amd64 fakeroot amd64 1.21-1ubuntu2 [62.2 kB]
Get:35 http://archive.ubuntu.com/ubuntu artful/main amd64 libalgorithm-diff-perl all 1.19.03-1 [47.6 kB]
Get:36 http://archive.ubuntu.com/ubuntu artful/main amd64 libalgorithm-diff-xs-perl amd64 0.04-4build3 [11.2 kB]
Get:37 http://archive.ubuntu.com/ubuntu artful/main amd64 libalgorithm-merge-perl all 0.08-3 [12.0 kB]
Get:38 http://archive.ubuntu.com/ubuntu artful/main amd64 libexpat1-dev amd64 2.2.3-1 [120 kB]
Get:39 http://archive.ubuntu.com/ubuntu artful/main amd64 libfile-fcntllock-perl amd64 0.22-3build2 [33.2 kB]
Get:40 http://archive.ubuntu.com/ubuntu artful/main amd64 libpython3.6-dev amd64 3.6.3-1ubuntu1 [2483 kB]
Get:41 http://archive.ubuntu.com/ubuntu artful/main amd64 libpython3-dev amd64 3.6.3-0ubuntu2 [6914 B]
Get:42 http://archive.ubuntu.com/ubuntu artful/main amd64 manpages-dev all 4.13-3 [2202 kB]
Get:43 http://archive.ubuntu.com/ubuntu artful/universe amd64 python-pip-whl all 9.0.1-2 [1379 kB]
Get:44 http://archive.ubuntu.com/ubuntu artful-updates/main amd64 python3-crypto amd64 2.6.1-7ubuntu0.1 [244 kB]
Get:45 http://archive.ubuntu.com/ubuntu artful/main amd64 python3.6-dev amd64 3.6.3-1ubuntu1 [519 kB]
Get:46 http://archive.ubuntu.com/ubuntu artful/main amd64 python3-dev amd64 3.6.3-0ubuntu2 [1206 B]
Get:47 http://archive.ubuntu.com/ubuntu artful/main amd64 python3-secretstorage all 2.3.1-2 [12.1 kB]
Get:48 http://archive.ubuntu.com/ubuntu artful/main amd64 python3-keyring all 10.4.0-1 [26.0 kB]
Get:49 http://archive.ubuntu.com/ubuntu artful/main amd64 python3-keyrings.alt all 2.2-2 [16.0 kB]
Get:50 http://archive.ubuntu.com/ubuntu artful/universe amd64 python3-pip all 9.0.1-2 [114 kB]
Get:51 http://archive.ubuntu.com/ubuntu artful/main amd64 python3-setuptools all 36.2.7-2 [178 kB]
Get:52 http://archive.ubuntu.com/ubuntu artful/universe amd64 python3-wheel all 0.29.0-2 [48.4 kB]
Get:53 http://archive.ubuntu.com/ubuntu artful/main amd64 python3-xdg all 0.25-4 [31.5 kB]
Fetched 42.0 MB in 1s (24.1 MB/s)
Extracting templates from packages: 100%
Selecting previously unselected package binutils-common:amd64.
(Reading database ... 57214 files and directories currently installed.)
Preparing to unpack .../00-binutils-common_2.29.1-4ubuntu1_amd64.deb ...
Unpacking binutils-common:amd64 (2.29.1-4ubuntu1) ...
Selecting previously unselected package libbinutils:amd64.
Preparing to unpack .../01-libbinutils_2.29.1-4ubuntu1_amd64.deb ...
Unpacking libbinutils:amd64 (2.29.1-4ubuntu1) ...
Selecting previously unselected package binutils-x86-64-linux-gnu.
Preparing to unpack .../02-binutils-x86-64-linux-gnu_2.29.1-4ubuntu1_amd64.deb ...
Unpacking binutils-x86-64-linux-gnu (2.29.1-4ubuntu1) ...
Selecting previously unselected package binutils.
Preparing to unpack .../03-binutils_2.29.1-4ubuntu1_amd64.deb ...
Unpacking binutils (2.29.1-4ubuntu1) ...
Selecting previously unselected package libc-dev-bin.
Preparing to unpack .../04-libc-dev-bin_2.26-0ubuntu2.1_amd64.deb ...
Unpacking libc-dev-bin (2.26-0ubuntu2.1) ...
Selecting previously unselected package linux-libc-dev:amd64.
Preparing to unpack .../05-linux-libc-dev_4.13.0-39.44_amd64.deb ...
Unpacking linux-libc-dev:amd64 (4.13.0-39.44) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../06-libc6-dev_2.26-0ubuntu2.1_amd64.deb ...
Unpacking libc6-dev:amd64 (2.26-0ubuntu2.1) ...
Selecting previously unselected package libisl15:amd64.
Preparing to unpack .../07-libisl15_0.18-1_amd64.deb ...
Unpacking libisl15:amd64 (0.18-1) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../08-libmpc3_1.0.3-2_amd64.deb ...
Unpacking libmpc3:amd64 (1.0.3-2) ...
Selecting previously unselected package cpp-7.
Preparing to unpack .../09-cpp-7_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking cpp-7 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package cpp.
Preparing to unpack .../10-cpp_4%3a7.2.0-1ubuntu1_amd64.deb ...
Unpacking cpp (4:7.2.0-1ubuntu1) ...
Selecting previously unselected package libcc1-0:amd64.
Preparing to unpack .../11-libcc1-0_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libcc1-0:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libgomp1:amd64.
Preparing to unpack .../12-libgomp1_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libgomp1:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libitm1:amd64.
Preparing to unpack .../13-libitm1_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libitm1:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../14-libatomic1_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libatomic1:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libasan4:amd64.
Preparing to unpack .../15-libasan4_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libasan4:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package liblsan0:amd64.
Preparing to unpack .../16-liblsan0_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking liblsan0:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libtsan0:amd64.
Preparing to unpack .../17-libtsan0_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libtsan0:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libubsan0:amd64.
Preparing to unpack .../18-libubsan0_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libubsan0:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libcilkrts5:amd64.
Preparing to unpack .../19-libcilkrts5_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libcilkrts5:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libmpx2:amd64.
Preparing to unpack .../20-libmpx2_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libmpx2:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libquadmath0:amd64.
Preparing to unpack .../21-libquadmath0_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libquadmath0:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package libgcc-7-dev:amd64.
Preparing to unpack .../22-libgcc-7-dev_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libgcc-7-dev:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package gcc-7.
Preparing to unpack .../23-gcc-7_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking gcc-7 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package gcc.
Preparing to unpack .../24-gcc_4%3a7.2.0-1ubuntu1_amd64.deb ...
Unpacking gcc (4:7.2.0-1ubuntu1) ...
Selecting previously unselected package libstdc++-7-dev:amd64.
Preparing to unpack .../25-libstdc++-7-dev_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking libstdc++-7-dev:amd64 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package g++-7.
Preparing to unpack .../26-g++-7_7.2.0-8ubuntu3.2_amd64.deb ...
Unpacking g++-7 (7.2.0-8ubuntu3.2) ...
Selecting previously unselected package g++.
Preparing to unpack .../27-g++_4%3a7.2.0-1ubuntu1_amd64.deb ...
Unpacking g++ (4:7.2.0-1ubuntu1) ...
Selecting previously unselected package make.
Preparing to unpack .../28-make_4.1-9.1_amd64.deb ...
Unpacking make (4.1-9.1) ...
Selecting previously unselected package libdpkg-perl.
Preparing to unpack .../29-libdpkg-perl_1.18.24ubuntu1_all.deb ...
Unpacking libdpkg-perl (1.18.24ubuntu1) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../30-dpkg-dev_1.18.24ubuntu1_all.deb ...
Unpacking dpkg-dev (1.18.24ubuntu1) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../31-build-essential_12.4ubuntu1_amd64.deb ...
Unpacking build-essential (12.4ubuntu1) ...
Selecting previously unselected package libfakeroot:amd64.
Preparing to unpack .../32-libfakeroot_1.21-1ubuntu2_amd64.deb ...
Unpacking libfakeroot:amd64 (1.21-1ubuntu2) ...
Selecting previously unselected package fakeroot.
Preparing to unpack .../33-fakeroot_1.21-1ubuntu2_amd64.deb ...
Unpacking fakeroot (1.21-1ubuntu2) ...
Selecting previously unselected package libalgorithm-diff-perl.
Preparing to unpack .../34-libalgorithm-diff-perl_1.19.03-1_all.deb ...
Unpacking libalgorithm-diff-perl (1.19.03-1) ...
Selecting previously unselected package libalgorithm-diff-xs-perl.
Preparing to unpack .../35-libalgorithm-diff-xs-perl_0.04-4build3_amd64.deb ...
Unpacking libalgorithm-diff-xs-perl (0.04-4build3) ...
Selecting previously unselected package libalgorithm-merge-perl.
Preparing to unpack .../36-libalgorithm-merge-perl_0.08-3_all.deb ...
Unpacking libalgorithm-merge-perl (0.08-3) ...
Selecting previously unselected package libexpat1-dev:amd64.
Preparing to unpack .../37-libexpat1-dev_2.2.3-1_amd64.deb ...
Unpacking libexpat1-dev:amd64 (2.2.3-1) ...
Selecting previously unselected package libfile-fcntllock-perl.
Preparing to unpack .../38-libfile-fcntllock-perl_0.22-3build2_amd64.deb ...
Unpacking libfile-fcntllock-perl (0.22-3build2) ...
Selecting previously unselected package libpython3.6-dev:amd64.
Preparing to unpack .../39-libpython3.6-dev_3.6.3-1ubuntu1_amd64.deb ...
Unpacking libpython3.6-dev:amd64 (3.6.3-1ubuntu1) ...
Selecting previously unselected package libpython3-dev:amd64.
Preparing to unpack .../40-libpython3-dev_3.6.3-0ubuntu2_amd64.deb ...
Unpacking libpython3-dev:amd64 (3.6.3-0ubuntu2) ...
Selecting previously unselected package manpages-dev.
Preparing to unpack .../41-manpages-dev_4.13-3_all.deb ...
Unpacking manpages-dev (4.13-3) ...
Selecting previously unselected package python-pip-whl.
Preparing to unpack .../42-python-pip-whl_9.0.1-2_all.deb ...
Unpacking python-pip-whl (9.0.1-2) ...
Selecting previously unselected package python3-crypto.
Preparing to unpack .../43-python3-crypto_2.6.1-7ubuntu0.1_amd64.deb ...
Unpacking python3-crypto (2.6.1-7ubuntu0.1) ...
Selecting previously unselected package python3.6-dev.
Preparing to unpack .../44-python3.6-dev_3.6.3-1ubuntu1_amd64.deb ...
Unpacking python3.6-dev (3.6.3-1ubuntu1) ...
Selecting previously unselected package python3-dev.
Preparing to unpack .../45-python3-dev_3.6.3-0ubuntu2_amd64.deb ...
Unpacking python3-dev (3.6.3-0ubuntu2) ...
Selecting previously unselected package python3-secretstorage.
Preparing to unpack .../46-python3-secretstorage_2.3.1-2_all.deb ...
Unpacking python3-secretstorage (2.3.1-2) ...
Selecting previously unselected package python3-keyring.
Preparing to unpack .../47-python3-keyring_10.4.0-1_all.deb ...
Unpacking python3-keyring (10.4.0-1) ...
Selecting previously unselected package python3-keyrings.alt.
Preparing to unpack .../48-python3-keyrings.alt_2.2-2_all.deb ...
Unpacking python3-keyrings.alt (2.2-2) ...
Selecting previously unselected package python3-pip.
Preparing to unpack .../49-python3-pip_9.0.1-2_all.deb ...
Unpacking python3-pip (9.0.1-2) ...
Selecting previously unselected package python3-setuptools.
Preparing to unpack .../50-python3-setuptools_36.2.7-2_all.deb ...
Unpacking python3-setuptools (36.2.7-2) ...
Selecting previously unselected package python3-wheel.
Preparing to unpack .../51-python3-wheel_0.29.0-2_all.deb ...
Unpacking python3-wheel (0.29.0-2) ...
Selecting previously unselected package python3-xdg.
Preparing to unpack .../52-python3-xdg_0.25-4_all.deb ...
Unpacking python3-xdg (0.25-4) ...
Setting up libquadmath0:amd64 (7.2.0-8ubuntu3.2) ...
Setting up libgomp1:amd64 (7.2.0-8ubuntu3.2) ...
Setting up libatomic1:amd64 (7.2.0-8ubuntu3.2) ...
Setting up python-pip-whl (9.0.1-2) ...
Setting up libcc1-0:amd64 (7.2.0-8ubuntu3.2) ...
Setting up make (4.1-9.1) ...
Setting up libasan4:amd64 (7.2.0-8ubuntu3.2) ...
Setting up libcilkrts5:amd64 (7.2.0-8ubuntu3.2) ...
Setting up python3-crypto (2.6.1-7ubuntu0.1) ...
Setting up libubsan0:amd64 (7.2.0-8ubuntu3.2) ...
Setting up libtsan0:amd64 (7.2.0-8ubuntu3.2) ...
Setting up python3-xdg (0.25-4) ...
Setting up python3-keyrings.alt (2.2-2) ...
Setting up linux-libc-dev:amd64 (4.13.0-39.44) ...
Setting up libdpkg-perl (1.18.24ubuntu1) ...
Setting up python3-wheel (0.29.0-2) ...
Setting up liblsan0:amd64 (7.2.0-8ubuntu3.2) ...
Setting up binutils-common:amd64 (2.29.1-4ubuntu1) ...
Setting up libfile-fcntllock-perl (0.22-3build2) ...
Setting up libmpx2:amd64 (7.2.0-8ubuntu3.2) ...
Setting up libisl15:amd64 (0.18-1) ...
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
Setting up libfakeroot:amd64 (1.21-1ubuntu2) ...
Setting up python3-pip (9.0.1-2) ...
Setting up libalgorithm-diff-perl (1.19.03-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libmpc3:amd64 (1.0.3-2) ...
Setting up libc-dev-bin (2.26-0ubuntu2.1) ...
Setting up python3-setuptools (36.2.7-2) ...
Setting up python3-secretstorage (2.3.1-2) ...
Setting up manpages-dev (4.13-3) ...
Setting up libc6-dev:amd64 (2.26-0ubuntu2.1) ...
Setting up libitm1:amd64 (7.2.0-8ubuntu3.2) ...
Setting up python3-keyring (10.4.0-1) ...
Setting up libbinutils:amd64 (2.29.1-4ubuntu1) ...
Setting up fakeroot (1.21-1ubuntu2) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libgcc-7-dev:amd64 (7.2.0-8ubuntu3.2) ...
Setting up cpp-7 (7.2.0-8ubuntu3.2) ...
Setting up libstdc++-7-dev:amd64 (7.2.0-8ubuntu3.2) ...
Setting up libalgorithm-merge-perl (0.08-3) ...
Setting up libalgorithm-diff-xs-perl (0.04-4build3) ...
Setting up libexpat1-dev:amd64 (2.2.3-1) ...
Setting up binutils-x86-64-linux-gnu (2.29.1-4ubuntu1) ...
Setting up cpp (4:7.2.0-1ubuntu1) ...
Setting up libpython3.6-dev:amd64 (3.6.3-1ubuntu1) ...
Setting up binutils (2.29.1-4ubuntu1) ...
Setting up python3.6-dev (3.6.3-1ubuntu1) ...
Setting up libpython3-dev:amd64 (3.6.3-0ubuntu2) ...
Setting up gcc-7 (7.2.0-8ubuntu3.2) ...
Setting up g++-7 (7.2.0-8ubuntu3.2) ...
Setting up python3-dev (3.6.3-0ubuntu2) ...
Setting up gcc (4:7.2.0-1ubuntu1) ...
Setting up dpkg-dev (1.18.24ubuntu1) ...
Setting up g++ (4:7.2.0-1ubuntu1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.4ubuntu1) ...
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
pip3 --version; which pip3 # pre pipenv install
vagrant@ubuntu-artful:~$ # Log Pip3 info before pipenv install
vagrant@ubuntu-artful:~$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
vagrant@ubuntu-artful:~$ which pip3
/usr/bin/pip3
pip3 install --user pipenv
vagrant@ubuntu-artful:~$ # Install pipenv as user
vagrant@ubuntu-artful:~$ pip3 install --user pipenv
Collecting pipenv
  Downloading https://files.pythonhosted.org/packages/2c/01/37a5867a47d52856b077d0faa561b791cb6e6e3e9410837b6d62f569c1e6/pi
penv-11.10.1-py3-none-any.whl (6.3MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 6.3MB 194kB/s
Collecting virtualenv-clone>=0.2.5 (from pipenv)
  Downloading https://files.pythonhosted.org/packages/6d/c2/dccb5ccf599e0c5d1eea6acbd058af7a71384f9740179db67a9182a24798/vi
rtualenv_clone-0.3.0-py2.py3-none-any.whl
Collecting certifi (from pipenv)
  Downloading https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/ce
rtifi-2018.4.16-py2.py3-none-any.whl (150kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 153kB 7.0MB/s
Collecting setuptools>=36.2.1 (from pipenv)
  Downloading https://files.pythonhosted.org/packages/8c/10/79282747f9169f21c053c562a0baa21815a8c7879be97abd930dbcf862e8/se
tuptools-39.1.0-py2.py3-none-any.whl (566kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 573kB 2.3MB/s
Collecting pip>=9.0.1 (from pipenv)
  Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pi
p-10.0.1-py2.py3-none-any.whl (1.3MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.3MB 1.0MB/s
Collecting virtualenv (from pipenv)
  Downloading https://files.pythonhosted.org/packages/ed/ea/e20b5cbebf45d3096e8138ab74eda139595d827677f38e9dd543e6015bdf/vi
rtualenv-15.2.0-py2.py3-none-any.whl (2.6MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2.6MB 397kB/s
Installing collected packages: virtualenv-clone, certifi, setuptools, pip, virtualenv, pipenv
Successfully installed certifi-2018.4.16 pip-10.0.1 pipenv-11.10.1 setuptools-39.1.0 virtualenv-15.2.0 virtualenv-clone-0.3
.0
pip3 --version; which pip3 # post pipenv install
vagrant@ubuntu-artful:~$ # Log Pip3 info after pipenv install
vagrant@ubuntu-artful:~$ pip3 --version
which pip3Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'
vagrant@ubuntu-artful:~$ which pip3
/usr/bin/pip3
Environment:
  • Ubuntu 17.10 (running under Vagrant)
$ python -m pipenv.help output

Pipenv version: '11.10.1'

Pipenv location: '/home/vagrant/.local/lib/python3.6/site-packages/pipenv'

Python location: '/usr/bin/python3'

Other Python installations in PATH:

  • 3.6: /usr/bin/python3.6m

  • 3.6: /usr/bin/python3.6

  • 3.6.3: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.3',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.13.0-38-generic',
 'platform_system': 'Linux',
 'platform_version': '#43-Ubuntu SMP Wed Mar 14 15:20:44 UTC 2018',
 'python_full_version': '3.6.3',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • LS_COLORS
  • SSH_CONNECTION
  • LESSCLOSE
  • LANG
  • XDG_SESSION_ID
  • USER
  • PWD
  • HOME
  • SSH_CLIENT
  • XDG_DATA_DIRS
  • SSH_TTY
  • MAIL
  • TERM
  • SHELL
  • SHLVL
  • LOGNAME
  • XDG_RUNTIME_DIR
  • PATH
  • LESSOPEN
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: C.UTF-8
  • PWD: /home/vagrant

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

17reactions
techalchemycommented, May 1, 2018

pip3 install --user pipenv … Collecting pip>=9.0.1 (from pipenv) Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB) … Successfully installed certifi-2018.4.16 pip-10.0.1 pipenv-11.10.1 setuptools-39.1.0 virtualenv-15.2.0 virtualenv-clone-0.3.0

The user installation of pipenv also installed pip, and pip 10 isn’t compatible with pip 9 – your executable path might point at /usr/bin/pip, but your python path is looking in your user site packages for pip when it does the import. You need to add to your bashrc/adjust your path however you like with the following: export PATH="${HOME}/.local/bin:$PATH"

Sorry for the confusion! Distribution packaged pip versions cause a lot more headaches than they are worth.

0reactions
Nditahcommented, Nov 7, 2018

Please simply reinstall pip3:

sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems with pip3 and pipenv with Mac OS Catalina fresh ...
My recommendation: From a fresh install of Catalina, run sudo pip3 install pipenv . Create a separate directory for each project you work...
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
This is usually a result of mixing Pipenv with system packages. We strongly recommend installing Pipenv in an isolated environment. Uninstall all existingΒ ......
Read more >
Python3 pip3 install broken on Ubuntu
After running pip3 install --upgrade pip , pip version become 18.1, and main() has been moved in pip._internal .
Read more >
Common Pipenv Errors - Towards Data Science
The virtual environment is named after the project directory where it is initialized. The Pipfile stores the packages or dependencies requiredΒ ...
Read more >
Pipenv & Virtual Environments
pip install --user pipenv. Note. This does a user installation to prevent breaking any system-wide packages. If pipenv isn't available in your shell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found