Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anaconda Python 3.6 -- pythonw and python supposed to be equivalent?

According to Python 3 documentation, python and pythonw should be equivalent for running GUI scripts as of 3.6

With older versions of Python, there is one Mac OS X quirk that you need to be aware of: programs that talk to the Aqua window manager (in other words, anything that has a GUI) need to be run in a special way. Use pythonw instead of python to start such scripts.

With Python 3.6, you can use either python or pythonw.

However, I just installed Anaconda with Python 3.6, and I still get the non-framework-build error if I try to run my wxPython GUI using python instead of pythonw:

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.

What is going on here? Why does this error persist?

The version of Python I am using is:

Python 3.6.0 :: Anaconda 4.3.1 (x86_64)
like image 611
J Jones Avatar asked Apr 18 '17 18:04

J Jones


2 Answers

The answer can be found here: How to use a framework build of Python with Anaconda

In short, use command

conda install python.app

and pythonw will be installed.

like image 88
bht Avatar answered Oct 13 '22 10:10

bht


I believe you can also just run your python script using pythonw instead of python. You'll need to use pythonw for GUI related programs.

like image 41
swac Avatar answered Oct 13 '22 10:10

swac