[MacPorts] #63782: python38 @3.8.12 has a problem when using venv: ModuleNotFoundError: No module named 'msvcrt'
MacPorts
noreply at macports.org
Wed Nov 3 10:03:10 UTC 2021
#63782: python38 @3.8.12 has a problem when using venv: ModuleNotFoundError: No
module named 'msvcrt'
--------------------+--------------------
Reporter: casr | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port:
--------------------+--------------------
I have built python38 with the +universal variant, however, when I use the
arm64 version it fails to create a virtualenv directory and complains
with:
{{{
Traceback (most recent call last):
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py",
line 64, in <module>
import msvcrt
ModuleNotFoundError: No module named 'msvcrt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py",
line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py",
line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py",
line 111, in _get_module_details
__import__(pkg_name)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/venv/__init__.py",
line 10, in <module>
import subprocess
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py",
line 69, in <module>
import _posixsubprocess
ImportError: dynamic module does not define module export function
(PyInit__posixsubprocess)
}}}
I am running macOS 12.0.1 21A559 arm64, Xcode 13.1 13A1030d.
To reproduce:
{{{
# works
( cd $(mktemp -d) && arch -x86_64 python3.8 -m venv venv )
# fails
( cd $(mktemp -d) && arch -arm64 python3.8 -m venv venv )
# fails
( cd $(mktemp -d) && python3.8 -m venv venv )
}}}
Seems similar to the problem described in
https://trac.macports.org/ticket/61282
--
Ticket URL: <https://trac.macports.org/ticket/63782>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list