Posts: 6
Threads: 1
Joined: Jan 2020
The issues as below:
1 run the pyinstaller using A.py, to generate the exe file named A_exe
2 run the A_exe to run the python file B,print the env variable PYTHONPATH,then error happen
3 if I using A.py directly,then Correct,
I am confused.
Posts: 8,155
Threads: 160
Joined: Sep 2016
without code it's difficult to guess what is wrong. probably there is some hidden import that pyinstaller is not able to find when creating the exe. Check https://pyinstaller.readthedocs.io/en/st...wrong.html
Posts: 6
Threads: 1
Joined: Jan 2020
Jan-13-2020, 09:44 AM
(This post was last modified: Jan-13-2020, 09:51 AM by roger2020.)
(Jan-13-2020, 08:49 AM)roger2020 Wrote: The issues as below: 1 run the pyinstaller using A.py, to generate the exe file named A_exe 2 run the A_exe to run the python file B,print the env variable PYTHONPATH,then error happen 3 if I using A.py directly,then Correct, I am confused. (Jan-13-2020, 09:18 AM)buran Wrote: without code it's difficult to guess what is wrong. probably there is some hidden import that pyinstaller is not able to find when creating the exe. Check https://pyinstaller.readthedocs.io/en/st...wrong.html Please see the code and results in the pic
Posts: 8,155
Threads: 160
Joined: Sep 2016
Links don't work and in any case don't post images - copy paste code/traceback/output in proper tags
Posts: 6
Threads: 1
Joined: Jan 2020
Jan-13-2020, 09:58 AM
(This post was last modified: Jan-13-2020, 10:03 AM by roger2020.)
(Jan-13-2020, 09:51 AM)buran Wrote: Links don't work and in any case don't post images - copy paste code/traceback/output in proper tags
Sorry,I can't post code ,because I work in the linux server,I Can't copy the code
Posts: 8,155
Threads: 160
Joined: Sep 2016
Your links point to files on your local HD, on Windows OS, although you claim working on linux server....
Posts: 6
Threads: 1
Joined: Jan 2020
(Jan-13-2020, 10:13 AM)buran Wrote: Your links point to files on your local HD, on Windows OS, although you claim working on linux server....
code is simple:
import os
print os.environ["PYTHONPATH"]
Posts: 1,027
Threads: 16
Joined: Dec 2016
Jan-13-2020, 02:31 PM
(This post was last modified: Jan-13-2020, 02:31 PM by Axel_Erfurt.)
What is PYTHONPATH?
import os
print (os.environ["PATH"]) to show all keys
import os
print (os.environ.keys())
Posts: 8,155
Threads: 160
Joined: Sep 2016
Jan-13-2020, 03:15 PM
(This post was last modified: Jan-13-2020, 03:16 PM by buran.)
In addition - according to your initial post you generate an exe (i.e. Windows executable). Then you introduce the fact you work on linux server. If you want to build executable for linux you must run pyinstaller on the target system and generate the binary there, i.e. windows exe will not run on the linux server.
Posts: 6
Threads: 1
Joined: Jan 2020
(Jan-13-2020, 03:15 PM)buran Wrote: In addition - according to your initial post you generate an exe (i.e. Windows executable). Then you introduce the fact you work on linux server. If you want to build executable for linux you must run pyinstaller on the target system and generate the binary there, i.e. windows exe will not run on the linux server.
I generate the exe file in linux server, and usr it in linux , not windows!
|