1

I have successfully bundled several of my python scripts into exe files using pyinstaller. However, I have hit a problem with a different python script that uses local data files. Using this question and answer PyInstaller 2.0 bundle file as --onefile I have got the script using my local files however I get an error.

I have a master python script called "translate.py" in it I have several subprocesses that call a different python script call "loader.py" which takes a variety of arguments. So my normal subprocess looks like this

python.exe loader.py loader.config src_dir=data out_dir=sql tmp_dir=temp

In my pyinstaller version I have used the answer from the above question to have the following subprocess call

python.exe C:\Users\AppData\Local\Temp\_MEI70922\loader.py C:\Users\AppData\Local\Temp\_MEI70922\loader.config src_dir=dat
a out_dir=sql tmp_dir=temp

However this fails to run the subprocess and I get the following error

no module named site 

So I am wondering if pyinstaller is not including all the modules I may need?

I have tweaked the spec file to analyse all the python scripts like this

a = Analysis(['c:\\temp\\translate.py','c:\\temp\\loader.py','c:\\temp\\prep.py','c:\\temp\\prep2.py'],
         pathex=['C:\\Temp\\pyinstaller-2.0\\pyinstaller-2.0'],
         hiddenimports=[],
         hookspath=None)

But again I get the no module named site.

I know my code could be better but I am stuck as someone else wrote the loader.py and I wrote the translate.py and now I need to bundle it all into a simple exe file.

thanks for anyone's help

Community
  • 1
  • 1
tjmgis
  • 1,589
  • 4
  • 23
  • 42
  • Related (possibly even a duplicate?)? http://stackoverflow.com/questions/5599872/python-windows-importerror-no-module-named-site – Irwin May 07 '13 at 18:10
  • Hi Irwin - I did see that question and yes it does mention the no module named site but my situation and problem is very different so I do not believe this to be a duplicate. – tjmgis May 08 '13 at 09:00

0 Answers0