About wxPython and the virtualenv issue

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

About wxPython and the virtualenv issue

Gabrielle C
Does anyone have a definitive solution for that? Does anyone knows if maybe venv works instead of virtualenv?

I tried the scripts posted in the github issue, but none of them worked... some of them broke my environment for the rest of the code.

I work in a macOS High Sierra... but as far as I understood the issue this is general

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: About wxPython and the virtualenv issue

Chris Barker - NOAA Federal
What exactly IS the issue?

But for what it's worth, wxPython works fine in conda environments...

-CHB


On Tue, Aug 14, 2018 at 9:23 PM, Gabrielle C <[hidden email]> wrote:
Does anyone have a definitive solution for that? Does anyone knows if maybe venv works instead of virtualenv?

I tried the scripts posted in the github issue, but none of them worked... some of them broke my environment for the rest of the code.

I work in a macOS High Sierra... but as far as I understood the issue this is general

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: About wxPython and the virtualenv issue

Robin Dunn
In reply to this post by Gabrielle C
On Tuesday, August 14, 2018 at 9:23:37 PM UTC-7, Gabrielle C wrote:
Does anyone have a definitive solution for that? Does anyone knows if maybe venv works instead of virtualenv?

I tried the scripts posted in the github issue, but none of them worked... some of them broke my environment for the rest of the code.

I work in a macOS High Sierra... but as far as I understood the issue this is general


I assume you are talking about this issue:

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. 

This problem only exists with Python 2.7 (and maybe only the stock builds.) If you're using Python3 and venv then you should have no problems.

--
Robin

 

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: About wxPython and the virtualenv issue

Gabrielle C
Robin, hi :)

I am using a mac and virtualenv.... and the issue is still here... maybe with venv this might be solved... 

I tried some tutorials to change python vars but it didn't work for me :/


Chris Baker, hi :)

The issue is that I can't really use wxPython with virtualenv because I get this error:

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.



On 15 August 2018 at 13:09, Robin Dunn <[hidden email]> wrote:
On Tuesday, August 14, 2018 at 9:23:37 PM UTC-7, Gabrielle C wrote:
Does anyone have a definitive solution for that? Does anyone knows if maybe venv works instead of virtualenv?

I tried the scripts posted in the github issue, but none of them worked... some of them broke my environment for the rest of the code.

I work in a macOS High Sierra... but as far as I understood the issue this is general


I assume you are talking about this issue:

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. 

This problem only exists with Python 2.7 (and maybe only the stock builds.) If you're using Python3 and venv then you should have no problems.

--
Robin

 

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: About wxPython and the virtualenv issue

Matt Newville


On Wed, Aug 15, 2018 at 3:06 PM Gabrielle C <[hidden email]> wrote:
Robin, hi :)

I am using a mac and virtualenv.... and the issue is still here... maybe with venv this might be solved... 

I tried some tutorials to change python vars but it didn't work for me :/


Chris Baker, hi :)

The issue is that I can't really use wxPython with virtualenv because I get this error:

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.



On 15 August 2018 at 13:09, Robin Dunn <[hidden email]> wrote:
On Tuesday, August 14, 2018 at 9:23:37 PM UTC-7, Gabrielle C wrote:
Does anyone have a definitive solution for that? Does anyone knows if maybe venv works instead of virtualenv?

I tried the scripts posted in the github issue, but none of them worked... some of them broke my environment for the rest of the code.

I work in a macOS High Sierra... but as far as I understood the issue this is general


I assume you are talking about this issue:

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. 

This problem only exists with Python 2.7 (and maybe only the stock builds.) If you're using Python3 and venv then you should have no problems.


The following applies *only* to Anaconda Python on MacOS:
I definitely see this "Framework build problem" with Anaconda Python on MacOS, with Python2.7, 3.5, and 3.6.  There is a workaround through a "python.app" package that includes a "python.app" Application that can draw to the screen, and a "bin/pythonw" script that points to that app.  So, if you are using Anaconda Python and the "python.app" conda package is installed, then "pythonw my_wxPython_script.py" should work.

Creating a virtual environment with virtualenv will almost certainly not include this pythonw.  It might be trivial to copy the script and app folder, but I have not tried that, and can believe you might have to tweak some paths in bash scripts.  But you can definitely create a virtual environment with conda and have that include the python.app and wxpython packages.  

Hope that helps.  FWIW, I use and distribute wxPython based apps using Anaconda Python (3.6, and wxPython 4), and it definitely does work.

--Matt Newville

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: About wxPython and the virtualenv issue

Chris Barker - NOAA Federal


The issue is that I can't really use wxPython with virtualenv because I get this error:

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.

Matt is right about the “pythonw” thing — to use a GUI on a Mac, the app (in this case Python) needs to be in a “App Bundle.

That is what pythonw is. 

In anaconda, pythonw is a separate executable that comes with the python.app package.

In the python.org builds, python and pythonw are the same thing, and should work with wxPython.

Are you using a build from python.org?

If so, does it work outside of a virtual env? 

If so, the virtualenv must be putting a different “python” python your path (I wonder where it gets it?). 

But it’s virtualenv bug -/ though I have no idea if they want to fix it.

-CHB





On 15 August 2018 at 13:09, Robin Dunn <[hidden email]> wrote:
On Tuesday, August 14, 2018 at 9:23:37 PM UTC-7, Gabrielle C wrote:
Does anyone have a definitive solution for that? Does anyone knows if maybe venv works instead of virtualenv?

I tried the scripts posted in the github issue, but none of them worked... some of them broke my environment for the rest of the code.

I work in a macOS High Sierra... but as far as I understood the issue this is general


I assume you are talking about this issue:

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. 

This problem only exists with Python 2.7 (and maybe only the stock builds.) If you're using Python3 and venv then you should have no problems.


The following applies *only* to Anaconda Python on MacOS:
I definitely see this "Framework build problem" with Anaconda Python on MacOS, with Python2.7, 3.5, and 3.6.  There is a workaround through a "python.app" package that includes a "python.app" Application that can draw to the screen, and a "bin/pythonw" script that points to that app.  So, if you are using Anaconda Python and the "python.app" conda package is installed, then "pythonw my_wxPython_script.py" should work.

Creating a virtual environment with virtualenv will almost certainly not include this pythonw.  It might be trivial to copy the script and app folder, but I have not tried that, and can believe you might have to tweak some paths in bash scripts.  But you can definitely create a virtual environment with conda and have that include the python.app and wxpython packages.  

Hope that helps.  FWIW, I use and distribute wxPython based apps using Anaconda Python (3.6, and wxPython 4), and it definitely does work.

--Matt Newville

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.