How to make Python program run on Mac? - python

I'm trying to find out how to make Python program work on Mac computer. I've built a program using many Python modules like lxml,selenium etc. (PhantomJS.exe) and I've created an exe file using Py2Exe which works correctly but now, I've realised that it should be able to be executed on Mac. Is there a simple way to do that?

There is a mac alternative of py2exe, called py2app.

Related

Bundling Python script to run on different Macs

I wrote a Python script that scrapes PDFs that are in the same directory as the file itself.
I used pyinstaller on my Mac to convert this to a onefile .exe on my MacBook Pro and it works great. However, when I try to send this file to someone else via email, it doesn't open because "it's a Windows file", despite the fact that it was compiled/bundled on a Mac. The modules I use are regex, PyPDF2, among other non-standard libraries. How do I make these executables run on different computers?
I've tried using auto-py-to-exe, but to no avail.
The executables work as built on my Mac, but when I email it to someone whose Mac does not have Python/IDLE installed, I run into a wall. If it makes a difference, I've made a version for Windows, and that works great, too.
AFAIK, you need to compile Python programs separately for each environment. If you're on Linux, give crossenv a try.
If you aren't on Linux, to build packages that work on a Mac without IDLE installed, try py2app.
You can also suggest that whoever you're sending this file to install wine, which will let them run the .exe (though installing python might be a tad easier for them.)

How can I run a python script without python.exe

My goal is to have a python script that I can giving to someone to run on their windows machine that does not have python installed. I do want to package it up in an exe because I want the underlying code to be easily read.
I am updating an old VBscript and I want to mirror it. I am also using a few libraries.
use pyinstaller to package it up to an exe. You can still maintain your source code. Packaging it up wont remove your source code.

Running wxPython module on Windows XP?

I am trying to run a Python project that uses the wxPython module but the problem is that I don't have any idea why isn't working.
I tried to run it on Windows 10 (School) and it runs fine but when I try to run it at home with my Windows XP it doesn't run. The main problem is that it doesn't say any problem, it just seems to run but it doesn't.
I am using Python 2.7 and I am not running the .exe file from the application I just run the .py file that executes everything. (I did in the same way in both Operating systems)
I have installed wxPython 4.0.2.
Is that I am missing something??
I am new in this, so pls don't be so hard!

How to covert multiple Python 3.5.2 scripts and an image into one executable?

How do I convert the following files into one executable?
A main.py file that imports five other python scripts
Five python scripts that each have their own GUI
A background image is used in the main.py file
I am using Python 3.5.2. I have tried py2exe, cx_Freeze and pyinstaller but none seem to work, or I am doing something very wrong. Please could you help with clear steps.
It seems I have to downgrade to Python 3.4 in order to convert successfully but I don't really want to downgrade.
I am using tkinter for GUI and the Python math module for rounding-off numbers.
I've had some success with pyinstaller and a program using enaml (Qt backend) for the GUI.
For pyinstaller it helps to use the --debug option or make a .spec file and set debug=True. Also, pyinstaller has the option to make a single folder with an exe in the folder instead of a single exe, this might be easier to debug. You can distribute your single-folder programme by making a single-exe installer with software like InnoSetup.

Making your python code execute on all computers

I have written a python GUI application.I want to run the code on my friend's computer who doesn't have python interpreter in his computer and that he can't download since he can't connect to the internet.How do I make that happen?
Use py2exe (for Windows), py2app (for Mac), or cx_freeze (for Linux) to bundle the Python interpreter, your program, and the standard library into an executable you can use on a machine with no Python at all.
PS: If your friend's computer isn't on the Internet, however you'd get him your program, you can also get him the kits for Python, etc.
py2exe is a library that allows you to compile Python executables for Windows. There's also cx_Freeze, which is cross-platform.

Categories

Resources