0
votes

I've recently installed the latest version of Py2app on my Mac Os X (10.5.8), and I've watched some tutorials on YouTube such as: http://www.youtube.com/watch?v=Zip9H_dLdhI, and http://www.youtube.com/watch?v=5Ehhts9HhE8, but when I copy their main setup code, it gives me an ImportError:

Traceback (most recent call last):
  File "/Users/CarlProject/Rectangles Backup.py", line 7, in <module>
    from setuptools import setup
ImportError: No module named setuptools

This is my setup code, copied and edited from the first YouTube video:

"""
Usage:
    python setup.py py2app

"""

from setuptools import setup

APP = ['Rectangles.py']
DATA_FILES = [('', ['fonts'])]

setup(
    app = APP,
    data_files = DATA_FILES,
    setup_requires = ['py2app'],
)

My Python version is 2.7.5, and I'm using Pygame. The Py2app is the latest: 0.7.3. Yes, everything is on my desktop, and I've installed setuptools 0.9.8 Help!

2
Have you installed setuptools? - Sukrit Kalra
It came in the form of a tar.gz from [pypi.python.org/pypi/py2app/] - JaredCubilla
I don't know about Mac. But, try following the instructions here first. - Sukrit Kalra

2 Answers

1
votes

Just incurred in the same problem but found the solution.

"For ease of distribution, you may wish to have your setup.py script automatically ensure that setuptools is installed. This requires having a copy of ez_setup in your project, which can be obtained from here:"

http://peak.telecommunity.com/dist/ez_setup.py

(Save it in your project directory with .py extension)

"Once this is done, you simply add the two line ez_setup preamble to the very beginning of your setup.py:"

import ez_setup
ez_setup.use_setuptools()

Source: https://pythonhosted.org/py2app/examples.html

0
votes

You need to install setuptools. Download it from here and then check this out to learn how to install it:

Python Setuptools, easy_install setup mac