Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to import zipextimporter with error "No module named '_memimporter'" #204

Open
sdbbs opened this issue Mar 19, 2024 · 0 comments
Open

Comments

@sdbbs
Copy link

sdbbs commented Mar 19, 2024

I have been messing with this for the past couple of days:

... and finally installed Python 3.11 via Microsoft Store, and tried this:

C:\WINDOWS\system32>python3 --version
Python 3.11.8

C:\WINDOWS\system32>python3 -m pip install py2exe
Collecting py2exe
  Downloading py2exe-0.13.0.1-cp311-cp311-win_amd64.whl.metadata (7.3 kB)
Collecting cachetools (from py2exe)
  Downloading cachetools-5.3.3-py3-none-any.whl.metadata (5.3 kB)
Collecting pefile (from py2exe)
  Downloading pefile-2023.2.7-py3-none-any.whl.metadata (1.4 kB)
Downloading py2exe-0.13.0.1-cp311-cp311-win_amd64.whl (154 kB)
   ---------------------------------------- 154.6/154.6 kB 1.9 MB/s eta 0:00:00
Downloading cachetools-5.3.3-py3-none-any.whl (9.3 kB)
Downloading pefile-2023.2.7-py3-none-any.whl (71 kB)
   ---------------------------------------- 71.8/71.8 kB ? eta 0:00:00
Installing collected packages: pefile, cachetools, py2exe
Successfully installed cachetools-5.3.3 pefile-2023.2.7 py2exe-0.13.0.1

C:\WINDOWS\system32>python3 -m pip install py2exe

C:\WINDOWS\system32>python3 -c 'import zipextimporter'
  File "<string>", line 1
    'import
    ^
SyntaxError: unterminated string literal (detected at line 1)

C:\WINDOWS\system32>python3 -c "import zipextimporter"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\sd\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\zipextimporter.py", line 51, in <module>
    import _memimporter
ModuleNotFoundError: No module named '_memimporter'

So - is _memimporter still a thing or not? The page I took it from, https://www.py2exe.org/index.cgi/TroubleshootingImportErrors has last edit in 2011, so I cannot really tell ... If it is still a thing, how do I do import _memimporter and import zipextimporter?


EDIT: note that the MINGW64 package build got fixed 2024-03-21, and now there is a _memexporter.pyd in that packaging of py2exe (mingw-w64-x86_64-python-py2exe); the maintainer there noted in msys2/MINGW-packages#20382 (comment) :

I found another workaround. I renamed setup_zipextimporter.py to setup.py and build zipextimporter wheel file. It has the _memimporter pyd file.

It seems currently the vanilla Python 3 Windows build of py2exe is still broken as described above; maybe the above will help to get the vanilla build fixed as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant