[MacPorts] #42512: Tkinter not working with macports-installed pypy
#42512: Tkinter not working with macports-installed pypy ------------------------------+-------------------------------- Reporter: macports.org@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Keywords: jmr@macports.org | Port: pypy ------------------------------+-------------------------------- With CPython or a pypy translated from source, {{{$PYTHON -m Tkinter}}} opens a small window with 2 buttons. With macports's pypy, however: {{{
pypy -m Tkinter Traceback (most recent call last): File "app_main.py", line 72, in run_toplevel File "/opt/local/lib/pypy/lib-python/2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/opt/local/lib/pypy/lib-python/2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/opt/local/lib/pypy/lib-python/2.7/lib-tk/Tkinter.py", line 39, in <module> import _tkinter # If this fails your Python may not be configured for Tk File "/opt/local/lib/pypy/lib_pypy/_tkinter/__init__.py", line 13, in <module> from .tklib import tklib, tkffi File "/opt/local/lib/pypy/lib_pypy/_tkinter/tklib.py", line 137, in <module> library_dirs = libdirs File "/opt/local/lib/pypy/lib_pypy/cffi/api.py", line 339, in verify lib = self.verifier.load_library() File "/opt/local/lib/pypy/lib_pypy/cffi/verifier.py", line 73, in load_library self._write_source() File "/opt/local/lib/pypy/lib_pypy/cffi/verifier.py", line 125, in _write_source file = open(self.sourcefilename, 'w') IOError: [Errno 2] No such file or directory: '/opt/local/lib/pypy/lib_pypy/_tkinter/__pycache__/_cffi__g23e32416x3547cfed.c' }}}
Reinstalling pypy does not fix the issue. -- Ticket URL: <https://trac.macports.org/ticket/42512> MacPorts <http://www.macports.org/> Ports system for OS X
#42512: Tkinter not working with macports-installed pypy -----------------------------+------------------- Reporter: macports.org@… | Owner: jmr@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: pypy | -----------------------------+------------------- Changes (by ryandesign@…): * keywords: jmr@macports.org => * owner: macports-tickets@… => jmr@… -- Ticket URL: <https://trac.macports.org/ticket/42512#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#42512: Tkinter not working with macports-installed pypy -----------------------------+------------------- Reporter: macports.org@… | Owner: jmr@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: pypy | -----------------------------+------------------- Comment (by macports.org@…): Note: tried installing from source (`port -s install pypy`), same result. -- Ticket URL: <https://trac.macports.org/ticket/42512#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#42512: Tkinter not working with macports-installed pypy -----------------------------+------------------- Reporter: macports.org@… | Owner: jmr@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: pypy | -----------------------------+------------------- Comment (by jmr@…): Yes, the pypy port does not include tkinter. -- Ticket URL: <https://trac.macports.org/ticket/42512#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#42512: Tkinter not working with macports-installed pypy -----------------------------+------------------- Reporter: macports.org@… | Owner: jmr@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: pypy | -----------------------------+------------------- Comment (by macports.org@…): Is there any specific reason? If it can't be fixed, can it be patched somehow to have `import _tkinter` raise `ImportError` instead of blowing up with `IOError`? My original issue was actually trying to install Pillow whose `setup.py` performs a bunch of checks for available libraries. [https://github.com /python-imaging/Pillow/blob/master/setup.py#L81 The tcl/tk support check it's a fairly common pattern]: {{{ try: import _tkinter except ImportError: _tkinter = None }}} but because this yields an `IOError` the install fails entirely instead of simply marking tkinter as unavailable. -- Ticket URL: <https://trac.macports.org/ticket/42512#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#42512: Tkinter not working with macports-installed pypy -----------------------------+------------------- Reporter: macports.org@… | Owner: jmr@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: pypy | -----------------------------+------------------- Comment (by jmr@…): I don’t know why pypy doesn’t throw an ImportError in this case. I haven’t patched out tkinter support or anything so it’s just behaving in the default manner when the configuration process doesn’t find tk. If you can figure out how to fix the exception I could include a patch, though not necessarily before the next upstream release. Adding tkinter support would be OK too if you know how, though probably in a variant since it does pull in libX11 and dependencies. -- Ticket URL: <https://trac.macports.org/ticket/42512#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts