PyPy + Tkinter...

Probleme bei der Installation?
Antworten
Benutzeravatar
jens
Python-Forum Veteran
Beiträge: 8502
Registriert: Dienstag 10. August 2004, 09:40
Wohnort: duisburg
Kontaktdaten:

PyPy kann nun auch Tkinter: http://morepypy.blogspot.com/2011/04/us ... -pypy.html

Klappt allerdings bei mir erstmal nicht. Also hab ich tcl8.4-dev und tk8.4-dev nachinstalliert. Nun aber kommt der Fehler:
RuntimeError: tk.h version (8.5) doesn't match libtk.a version (8.4)
deinstalliere ich tk-dev (Was tk8.5-dev deinstalliert) kommt:
src/_tkinter.c:75:16: schwerwiegender Fehler: tk.h: Datei oder Verzeichnis nicht gefunden
Also hab ich mal tk* und tcl* deinstalliert und anschließend nur tcl8.4-dev und tk8.4-dev wieder installiert. Dann kommt:
src/_tkinter.c:74:17: schwerwiegender Fehler: tcl.h: Datei oder Verzeichnis nicht gefunden
Hab aber die datei:
/usr/include/tcl8.4/tcl-private/generic/tcl.h
/usr/include/tcl8.4/tcl.h

Weiß jemand weiter? (btw. ist Lubuntu 11.10 64Bit)

GitHub | Open HUB | Xing | Linked in
Bitcoins to: 1JEgSQepxGjdprNedC9tXQWLpS424AL8cd
Benutzeravatar
jens
Python-Forum Veteran
Beiträge: 8502
Registriert: Dienstag 10. August 2004, 09:40
Wohnort: duisburg
Kontaktdaten:

Fehler gefunden. In der setup.py steht libraries=["tk8.4", "tcl8.4", "X11"]

Wenn ich es auf libraries=["tk8.5", "tcl8.5", "X11"] ändere, dann funktioniert es.

Ob auch libraries=["tk", "tcl", "X11"] geht?

GitHub | Open HUB | Xing | Linked in
Bitcoins to: 1JEgSQepxGjdprNedC9tXQWLpS424AL8cd
Dav1d
User
Beiträge: 1437
Registriert: Donnerstag 30. Juli 2009, 12:03
Kontaktdaten:

Ja tut es, ich habe gerade pypy installiert und gleich tkinter hinterher (um den raytracer zu testen) und es funktioniert auch mit "tcl" und "tk".
the more they change the more they stay the same
Benutzeravatar
jens
Python-Forum Veteran
Beiträge: 8502
Registriert: Dienstag 10. August 2004, 09:40
Wohnort: duisburg
Kontaktdaten:

Versuche gerade tkinter für PyPy unter windows zu installieren.

Das geht leider nicht:
D:\pypy-2.1\bin>pip install tkinter-pypy
...
building '_tkinter' extension

error: Unable to find vcvarsall.bat
Versuche mal die Vorschläge von http://stackoverflow.com/questions/3879 ... code-0-2-1

EDIT: Hab mingw32 installiert und das probiert:
D:\pypy-2.1\tkinter-pypy-0.1>..\pypy.exe setup.py install build --compiler=mingw32
Tuts natürlich nicht.

GitHub | Open HUB | Xing | Linked in
Bitcoins to: 1JEgSQepxGjdprNedC9tXQWLpS424AL8cd
Benutzeravatar
jens
Python-Forum Veteran
Beiträge: 8502
Registriert: Dienstag 10. August 2004, 09:40
Wohnort: duisburg
Kontaktdaten:

Hab gerade eine Rückmeldung erhalten:
PyPy version 2.1 contains a cffi-based TkInter module,

which is much faster and easier to maintain.
cffi kannte ich bisher nicht, ist das:
The aim of this project is to provide a convenient and reliable way of calling C code from Python.
http://cffi.readthedocs.org/en/latest/

Im pypy 2.1 archiv ist auch Tk, hier: pypy-2.1\lib-python\2.7\lib-tk
Das importieren endet allerdings in einen Traceback:

Code: Alles auswählen

Python 2.7.3 (480845e6b1dd, Jul 31 2013, 09:10:30)
[PyPy 2.1.0 with MSC v.1500 32 bit] on win32
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``we like complaints''
>>>> import Tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "d:\pypy-2.1\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 "d:\pypy-2.1\lib_pypy\_tkinter\__init__.py", line 13, in <module>
    from .tklib import tklib, tkffi
  File "d:\pypy-2.1\lib_pypy\_tkinter\tklib.py", line 113, in <module>
    libraries=['tcl', 'tk'],
  File "d:\pypy-2.1\lib_pypy\cffi\api.py", line 311, in verify
    lib = self.verifier.load_library()
  File "d:\pypy-2.1\lib_pypy\cffi\verifier.py", line 68, in load_library
    self.compile_module()
  File "d:\pypy-2.1\lib_pypy\cffi\verifier.py", line 56, in compile_module
    self._compile_module()
  File "d:\pypy-2.1\lib_pypy\cffi\verifier.py", line 131, in _compile_module
    outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
  File "d:\pypy-2.1\lib_pypy\cffi\ffiplatform.py", line 25, in compile
    outputfilename = _build(tmpdir, ext)
  File "d:\pypy-2.1\lib_pypy\cffi\ffiplatform.py", line 47, in _build
    dist.run_command('build_ext')
  File "d:\pypy-2.1\lib-python\2.7\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "d:\pypy-2.1\lib-python\2.7\distutils\command\build_ext.py", line 349, in
 run
    self.build_extensions()
  File "d:\pypy-2.1\lib-python\2.7\distutils\command\build_ext.py", line 458, in
 build_extensions
    self.build_extension(ext)
  File "d:\pypy-2.1\lib-python\2.7\distutils\command\build_ext.py", line 508, in
 build_extension
    depends=ext.depends)
  File "d:\pypy-2.1\lib-python\2.7\distutils\msvc9compiler.py", line 473, in com
pile
    self.initialize()
  File "d:\pypy-2.1\lib-python\2.7\distutils\msvc9compiler.py", line 383, in ini
tialize
    vc_env = query_vcvarsall(VERSION, plat_spec)
  File "d:\pypy-2.1\lib-python\2.7\distutils\msvc9compiler.py", line 271, in que
ry_vcvarsall
    raise DistutilsPlatformError("Unable to find vcvarsall.bat")
DistutilsPlatformError: Unable to find vcvarsall.bat
>>>>
Muß ich das Tk-Toolkit für Windows evtl. separat installieren?

GitHub | Open HUB | Xing | Linked in
Bitcoins to: 1JEgSQepxGjdprNedC9tXQWLpS424AL8cd
Benutzeravatar
jens
Python-Forum Veteran
Beiträge: 8502
Registriert: Dienstag 10. August 2004, 09:40
Wohnort: duisburg
Kontaktdaten:

Ist wohl alles nicht so einfach...

Ich hab mal einen Bug Ticket aufgemacht: https://bugs.pypy.org/issue1626

GitHub | Open HUB | Xing | Linked in
Bitcoins to: 1JEgSQepxGjdprNedC9tXQWLpS424AL8cd
Antworten