在 2020年7月6日星期一 UTC+8下午8:18:37,bwoodsend写道: > > Hello, > > Firstly you certainly shouldn’t need to copy those files about. It looks > like the problem is nimpy can’t read the standard lib files from the > base_library.zip archive and you’re extracting them manually. > if I copy pyc files(i.e. contextlib.pyc, genericpath.pyc, ntpath.pyc, os.pyc, site.pyc, stat.pyc, sysconfig.pyc, token.pyc, tokenize.pyc, _sitebuiltins.pyc) into `base_library.zip`, `main_nim.exe` can run which means `nimpy` can read modules from `base_library.zip`
> You can tell PyInstaller not to use the zip by adding the kwarg > noarchive=True to the a = Analysis(...) section of the main.spec file. > (If you’re new to spec files - it’s just a Python script containing all the > build code.) If you edit the spec you must use PyInstaller main.spec > instead of PyInstaller main.py or you will lose your changes. > I found I can use `pyinstaller -d noarchive main.py` to tell pyinstaller not to create `base_library.zip`. Then pyinstaller can produce run-able `main.exe` from `main.py` but I still need to copy 3 files(site.py, _sitebuiltins.py and sysconfig.py) to ensure `main_nim.exe`(just as the name suggested, which is created by nim code) can run so that is not so-automatic yet. -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/28cb1ca1-1f6c-4b7f-9fe0-ba6a90515370o%40googlegroups.com.