2008/11/10 Giovanni Bajo <[EMAIL PROTECTED]>:
>
> On 11/6/2008 1:45 PM, IRLStephen wrote:
>> Hi,
>>
>> I have a python application which I am compiling to exe with
>> pyinstaller. The application has a facility that allows the user to
>> execute other python scripts from a gui. The app uses the
>> subprocess.Popen() function to execute the python files in a new
>> process.
>>
>> My problem is that on one winPC, if I run a .py file which prints out
>> os.name, I see 'nt'. However, if I run my application on another winPC
>> (which does not have any installation of python) and then run the
>> same .py file, the os.name is 'posix'
>>
>> Can someone explain why this might be. Its causing me a big issues,
>> because python scripts that try to import non-system modules can't
>> find them on the second PC, but they work fine on the first PC. (the
>> modules are in the same directory as the application)
>>
>> This seems to be down to the sys.path being incorrect on the PC thats
>> reporting its platform as 'posix'. i.e. the sys.path includes /path/to/
>> application, but because its posix, it should be /cygwin/c/path/to/
>> application
>
> I don't have any direct experience with PyInstaller and cygwin. I see
> that "os.name" is being set within os.py, and it uses a heuristic based
> on sys.builtin_module_names. Specifically, if it finds the builtin
> module "posix", it sets os.name = "posix"; if it finds the builtin
> module "nt", it sets os.name = "nt".
>
> So my guess is that Popen() is invoking a different interpret than those
> you are expecting. Can you show us your Popen() line? Do you use
> shell=True or shell=False? You should investigate on what Python version
> is being run. Priting sys.executable and sys.version at the beginning of
> your scripts might get you on track.

Thanks for the response and the helpful input. I finally figured out
what the problem was - On the PC that wasn't working, I had cygwin
installed and 'c:\cygwin\bin' was the first entry in my path. This
meant that the first python executable found when 'python' was run
from the command line was the cygwin version of python.

Moving 'c:\python25' to the start of my path solved the problem!

And as a postscript - thanks for developing and supporting such a useful tool!

Regards,
Stephen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to