1

I installed PyPy2.7 in the WSL (Ubuntu 18.04) following the official instructions. I then created a virtualenv and installed Numpy and Scipy with pip install. So far everything works:

$ python
Python 2.7.18 (63df5ef41012, Apr 04 2021, 10:19:14)
[PyPy 7.3.4 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>> import numpy
>>>> import scipy
>>>>

Now I want to install opencv-python, which results in the error described here. This is to be expected. However the suggested solution, running pip install opencv-python==4.2.0.32, doesn't work either

ERROR: Could not find a version that satisfies the requirement opencv-python==4.2.0.32 (from versions: 3.4.10.37, 4.3.0.38)
ERROR: No matching distribution found for opencv-python==4.2.0.32

Somehow only two versions are available and 4.2.0.32 is not one of them. Running pip install opencv-python==3.4.10.37 (which should be old enough to support python2) again throws the original error

Collecting opencv-python==3.4.10.37
  Using cached opencv-python-3.4.10.37.tar.gz (87.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /mnt/d/portProg/pbMoMa-master/my-pypy/bin/pypy /mnt/d/portProg/pbMoMa-master/my-pypy/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpNuRIPK
       cwd: /tmp/pip-install-nj4gRx/opencv-python
  Complete output (22 lines):
  Traceback (most recent call last):
    File "/mnt/d/portProg/pbMoMa-master/my-pypy/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/mnt/d/portProg/pbMoMa-master/my-pypy/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/mnt/d/portProg/pbMoMa-master/my-pypy/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-tZXZdx/overlay/site-packages/setuptools/build_meta.py", line 146, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-tZXZdx/overlay/site-packages/setuptools/build_meta.py", line 127, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-tZXZdx/overlay/site-packages/setuptools/build_meta.py", line 243, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-tZXZdx/overlay/site-packages/setuptools/build_meta.py", line 142, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 448, in <module>
      main()
    File "setup.py", line 99, in main
      % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))}
    File "/mnt/d/portProg/pbMoMa-master/my-pypy/lib-python/2.7/re.py", line 210, in escape
      s = list(pattern)
  TypeError: 'NoneType' object is not iterable
  ----------------------------------------
ERROR: Command errored out with exit status 1: /mnt/d/portProg/pbMoMa-master/my-pypy/bin/pypy /mnt/d/portProg/pbMoMa-master/my-pypy/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpNuRIPK Check the logs for full command output.
2
  • Why use pypy2.7? You should be using a supported version of python, 3.7 is the latest.
    – mattip
    Commented May 2, 2021 at 6:52
  • @mattip I want to run some old Python 2 code I didn't write myself, but I managed to port it to Python 3, which was actually easier than I originally expected.
    – jullit31
    Commented May 3, 2021 at 16:27

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.