title: Python 2.7 installing opencv via pip (virtual environment)
body: <p>I'm trying to install opencv-python package via pip inside virtual environment (Python 2.7). Unfortunately, I'm getting an error:</p>
  <pre><code>(venv) $ pip2 install opencv-python
  DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
  Collecting opencv-python
    Using cached opencv-python-4.3.0.38.tar.gz (88.0 MB)
    Installing build dependencies ... done
    Getting requirements to build wheel ... error
    ERROR: Command errored out with exit status 1:
     command: /home/pc_user/.venvs/venv/bin/python /home/pc_user/.venvs/venv/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp7q7z4L
         cwd: /tmp/pip-install-C21PKF/opencv-python
    Complete output (22 lines):
    Traceback (most recent call last):
      File &quot;/home/pc_user/.venvs/venv/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py&quot;, line 280, in &lt;module&gt;
        main()
      File &quot;/home/pc_user/.venvs/venv/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py&quot;, line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File &quot;/home/pc_user/.venvs/venv/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py&quot;, line 114, in get_requires_for_build_wheel
        return hook(config_settings)
      File &quot;/tmp/pip-build-env-2FzygL/overlay/lib/python2.7/site-packages/setuptools/build_meta.py&quot;, line 146, in get_requires_for_build_wheel
        return self._get_build_requires(config_settings, requirements=['wheel'])
      File &quot;/tmp/pip-build-env-2FzygL/overlay/lib/python2.7/site-packages/setuptools/build_meta.py&quot;, line 127, in _get_build_requires
        self.run_setup()
      File &quot;/tmp/pip-build-env-2FzygL/overlay/lib/python2.7/site-packages/setuptools/build_meta.py&quot;, line 243, in run_setup
        self).run_setup(setup_script=setup_script)
      File &quot;/tmp/pip-build-env-2FzygL/overlay/lib/python2.7/site-packages/setuptools/build_meta.py&quot;, line 142, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File &quot;setup.py&quot;, line 448, in &lt;module&gt;
        main()
      File &quot;setup.py&quot;, line 99, in main
        % {&quot;ext&quot;: re.escape(sysconfig.get_config_var(&quot;EXT_SUFFIX&quot;))}
      File &quot;/usr/lib/python2.7/re.py&quot;, line 210, in escape
        s = list(pattern)
    TypeError: 'NoneType' object is not iterable
    ----------------------------------------
  ERROR: Command errored out with exit status 1: /home/pc_user/.venvs/venv/bin/python /home/pc_user/.venvs/venv/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp7q7z4L Check the logs for full command output.
  </code></pre>
  <p>I've tried to create a new environment or installing through <code>python2 -m pip install</code> but the effect is the same. What's the problem?</p>