2

I have a Python command line application that I have been distributing on PyPI in the manner described here: https://gehrcke.de/2014/02/distributing-a-python-command-line-application/

In short, that means I'm using setuptools with the entry_points option in my setup.py file:

import programs    

setup(
    name='my_package',
    entry_points={
        'gui_scripts': [
                'program1 = programs.program1:main',...
        ]
    })

My package is uploaded to PyPI, and can be installed using pip. Normal behavior on the command line is that program1 launches the GUI.

The problem is, I would like to support the Anaconda distribution of Python. If I pip install and try to run program1 using using Anaconda, I get this warning:

This program needs access to the screen.
Please run with a Framework build of python, and only when you are logged in on the main display of your Mac.

The executable script lives here:

~/anaconda2/bin/program1

And here is its text:

#!/Users/***/anaconda2/bin/python                                            

import re
import sys

from programs.program1 import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

And it is importing program1 from this location:

/Users/***/anaconda2/lib/python2.7/site-packages/programs/program1.pyc

How can I get program_1 to run as an executable using Anaconda?

J Jones
  • 3,060
  • 4
  • 26
  • 43

0 Answers0