Hallo,
Wer kann mir helfen beim kompilieren von Python Modulen, bzw. ein How-To nennen mit dem ich unter Windows kompilieren kann. Habe beispielsweise versucht unter WinXP MySQL-python und das Twisted versucht zu kompilieren ohne grossen erfolg da ich immer nur gesagt bekomme dass Python selbst mit Microsoft Visual C++ 2003 kompiliert ist und ich deshalb kein MinGW oder Cygwin nutzen kann. Ich bin mir aber fast sicher dass es eine Möglichkeit gibt!?
Danke im Voraus für Feedback,
tinti
Kompilieren von Modulen
wieso willst du denn ein modul kompilieren?
http://www.cs.unm.edu/~dlchao/flake/doom/
-
- Python-Forum Veteran
- Beiträge: 16025
- Registriert: Freitag 20. Juni 2003, 16:30
- Kontaktdaten:
Hallo tinti, willkommen im Forum!
Schon geschehen.tinti hat geschrieben:Wer kann mir helfen beim kompilieren von Python Modulen, bzw. ein How-To nennen mit dem ich unter Windows kompilieren kann.
Das sollte möglich sein, im fall von MySQL brauchst du aber noch die MySQL-Header und Libs, Twisted sollte keine weiteren Abhängigkeiten haben.tinti hat geschrieben:Habe beispielsweise versucht unter WinXP MySQL-python und das Twisted versucht zu kompilieren ohne grossen erfolg da ich immer nur gesagt bekomme dass Python selbst mit Microsoft Visual C++ 2003 kompiliert ist und ich deshalb kein MinGW oder Cygwin nutzen kann.
My god, it's full of CARs! | Leonidasvoice vs (former) Modvoice
entschuldigung, habe vergessen, dass diese module nicht teil der stdlib sind...
(mysql ist aber bei ubuntu standardgemäß dabei, twisted hielt ich für pure python...)
(mysql ist aber bei ubuntu standardgemäß dabei, twisted hielt ich für pure python...)
http://www.cs.unm.edu/~dlchao/flake/doom/
So habe bereits Zeit gefunden mich mit dem Thema zu beschäftigen leider ohne grosse Erfolge. Folgende aktionen habe ich gemacht:
- D:\Python25>pexports python25.dll > python25.def
D:\Python25>dlltool --dllname python25.dll --def python25.def --output-lib libpython25.a
D:\Python25>copy libpython25.a libs
1 file(s) copied.
D:\Python25>cd ..\Twisted-2.4.0\ZopeInterface-3.1.0c1
D:\Twisted-2.4.0\ZopeInterface-3.1.0c1>python setup.py build -c mingw32
running build
running build_py
running build_ext
D:\Twisted-2.4.0\ZopeInterface-3.1.0c1>python setup.py install
running install
running build
running build_py
running build_ext
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
D:\Twisted-2.4.0\ZopeInterface-3.1.0c1>python setup.py install -c mingw32
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'mingw32'
D:\Twisted-2.4.0\ZopeInterface-3.1.0c1>python setup.py install -cmingw32
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option -m not recognized
-
- Python-Forum Veteran
- Beiträge: 16025
- Registriert: Freitag 20. Juni 2003, 16:30
- Kontaktdaten:
Am besten du schreibst dir eine setup.cfg (im gleichen Ordner wie die setup.py) mit folgendem Inhalt:
Und dann rufst du die Distutils mit python setup.py bdist_wininst auf (oder wenn du ein Egg haben willst dann bdist_egg).
Code: Alles auswählen
[build_ext]
compiler=mingw32
My god, it's full of CARs! | Leonidasvoice vs (former) Modvoice