Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python: Can I run a python script without actually installing python?

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)?

like image 953
ccwhite1 Avatar asked Apr 04 '11 14:04

ccwhite1


People also ask

Can Python script run without Python installed?

py2exe is a Python extension which converts Python scripts (. py) into Microsoft Windows executables (.exe). These executables can run on a system without Python installed. It is the most common tool for doing so.

Can you use Python without installing?

If you are on a system where you don't want to or cannot install a Python interpreter, but you'd like to practice your Python skills, or just want to quickly test an idea, online Python interpreters are a great choice for you. Using an online Python interpreter you can simply run Python code in your web browser.

Can you run a PyInstaller exe without Python?

They do not need to have Python installed at all. The output of PyInstaller is specific to the active operating system and the active version of Python. This means that to prepare a distribution for: a different OS.


1 Answers

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.

like image 142
ccwhite1 Avatar answered Sep 20 '22 21:09

ccwhite1