title: Psycopg2 install error on windows (pip or wheel) (UnicodeDecodeError)
body: <p>I am currently trying to make use of pypy to try and see with a profiler if I will get better results than now, currently using only python 3.8</p>
  <p>I have installed pypy 3.9 for windows 10 (64 bits) and been upgrading pip, setuptools, as well as wheels before installing anything, most of packages have been working fine (websockets, google-auth, ...) but when installing aiopg (built on psycopg2) I get this error:</p>
  <pre><code>pip install psycopg2
  Collecting psycopg2
    Using cached psycopg2-2.9.3.tar.gz (380 kB)
    Preparing metadata (setup.py) ... error
    error: subprocess-exited-with-error
  
    ├ù python setup.py egg_info did not run successfully.
    Ôöé exit code: 1
    Ôò░ÔöÇ&gt; [46 lines of output]
        running egg_info
        creating C:\Users\charl\AppData\Local\Temp\pip-pip-egg-info-slfqnpdw\psycopg2.egg-info
        writing C:\Users\charl\AppData\Local\Temp\pip-pip-egg-info-slfqnpdw\psycopg2.egg-info\PKG-INFO
        writing dependency_links to C:\Users\charl\AppData\Local\Temp\pip-pip-egg-info-slfqnpdw\psycopg2.egg-info\dependency_links.txt
        writing top-level names to C:\Users\charl\AppData\Local\Temp\pip-pip-egg-info-slfqnpdw\psycopg2.egg-info\top_level.txt
        writing manifest file 'C:\Users\charl\AppData\Local\Temp\pip-pip-egg-info-slfqnpdw\psycopg2.egg-info\SOURCES.txt'
        c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\config\setupcfg.py:459: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
          warnings.warn(msg, warning_class)
        Traceback (most recent call last):
          File &quot;&lt;string&gt;&quot;, line 36, in &lt;module&gt;
          File &quot;&lt;pip-setuptools-caller&gt;&quot;, line 34, in &lt;module&gt;
          File &quot;C:\Users\charl\AppData\Local\Temp\pip-install-_oajyk5x\psycopg2_8ddd8ed44adb43868bba1fd17520cb9c\setup.py&quot;, line 572, in &lt;module&gt;
            'Download': 'https://pypi.org/project/psycopg2/',
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\__init__.py&quot;, line 87, in setup
            return distutils.core.setup(**attrs)
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\_distutils\core.py&quot;, line 177, in setup
            return run_commands(dist)
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\_distutils\core.py&quot;, line 193, in run_commands
            dist.run_commands()
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 968, in run_commands
            self.run_command(cmd)
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\dist.py&quot;, line 1229, in run_command
            super().run_command(command)
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 987, in run_command
            cmd_obj.run()
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\command\egg_info.py&quot;, line 308, in run
            self.find_sources()
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\command\egg_info.py&quot;, line 315, in find_sources
            mm.run()
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\command\egg_info.py&quot;, line 550, in run
            self.add_defaults()
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\command\egg_info.py&quot;, line 587, in add_defaults
            sdist.add_defaults(self)
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\_distutils\command\sdist.py&quot;, line 252, in add_defaults
            self._add_defaults_ext()
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\_distutils\command\sdist.py&quot;, line 336, in _add_defaults_ext
            build_ext = self.get_finalized_command('build_ext')
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\_distutils\cmd.py&quot;, line 304, in get_finalized_command
            cmd_obj.ensure_finalized()
          File &quot;c:\pypy3.8-v7.3.8-win64\lib\site-packages\setuptools\_distutils\cmd.py&quot;, line 107, in ensure_finalized
            self.finalize_options()
          File &quot;C:\Users\charl\AppData\Local\Temp\pip-install-_oajyk5x\psycopg2_8ddd8ed44adb43868bba1fd17520cb9c\setup.py&quot;, line 381, in finalize_options
            for token in pg_config_helper.query(&quot;ldflags&quot;).split():
          File &quot;C:\Users\charl\AppData\Local\Temp\pip-install-_oajyk5x\psycopg2_8ddd8ed44adb43868bba1fd17520cb9c\setup.py&quot;, line 124, in query
            result = result.decode('ascii')
        UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 13: ordinal not in range(128)
        [end of output]
  
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed
  
  ├ù Encountered error while generating package metadata.
  Ôò░ÔöÇ&gt; See above for output.
  
  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.
  </code></pre>
  <p>I have been trying the following:</p>
  <ul>
  <li>Pypy 3.8 with python 3.8 : same error despite clearing pip cache</li>
  <li>&quot;pip install psycopg2-binary&quot; : same error</li>
  <li>downgrading psycopg2 version : same error until the version is too low : another error due to the fact that the package doesnt exist for my python version</li>
  <li>downloading the whl and installing &quot;manually&quot; : not working for different reason : &quot;psycopg2-2.9.3-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.&quot; despite using python x64 3.8 :</li>
  </ul>
  <pre><code>pip -V
  pip 22.1.2 from c:\pypy3.8-v7.3.8-win64\lib\site-packages\pip (python 3.8)
  </code></pre>
  <p>I've tried using asyncpg since it seems like a really fast postgresql library and my server is mostly made of sql requests and I got :</p>
  <pre><code>asyncpg/protocol/record/recordobj.c(549): warning C4013: '_PyUnicodeWriter_Dealloc' non d\x82fini(e)\xff; extern retournant int pris par d\x82faut
       asyncpg/protocol/record/recordobj.c(549): error C2065: 'writer'\xff: identificateur non d\x82clar\x82
       C:\Users\charl\AppData\Local\Temp\pip-build-env-goboqejq\overlay\Lib\site-packages\setuptools\config\pyprojecttoml.py:123: _InvalidFile: The given `pyproject.toml` file is invalid and would be ignored.
           !!
  
  
           ############################
           # Invalid `pyproject.toml` #
           ############################
  
           Any configurations in `pyproject.toml` will be ignored.
           Please note that future releases of setuptools will halt the build process
           if an invalid file is given.
  
           To prevent setuptools from considering `pyproject.toml` please
           DO NOT include the `[project]` or `[tool.setuptools]` tables in your file.
  
  
       !!
  
         if _skip_bad_config(project_table, orig_setuptools_table, dist):
       error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
       [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  </code></pre>
  <p>psycopg on the other hand worked, but I don't want to use it.</p>
  <p>Any fellow windows friend having similar problems?</p>