Re: [pypy-dev] Tkinter ?
Here is backend_wx.pyhttps://pastebin.com/0bHs4rY5 from~/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+112.g17ec41612.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/backend_wx.py Around line 1818 there is a mix of tabs and spaces, which doesn't seem right. Also "class PrintoutWx(wx.Printout):" appears more than once. I'm using the method from that webpage, the only change is I added "sudo" and "-y" to the apt-get line. I used my script to grab pypy nightly:https://gist.github.com/stuaxo/5d4c0363317a875617271a6d424abbba activated the virtualenv it created for trunk $ source ~/.virtualenvs/pypy-nightly-trunk/bin/activate Then ran the script - pointing at the virtualenv$ ./build_wx-cffi.sh $VIRTUAL_ENV I noticed this error when building: doc "/mnt/data/home/stu/.virtualenvs/pypy-nightly-trunk/bin/pypy" etg/grid.py --cffi --nodoc Traceback (most recent call last): File "etg/grid.py", line 392, in run() File "etg/grid.py", line 387, in run tools.runGenerators(module) File "/tmp/t/wxpython-cffi/etgtools/tweaker_tools.py", line 636, in runGenerators g.generate(module) File "/tmp/t/wxpython-cffi/etgtools/pi_generator.py", line 52, in generate self.generateModule(module, stream) File "/tmp/t/wxpython-cffi/etgtools/pi_generator.py", line 149, in generateModule function(item, stream) File "/tmp/t/wxpython-cffi/etgtools/pi_generator.py", line 365, in generateClass bases = [self.fixWxPrefix(b, True) for b in bases] File "/tmp/t/wxpython-cffi/etgtools/tweaker_tools.py", line 96, in fixWxPrefix self._getCoreTopLevelNames() File "/tmp/t/wxpython-cffi/etgtools/tweaker_tools.py", line 133, in _getCoreTopLevelNames parseTree = ast.parse(text, filename) File "/home/stu/pypy-nightly/trunk/pypy-c-jit-latest-linux64/lib-python/2.7/ast.py", line 37, in parse return compile(source, filename, mode, PyCF_ONLY_AST) File "wx/core.pi", line 27712 def operator==(): I can't paste the whole compile output on pastebin as it is > 512k On Saturday, September 30, 2017, 8:56:48 PM GMT+1, Matti Picuswrote: #yiv9103688383 body p {margin-bottom:0cm;margin-top:0pt;} On 30/09/17 03:32, Stuart Axon via pypy-dev wrote: Cheers for the suggestons on TKinter and matplotlib - mplcairo is out, since it uses pycairo (as opposed to cairocffi). Wx-CFFI looks interesting, however all the matplotlib tutorials give me errors like the one below, so that is probably out as well for now - I'll definitely keep an eye on it and see it starts working though. $ python pyplot.py /home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/wx/core.py:17: UserWarning: wxPython/wxWidgets release number mismatch warnings.warn("wxPython/wxWidgets release number mismatch") /home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/wx/_core.py:31546: UserWarning: implicit cast from 'unsigned char *' to 'char *' will be forbidden in the future (check that the types are as you expect; use an explicit ffi.cast() if they are correct) clib.Cursor_set_flags(wrapper_lib.get_ptr(self), flags) Traceback (most recent call last): File "pyplot.py", line 38, in import matplotlib.pyplot as plt File"/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/pyplot.py", line 113, in _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File"/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/__init__.py", line 60, in pylab_setup [backend_name], 0) File"/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/backend_wxagg.py", line 12, in from . import backend_wx File"/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/backend_wx.py", line 1818 SyntaxError: return outside function That seems like a strange syntax error, since backend_wx.py is used in the standard matplotlib (non-pypy) which is green on their buildbot. if you are using the method here https://pythonfiles.wordpress.com/2017/06/28/making-matplotlib-work-with-pypy/ perhaps it just needs a bit of tweaking for newer versions of backend_wx Could you post your backend_wx.py to a pastebin or gist so we can reproduce? Matti ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] Tkinter ?
On 30/09/17 03:32, Stuart Axon via pypy-dev wrote: Cheers for the suggestons on TKinter and matplotlib - mplcairo is out, since it uses pycairo (as opposed to cairocffi). Wx-CFFI looks interesting, however all the matplotlib tutorials give me errors like the one below, so that is probably out as well for now - I'll definitely keep an eye on it and see it starts working though. $ python pyplot.py /home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/wx/core.py:17: UserWarning: wxPython/wxWidgets release number mismatch warnings.warn("wxPython/wxWidgets release number mismatch") /home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/wx/_core.py:31546: UserWarning: implicit cast from 'unsigned char *' to 'char *' will be forbidden in the future (check that the types are as you expect; use an explicit ffi.cast() if they are correct) clib.Cursor_set_flags(wrapper_lib.get_ptr(self), flags) Traceback (most recent call last): File "pyplot.py", line 38, in import matplotlib.pyplot as plt File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/pyplot.py", line 113, in _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/__init__.py", line 60, in pylab_setup [backend_name], 0) File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/backend_wxagg.py", line 12, in from . import backend_wx File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/backend_wx.py", line 1818 SyntaxError: return outside function That seems like a strange syntax error, since backend_wx.py is used in the standard matplotlib (non-pypy) which is green on their buildbot. if you are using the method here https://pythonfiles.wordpress.com/2017/06/28/making-matplotlib-work-with-pypy/ perhaps it just needs a bit of tweaking for newer versions of backend_wx Could you post your backend_wx.py to a pastebin or gist so we can reproduce? Matti ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] Tkinter ?
Cheers for the suggestons on TKinter and matplotlib - mplcairo is out, since it uses pycairo (as opposed to cairocffi). Wx-CFFI looks interesting, however all the matplotlib tutorials give me errors like the one below, so that is probably out as well for now - I'll definitely keep an eye on it and see it starts working though. $ python pyplot.py /home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/wx/core.py:17: UserWarning: wxPython/wxWidgets release number mismatch warnings.warn("wxPython/wxWidgets release number mismatch") /home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/wx/_core.py:31546: UserWarning: implicit cast from 'unsigned char *' to 'char *' will be forbidden in the future (check that the types are as you expect; use an explicit ffi.cast() if they are correct) clib.Cursor_set_flags(wrapper_lib.get_ptr(self), flags) Traceback (most recent call last): File "pyplot.py", line 38, in import matplotlib.pyplot as plt File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/pyplot.py", line 113, in _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/__init__.py", line 60, in pylab_setup [backend_name], 0) File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/backend_wxagg.py", line 12, in from . import backend_wx File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib-2.1.0rc1+110.g963f91300.dirty-py2.7-linux-x86_64.egg/matplotlib/backends/backend_wx.py", line 1818 SyntaxError: return outside function On Wednesday, September 13, 2017, 12:53:16 PM GMT+1, Stuart Axonwrote: Hi all, Is TkInter pypy still a thing ? I was trying some demos from aubio from pypy but they didn't work [1].My first thought was to try and install tkinter-pypy but that doens't seem to exist any more. I'm testing with pypy-nightly trunk on Ubuntu 17.04 64 bit. [1]$ python demo_keyboard.py Traceback (most recent call last): File "demo_keyboard.py", line 60, in import matplotlib.pyplot as plt File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib/pyplot.py", line 115, in _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib/backends/backend_tkagg.py", line 13, in import matplotlib.backends.tkagg as tkagg File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib/backends/tkagg.py", line 9, in from matplotlib.backends import _tkagg RuntimeError: Cannot dlopen tkinter module file S++___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] Tkinter ?
On Sep 16, 2017 4:06 AM, "matti picus"wrote: On Fri, 15 Sep 2017 at 7:51 pm, Armin Rigo wrote: > Hi Stuart, > > On 13 September 2017 at 13:53, Stuart Axon via pypy-dev > wrote: > >Is TkInter pypy still a thing ? > > Yes, ``import Tkinter`` works as expected for me. Maybe it doesn't > work *in matplotlib,* which I'm not sure how to test. Others may know > more about this. > > > A bientôt, > > Armin. None of the GUI backends currently work out of the box with PyPy, see for intance this stack overflow question https://stackoverflow.com/questions/ 43278632/pypy-and-matplotlib-error-in-virtual-enviroment Someone did make progress with matplotlib and wx-cffi https://pythonfiles. wordpress.com/2017/06/28/making-matplotlib-work-with-pypy Might also be worth checking out https://github.com/anntzer/mpl_cairo which is pybind11-based. -n ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] Tkinter ?
On Fri, 15 Sep 2017 at 7:51 pm, Armin Rigowrote: > Hi Stuart, > > On 13 September 2017 at 13:53, Stuart Axon via pypy-dev > wrote: > >Is TkInter pypy still a thing ? > > Yes, ``import Tkinter`` works as expected for me. Maybe it doesn't > work *in matplotlib,* which I'm not sure how to test. Others may know > more about this. > > > A bientôt, > > Armin. None of the GUI backends currently work out of the box with PyPy, see for intance this stack overflow question https://stackoverflow.com/questions/43278632/pypy-and-matplotlib-error-in-virtual-enviroment Someone did make progress with matplotlib and wx-cffi https://pythonfiles.wordpress.com/2017/06/28/making-matplotlib-work-with-pypy The none-gui backends should work, ie ipython inline or Jupyter notebooks. Matti ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] Tkinter ?
Hi Stuart, On 13 September 2017 at 13:53, Stuart Axon via pypy-devwrote: >Is TkInter pypy still a thing ? Yes, ``import Tkinter`` works as expected for me. Maybe it doesn't work *in matplotlib,* which I'm not sure how to test. Others may know more about this. A bientôt, Armin. ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
[pypy-dev] Tkinter ?
Hi all, Is TkInter pypy still a thing ? I was trying some demos from aubio from pypy but they didn't work [1].My first thought was to try and install tkinter-pypy but that doens't seem to exist any more. I'm testing with pypy-nightly trunk on Ubuntu 17.04 64 bit. [1]$ python demo_keyboard.py Traceback (most recent call last): File "demo_keyboard.py", line 60, in import matplotlib.pyplot as plt File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib/pyplot.py", line 115, in _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib/backends/backend_tkagg.py", line 13, in import matplotlib.backends.tkagg as tkagg File "/home/stu/.virtualenvs/pypy-nightly-trunk/site-packages/matplotlib/backends/tkagg.py", line 9, in from matplotlib.backends import _tkagg RuntimeError: Cannot dlopen tkinter module file S++___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] tkinter tests broken
Thanks Armin, 2015-06-23 9:48 GMT+02:00 Armin Rigo ar...@tunes.org: Hi Amaury, On 21 June 2015 at 14:11, Amaury Forgeot d'Arc amaur...@gmail.com wrote: 2015-06-21 12:33 GMT+02:00 Armin Rigo ar...@tunes.org: Can you fix the situation? Thanks! Should be fixed with 6453697f3a30. Thanks for fixing half of the failures :-) However, the other half still remains: http://buildbot.pypy.org/summary/longrepr?testname=unmodifiedbuilder=pypy-c-jit-linux-x86-32build=2730mod=lib-python.2.7.test.test_tcl This is now fixed (with 9fa66d2aa78b): http://buildbot.pypy.org/summary?category=linux32branch=%3Ctrunk%3Erecentrev=78278:9fa66d2aa78b -- Amaury Forgeot d'Arc ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] tkinter tests broken
Hi Armin, 2015-06-21 12:33 GMT+02:00 Armin Rigo ar...@tunes.org: Hi Amaury, In fd331e4bf733 you did an untested change to the tkinter library; as it turns out, the CPython tests find problems: http://buildbot.pypy.org/summary/longrepr?testname=unmodifiedbuilder=pypy-c-jit-linux-x86-32build=2727mod=lib-python.2.7.test.test_tcl Can you fix the situation? Thanks! Actually my changes were trying to fix the test failures in this test_tcl file, since the merge of stdlib-2.7.10. This Tcl_NewWideIntObj function is used probably only in the 32bit case. Should be fixed with 6453697f3a30. -- Amaury Forgeot d'Arc ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
[pypy-dev] tkinter tests broken
Hi Amaury, In fd331e4bf733 you did an untested change to the tkinter library; as it turns out, the CPython tests find problems: http://buildbot.pypy.org/summary/longrepr?testname=unmodifiedbuilder=pypy-c-jit-linux-x86-32build=2727mod=lib-python.2.7.test.test_tcl Can you fix the situation? Thanks! Armin ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] Tkinter-pypy not building on windows
Still no luck. I made sure that i am using the correct version of tcl/tk and tested the compilation of tkinter with python27 and it worked. With pypy, i still have to define WITH_THREAD (it's defined in pyconfig.h for python27 but not in pypy-1.7); I also had to modify the setup.py since i used tcl/tk 8.5 (and the libs do not have the dot in windows : tcl85 and tk85) Now I get missing libs error from the linker : LINK : fatal error LNK1181: cannot open input file 'X11.lib' LINK : fatal error LNK1181: cannot open input file 'python27.lib' if i try to remove X11 from the librairies in setup.py and add a path to python27.lib, i get a lot of unresolved external symbols Thanks Arnaud 2012/1/17 Amaury Forgeot d'Arc amaur...@gmail.com Hi, 2012/1/17 Arnaud F pachalm...@gmail.com When trying to build tkinter from source, i get the following errors : [...] src/_tkinter.c(3133) : error C2065: 'tcl_lock' : undeclared identifier Which version of tcl are you using? Are you sure it was compiled with threads? There is a comment about this at the beginning of _tkinter.c: /* If Tcl is compiled for threads, we must also define TCL_THREAD. We define it always; if Tcl is not threaded, the thread functions in Tcl are empty. */ But compilation with a thread-less TCL is probably not so well supported. -- Amaury Forgeot d'Arc ___ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] Tkinter-pypy not building on windows
2012/1/18 Arnaud F pachalm...@gmail.com Still no luck. I made sure that i am using the correct version of tcl/tk and tested the compilation of tkinter with python27 and it worked. With pypy, i still have to define WITH_THREAD (it's defined in pyconfig.h for python27 but not in pypy-1.7); I also had to modify the setup.py since i used tcl/tk 8.5 (and the libs do not have the dot in windows : tcl85 and tk85) Now I get missing libs error from the linker : LINK : fatal error LNK1181: cannot open input file 'X11.lib' LINK : fatal error LNK1181: cannot open input file 'python27.lib' Well, this is progress! if i try to remove X11 from the librairies in setup.py and add a path to python27.lib, i get a lot of unresolved external symbols How comes that you need the X11 library? didn't you build a dll version of tcl/tk? (tcl85.dll, tk85.dll) Don't use the CPython python27.lib, you should use the one shipped with pypy; it's possible that it is named libpypy.lib instead. Just rename it if needed. -- Amaury Forgeot d'Arc ___ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] Tkinter-pypy not building on windows
The reference to X11.lib comes from the original setup.py. The reference to python27.lib seems to come from distutils (build_ext.py, in the get_libraries method) I didn't find any .lib file in my pypy installation (the standard binaries version 1.7 32bits for windows), just some dlls. Do I need to rebuild pypy from source ? Thanks, Arnaud 2012/1/18 Amaury Forgeot d'Arc amaur...@gmail.com 2012/1/18 Arnaud F pachalm...@gmail.com Still no luck. I made sure that i am using the correct version of tcl/tk and tested the compilation of tkinter with python27 and it worked. With pypy, i still have to define WITH_THREAD (it's defined in pyconfig.h for python27 but not in pypy-1.7); I also had to modify the setup.py since i used tcl/tk 8.5 (and the libs do not have the dot in windows : tcl85 and tk85) Now I get missing libs error from the linker : LINK : fatal error LNK1181: cannot open input file 'X11.lib' LINK : fatal error LNK1181: cannot open input file 'python27.lib' Well, this is progress! if i try to remove X11 from the librairies in setup.py and add a path to python27.lib, i get a lot of unresolved external symbols How comes that you need the X11 library? didn't you build a dll version of tcl/tk? (tcl85.dll, tk85.dll) Don't use the CPython python27.lib, you should use the one shipped with pypy; it's possible that it is named libpypy.lib instead. Just rename it if needed. -- Amaury Forgeot d'Arc ___ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] Tkinter-pypy not building on windows
Hi, 2012/1/17 Arnaud F pachalm...@gmail.com When trying to build tkinter from source, i get the following errors : [...] src/_tkinter.c(3133) : error C2065: 'tcl_lock' : undeclared identifier Which version of tcl are you using? Are you sure it was compiled with threads? There is a comment about this at the beginning of _tkinter.c: /* If Tcl is compiled for threads, we must also define TCL_THREAD. We define it always; if Tcl is not threaded, the thread functions in Tcl are empty. */ But compilation with a thread-less TCL is probably not so well supported. -- Amaury Forgeot d'Arc ___ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev