Reputation: 41
i compiled a python code into executable in my machine using nuitka and it works fine. However, when I try to run the exe file from another computer I get this system level error:
E:\app\main.dist>main.exe
Traceback (most recent call last):
File "E:\app\MAIN~1.DIS\main.py", line 1, in <module>
File "E:\app\MAIN~1.DIS\requests\__init__.py", line 43, in <module requests>
File "E:\app\MAIN~1.DIS\urllib3\__init__.py", line 11, in <module urllib3>
File "E:\app\MAIN~1.DIS\urllib3\exceptions.py", line 3, in <module urllib3.e
xceptions>
File "E:\app\MAIN~1.DIS\urllib3\packages\six.py", line 234, in create_module
File "E:\app\MAIN~1.DIS\urllib3\packages\six.py", line 209, in load_module
File "E:\app\MAIN~1.DIS\urllib3\packages\six.py", line 118, in _resolve
File "E:\app\MAIN~1.DIS\urllib3\packages\six.py", line 87, in _import_module
File "E:\app\MAIN~1.DIS\http\client.py", line 76, in <module>
File "E:\app\MAIN~1.DIS\socket.py", line 49, in <module>
ImportError: LoadLibraryExW 'E:\app\MAIN~1.DIS\_socket.pyd' failed: The parame
ter is incorrect.
Please note that i have copied all the folders and files created by nuitka to my other computer before running (main.build, main.dist, .env, main.spec).
Anyone with a solution? Please help.
Btw, the operating system in which i compiled and ran where Windows 7 home and Windows 7 ultimate respectively (both 64 bit). I also tried pyinstaller and it was giving the same error.
Upvotes: 0
Views: 642
Reputation: 34
What flags did you use in nuitka and pyinstaller? If you still use --onefile try using this flag for pyinstaller:
--collect-submodules socket.pyd
Upvotes: 1
Reputation: 13
Do you have an "E:" drive in your other computer? If not, maybe that is the reason. If it doesn't have an E: drive, it cannot find the program's scripts because that was where the program was originally made.
" File "E:\app\MAIN~1.DIS\main.py", line 1, in
File "E:\app\MAIN~1.DIS\requests_init_.py", line 43, in "
Try making it in your C: Drive instead and then in your other computer, download it and open it in your C: Drive.
(This might be wrong)
Upvotes: 1