PYPY venv pip ERROR: ModuleNotFoundError: No module named 'pip._vendor.six'

Question:

I created venv according to pypy install site:

System-Product-Name:~# virtualenv -p "/home/x/pypy3.8-v7.3.7-linux64/bin/pypy" ve

created virtual environment PyPy3.8.12.final.0-64 in 102ms 

Success. Following step 2 (activation) worked as well… and using:

$python

opens pypy same as using ./pypy, which is as intended.

However after this point nothing really works, it’s an error fiesta and I can’t install packages nowhere as well, nothing works, might be that the installation is damaged but I would love to understand what the nature of the most prevalent of the errors:

what I’m trying to run on PYPY requires web3:

  (ve) root@x-System-Product-Name:/home/x/Desktop# python ll.py

Traceback (most recent call last):  File "ll.py", line 4, in <module>    
from web3 import 
Web3ModuleNotFoundError: No module named 'web3'(ve)

when I try to install it even though it’s there – it’s like undetected, or I’m doing something wrong… anyways, I try to install web3 in various console directories:

ModuleNotFoundError: No module named 'pip._vendor.six'

This error pops up, sometimes after long, web3-unrelated Traceback logs.

I tried installing this peculiar package and it gives a long traceback and then:

ModuleNotFoundError: No module named 'pip._vendor.six'

Same error. Basically everything PYPY related is stuck in an error loop with this vendor_six module, whenever I try to install something from pip. Some of the similar problems on the Internet (never found any PYPY problem with this though) suggest pip installation to be damaged.

  1. What is the reason and nature of this error?
  2. How can I solve it? I’ve never been a fan of reinstalling anything as it doesn’t incentivize thorough understanding of the underlying issues, however, I might have to?

Edit: On GitHub there seems to be a long thread about that issue, here: https://github.com/pypa/pipenv/issues/4804 ;however contributors haven’t reached a final conclusion, some – found individually working solutions:

  • some said installing pyenv helps
  • or pipenv
  • or having proper versions of those, either younger versions, or corresponding
  • some said it’s a purely Debian related issue impossible to replicate on MacOS

I tried installing pyenv and pipenv, running venv after, still outputs the same error though…

Asked By: t_k

||

Answers:

Please use the venv module provided with python

pypy3 -m venv /tmp/venv
source /tmp/venv/bin/activate

The version of virtualenv provided with your linux distro does not know about pypy3.8, since pypy3.8 changed the file layout and that version of virtualenv shipped long before pypy3.8 was released.

Answered By: mattip

Got these ModuleNotFoundError: No module named 'pip._vendor.six' errors while getting Django project running on Ubuntu 20.04 LTS using pipenv while it was running fine on MacOS and Debian 11 server. pipenv sync --dev command and any pip install and pip uninstall commands ran inside pipenv shell were failing with the same error.

Tried multiple fixes including some from this same Github Issue page as OP with no luck. Finally got it working from a suggestion on a somewhat related Ubuntu pipenv bug report page https://bugs.launchpad.net/ubuntu/+source/pipenv/+bug/1885609 which was to remove "dangling virtualenv from previous version" with command:

rm -rf ~/.local/share/virtualenvs

Not completely sure how it worked, but it did. pipenv sync --dev runs without errors and Django project runs. Will update if I manage to understand this better.

Answered By: Jarkko Saltiola

Try reinstalling pypy’s pip3, as suggested by https://stackoverflow.com/a/51166161/473899 .

curl -sS https://bootstrap.pypa.io/get-pip.py | pypy3

I only have experience with a CPython virtualenv, but I had the exact same ModuleNotFoundError: No module named 'pip._vendor.six', and this solved it. Hopefully it’ll work with PyPy, too.

Answered By: Esteis

After install python by pyenv and then create a new virtual environment by pipenv in Ubuntu 20.04, after enter the new environment and run the command pipenv install packages to install package, I also meet the problem.

I solved this problem by reinstall pip:

curl -LJO https://raw.githubusercontent.com/Thesoul20/daily-work/main/get-pip.py
unset all_proxy && unset ALL_PROXY
python get-pip.py --force-reinstall

Firstly, download the get_pip.py and then forbidden all the proxy in my computer to make sure the last command can success run. After that, you can successful install package by pipenv.

Answered By: Thesoul