Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65301 closed defect (fixed)

python35 @3.5.10_5 reports 'ImportError: No module named zlib'

Reported by: WrenMail Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: jmroot (Joshua Root)
Port: python35

Description

After updating to python35, release 3.5.10_5 suddenly broke existing 3.5 scripts. Tried cleaning, uninstall/reinstall, but kept getting: File "/usr/local/lib/python2.6/gzip.py", line 9, in <module>

import zlib

ImportError: No module named zlib

The only fix that worked was sudo port activate python35 @3.5.10_4

Running Monterey 12.4, on 2.3Ghz Intel i9, 16Gb RAM

Change History (5)

comment:1 Changed 2 years ago by jmroot (Joshua Root)

Cc: jmroot added
Keywords: python35 zlib removed

Python 3.5 is EOL and no longer getting even security updates, so you should really switch to 3.10 if at all possible. However it looks like this particular problem is due to PYTHONPATH being set and pointing to an incompatible (2.6) installation.

comment:2 Changed 2 years ago by WrenMail

I definitely understand, and am not using it by choice, but it appears that something changed between @3.5.10_4 and @3.5.10_5 that has broken some dependencies, so I thought I should report it.

comment:3 Changed 2 years ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 5339b1b25ce230b1e47d291de97e5489423ea602/macports-ports (master):

python3{4,5}: fix breakage due to openssl pg

The portgroup replaces -I with -isystem, which breaks python's ability
to detect header dependencies for its stdlib modules.

Fixes: #65301

comment:4 Changed 2 years ago by jmroot (Joshua Root)

Still not sure how using 2.6 scripts in 3.5 ever worked for you, but the zlib module was indeed failing to get built, and that is now fixed.

comment:5 Changed 2 years ago by WrenMail

My fault for the confusion. I copied the error message from a page that offered a fix, but no, it was never 2.6, that message should be ".../usr/local/lib/python3.5/gzip.py...". I've never used Python below 3.4. Apologies for the confusion.

Note: See TracTickets for help on using tickets.