Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have some .py files I wrote that I want to run on a different machine. The target machine does not have python installed, and I can't 'install' it by policy. What I can do is copy files over, run my stuff, and then remove them.

What I tried was to just take my development python folder over to the target machine and cd to the python folder and run python.exe /path/to/.py/file. It gave me an error saying that python.dll was not registered. If I registered the DLL that is probably going to move me to far across the 'violating policy' line.

Is there anyway I can accomplish running python files on a machine that does not have python actually installed (trying to get py2exe to work now, but it is painful)?

share|improve this question
add comment

3 Answers

Check out Portable Python. That should do what you need.

Current versions (as of December 2013) are 2.7.5 and 3.2.5

share|improve this answer
 
Looks interesting, but possible show stopper that it supports three versions of Python 2.5.4, 2.6.1 and 3.0.1. Thanks –  eat Apr 4 '11 at 14:27
 
You mean you need 2.7.1 or 3.1/3.2? I'm sure they are in development already. –  Tim Pietzcker Apr 4 '11 at 14:28
 
Yes, for me 2.7.1, but I'll keep watching that site. Thanks –  eat Apr 4 '11 at 14:34
 
im at 2.7.1 also, so Ill keep an eye on it, but it can't help me now. Also looking at cx_Freeze, but first shot out of the gate had issues –  ccwhite1 Apr 4 '11 at 14:38
add comment
up vote 4 down vote accepted

I decided to go with cx_Freeze.

It created a distro that I was able to simply copy and move to the target machine. Also, it was much easier to use than py2exe; further it seems that it is still being maintained (as of Mar 10, 2011), while py2exe development does not look as active.

share|improve this answer
1  
You should then mark this as the answer. –  Sridhar Ratnakumar Apr 5 '11 at 16:43
add comment

Check out PyInstaller. It's easier to work with than py2exe (at least for simple applications).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.