Python Forum
the exe file by generated by pyinstaller ,can't get the PYTHONPATH
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
the exe file by generated by pyinstaller ,can't get the PYTHONPATH
#1
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.
Reply
#2
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
İmage

İmage


(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
Reply
#4
Links don't work and in any case don't post images - copy paste code/traceback/output in proper tags
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
(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

İmage

İmage


Sorry,I can't post code ,because I work in the linux server,I Can't copy the code
Reply
#6
Your links point to files on your local HD, on Windows OS, although you claim working on linux server....
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#7
(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"]
Reply
#8
What is PYTHONPATH?

import os
print (os.environ["PATH"])
to show all keys

import os
print (os.environ.keys())
Reply
#9
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.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#10
(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!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to set PYTHONPATH in Visual Studio Code? aupres 5 3,763 Aug-15-2023, 03:51 PM
Last Post: snippsat
  Using pyinstaller with .ui GUI files - No such file or directory error diver999 3 3,070 Jun-27-2023, 01:17 PM
Last Post: diver999
  HOW TO USE C# GENERATED DLL davide_vergnani 2 1,555 Jun-12-2023, 03:35 PM
Last Post: davide_vergnani
  Formating generated .data file to XML malcoverc 3 1,315 Apr-14-2022, 09:41 PM
Last Post: malcoverc
  Pyinstaller distribution file seems too large hammer 4 2,629 Mar-31-2022, 02:33 PM
Last Post: snippsat
  How to add product details in exe generated by pyinstaller arex786 1 8,252 Oct-10-2021, 11:00 AM
Last Post: Sran012
  problem with pyinstaller to create an executable file atlass218 0 2,536 May-15-2021, 11:01 AM
Last Post: atlass218
  Pyinstaller create this error :“File ”multiprocessing\connection.py“, line 691 Formationgrowthhacking 2 3,573 Apr-30-2020, 10:26 AM
Last Post: buran
  Pyinstaller exe file permissions Rainbow_Crash 1 3,124 Jul-11-2019, 04:53 PM
Last Post: SheeppOSU
  How to embed mp3 file with Pyinstaller panoss 2 5,879 Apr-01-2019, 01:13 PM
Last Post: yleongtyl

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020