Christoph Gohlke and compiled packages

Mike Dewhirst miked at dewhirst.com.au
Wed Apr 12 21:27:10 EDT 2023


On 12/04/2023 10:59 pm, Mike Dewhirst wrote:
> Sadly Windows is still in the dock. The jury is still out.
>
> Turns out the "without a hitch" was based on cached wheels.
>
> I'm going to start from scratch with new projects using Pythons 3.8, 
> 3.10 and 3.11 and report back.

Report summary:

pip install works well with Python 3.8 and 3.10 (and presumably 3.9) but 
3.11 fails.

Report conclusion:

As indicated in this thread, pip cannot find Python 3.11 wheels and 
therefore needs to compile from source. It is looking for Microsoft's 
C++ compiler version 14.

I'll (gulp) attempt to swallow the Koolaid.

See error below ...

Cheers

Mike

(xreq) D:\Users\mike\envs\xreq>pip install -r requirements\dev.txt

...

Collecting psycopg2==2.9.3

   Downloading psycopg2-2.9.3.tar.gz (380 kB)

      --------------------------------------- 380.6/380.6 kB 6.0 MB/s eta 0:00:00

   Preparing metadata (setup.py) ... done

Collecting Pillow==9.1.1

   Downloading Pillow-9.1.1.tar.gz (49.8 MB)

      ---------------------------------------- 49.8/49.8 MB 4.5 MB/s eta 0:00:00

   Preparing metadata (setup.py) ... done

...

Installing collected packages: psycopg2, Pillow, ...

   DEPRECATION: psycopg2 is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found athttps://github.com/pypa/pip/issues/8559

   Running setup.py install for psycopg2 ... error

   error: subprocess-exited-with-error

   × Running setup.py install for psycopg2 did not run successfully.

   │ exit code: 1

   ╰─> [24 lines of output]

       D:\Users\mike\envs\xreq\Lib\site-packages\setuptools\config\setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.

         warnings.warn(msg, warning_class)

       running install

       D:\Users\mike\envs\xreq\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.

         warnings.warn(

       running build

       running build_py

       creating build

       creating build\lib.win-amd64-cpython-311

       creating build\lib.win-amd64-cpython-311\psycopg2

       copying lib\errorcodes.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\errors.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\extensions.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\extras.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\pool.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\sql.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\tz.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\_ipaddress.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\_json.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\_range.py -> build\lib.win-amd64-cpython-311\psycopg2

       copying lib\__init__.py -> build\lib.win-amd64-cpython-311\psycopg2

       running build_ext

       building 'psycopg2._psycopg' extension

       error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools":https://visualstudio.microsoft.com/visual-cpp-build-tools/

       [end of output]

   note: This error originates from a subprocess, and is likely not a problem with pip.

error: legacy-install-failure

× Encountered error while trying to install package.

╰─> psycopg2

note: This is an issue with the package mentioned above, not pip.

hint: See above for output from the failure.

(xreq) D:\Users\mike\envs\xreq>




>
> Cheers
>
> Mike
>
> On 12/04/2023 6:13 pm, Mike Dewhirst wrote:
>> Well thank you Christoph Gohlke and thank you Ian Bicking and 
>> colleagues.
>>
>> I just used pip to nakedly install psycopg2 and Pillow without a 
>> hitch. My distrust of Windows has kept me going back to Christoff's 
>> well for years.
>>
>> Maybe it is time to assume innocence unless proven guilty ;-)
>>
>> Thanks to all who showed me the way.
>>
>> Cheers
>>
>> Mike
>>
>> On 11/04/2023 11:39 pm, Thomas Passin wrote:
>>> On 4/11/2023 6:58 AM, Chris Angelico wrote:
>>>> On Tue, 11 Apr 2023 at 20:15, Jim Schwartz <jschwar at sbcglobal.net> 
>>>> wrote:
>>>>>
>>>>> What’s the problem now?  Is it with python on windows?  I use 
>>>>> python on windows so I’d like to know. Thanks
>>>>>
>>>>
>>>> Python itself is fine, but a lot of third-party packages are hard to
>>>> obtain. So if you need numpy, for instance, or psycopg2, you might
>>>> need to find an alternative source.
>>>
>>> I've noticed a big change in the last few years in that PyPi has 
>>> many, many amd-64 packages than it used to in the heyday of 
>>> Christoph Gohlke's efforts. I haven't needed to go there for some 
>>> time whereas I used to need to all the time.  So if I "need numpy, 
>>> for instance, or psycopg2" for Windows, I get them from PyPi.
>>>
>>> Yes, I know that some projects haven't caught up to Python 3.11x 
>>> yet. And I'm glad I haven't needed to create a binary wheel for 
>>> Windows myself.  But the situation is way better than it used to 
>>> be.  I've had more trouble with Python and Python packages on Linux 
>>> than on Windows.
>>>
>>
>>
>>
>
>
>


-- 
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://mail.python.org/pipermail/python-list/attachments/20230413/9b9350d1/attachment.sig>


More information about the Python-list mailing list