Hilfe bei PyUSB installation unter Python25

Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Antworten
HarryPython
User
Beiträge: 60
Registriert: Freitag 8. Juni 2007, 07:39

Hi

Ich hab es so lange wie möglich versucht zu vermeiden euch mit einer Installationsfrage zu nerven. Aber nach 2 Tagen hab ich nun die Geduld verloren. Wie zum :twisted: installiert man bitte PyUSB???

Ich habe bisher folgendes getan:

LibUSB installiert (in den Python Ordner)
PyUSB heruntergeladen und entpackt (Dateien in den Python Ordner)

In der Eingabeaufforderung folgendes eingegeben:

Code: Alles auswählen

C:\Programme\Python25>python setup.py build
Mit folgendem Ergebnis:

Code: Alles auswählen

running build
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.
Also hab ich Cygwin und MinGW installiert und nun erneut versucht:

Code: Alles auswählen

C:\Programme\Python25>python setup.py -c mingw32
Ergebnis:

Code: Alles auswählen

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 -c not recognized
Bitte um HILFE. Ich weiß hier so gar nicht mehr weiter. :cry: Oder soll ich jetzt ernsthaft Visual Studio 2003 installieren? :?:
Benutzeravatar
gerold
Python-Forum Veteran
Beiträge: 5555
Registriert: Samstag 28. Februar 2004, 22:04
Wohnort: Oberhofen im Inntal (Tirol)
Kontaktdaten:

HarryPython hat geschrieben: LibUSB installiert (in den Python Ordner)
PyUSB heruntergeladen und entpackt (Dateien in den Python Ordner)
In der Eingabeaufforderung folgendes eingegeben:

Code: Alles auswählen

C:\Programme\Python25>python setup.py build
Hallo HarryPython!

Ich kenne PyUSB nicht, aber so funktioniert es bei den meisten Programmen, die nach einem C-Compiler verlangen.

1.) Entpacke die Dateien **NICHT** in den Python-Ordner. Wo hast du das denn her??? Entpacke die Datein in einen (irgendeinen) leeren Ordner.

2.) Der Befehl zum Kompilieren mit Mingw lautet:

Code: Alles auswählen

C:\Programme\Python25\python setup.py build -c mingw32 install
Aber vorher bitte mit der DOS-Konsole in den Ordner wechseln, in den du die Installationsdateien entpackt hast. (Das ist der Ordner mit dem setup.py.) Achte auf Fehlermeldungen.

mfg
Gerold
:-)
http://halvar.at | Kleiner Bascom AVR Kurs
Wissen hat eine wunderbare Eigenschaft: Es verdoppelt sich, wenn man es teilt.
Benutzeravatar
gerold
Python-Forum Veteran
Beiträge: 5555
Registriert: Samstag 28. Februar 2004, 22:04
Wohnort: Oberhofen im Inntal (Tirol)
Kontaktdaten:

HarryPython hat geschrieben:Also hab ich Cygwin und MinGW installiert und nun erneut versucht
Hallo Harry Python!

Installiere dir lieber MinGW für Windows. Cygwin ist zwar schön, aber nicht ideal für diese Aufgabe.

--> http://www.python-forum.de/topic-7855.html

mfg
Gerold
:-)
http://halvar.at | Kleiner Bascom AVR Kurs
Wissen hat eine wunderbare Eigenschaft: Es verdoppelt sich, wenn man es teilt.
Benutzeravatar
gerold
Python-Forum Veteran
Beiträge: 5555
Registriert: Samstag 28. Februar 2004, 22:04
Wohnort: Oberhofen im Inntal (Tirol)
Kontaktdaten:

:roll:

Code: Alles auswählen

###############################################
Der Versuch, PyUSB unter Windows zu kompilieren
###############################################

(Es war ein nicht erfolgreicher Versuch.)

Wie der Titel schon sagt, versuche ich hier meine Erfahrung mit dem Kompilieren
von PyUSB unter Windows XP niederzuschreiben. Ich weiß an diesem Punkt noch
nicht ob es überhaupt funktionieren wird. Mal sehen... ;-)

Für meinen Versuch lege ich mir einen Arbeitsordner an, in den ich alles rein 
kopiere, was dafür notwendig ist. Das ist bei mir der Ordner *J:\\Ablage\\pyusb**. 
Dieser Ordner kann bei dir natürlich ganz wo anders liegen. Passe aber auf, dass 
du die Pfade an deine Umgebung anpasst.


======
Python
======

Python sollte natürlich bereits installiert sein. Ich gehe davon aus. Bei mir
befindet sich Python 2.5 im Ordner *C:\\Python25*.

Der Python-Ordner *J:\\Python25* ist bei mir im Windows-Pfad enthalten. Deshalb
muss ich in der DOS-Konsole nicht den kompletten Pfad zum Python-Executable 
angeben. Wenn du in der DOS-Konsole einfach mit dem Befehl "python", den 
Python-Interpreter starten kannst, dann musst du den Pfad nicht explizit angeben.
Wenn nicht, dann vergiss nicht, den Pfad zum Python-Executable (bei 
mir *J:\\Python25\\python.exe*) in der DOS-Konsole anzugeben.


======
Cygwin
======

Ich halte mich kurz: Cygwin muss vielleicht nicht installiert werden. Aber es
könnte auch sein, dass während der Installation auf Tools wie z.B. "sed",
"cp" usw. zugegriffen werden muss. Dafür installiere ich immer ein Cygwin 
und füge den Pfad zum Cygwin-bin-Ordner zum Windows-Pfad ganz hinten hinzu.

Systemsteuerung -> System -> Erweitert -> Umgebungsvariablen -> 
*Benutzervariablen -> Path* oder *Systemvariablen -> Path*


=====
MinGW
=====

Zuerst brauchen wir MinGW (http://www.mingw.org/). Und das ist die Erklärung 
was MinGW überhaupt ist:
 
  MinGW: A collection of freely available and freely distributable Windows 
  specific header files and import libraries combined with GNU toolsets 
  that allow one to produce native Windows programs that do not rely on 
  any 3rd-party C runtime DLLs.

Damit können also C- und C++-Programme unter Windows kompiliert werden.

Wie man MinGW installiert, habe ich unter dieser Adresse bereits beschrieben:
http://gelb.bcom.at/trac/misc/wiki/Tutorials/MinGW_installieren


=================
Benötigte Dateien
=================

------------
LibUSB-win32
------------

Die Homepage findest du unter http://libusb-win32.sourceforge.net.
Von diesem Projekt brauchen wir *LibUSB-win32-Filter* und den
*LibUSB-win32-Quellcode*.


~~~~~~~~~~~~~~~~~~~
LibUSB-win32-Filter
~~~~~~~~~~~~~~~~~~~

Zuerst musst du den Filter installieren. Diesen findest du in der 
Sourceforge Download-Seite unter 
http://sourceforge.net/project/showfiles.php?group_id=78138.
Suche nach "libusb-win32-filter-bin-x.x.x.x.exe". Während ich diesen Bericht
schreibe, ist libusb-win32-filter in der Version 0.1.12.1 verfügbar.

Ich speichere die Installationsdatei im Arbeitsordner und führe diese mit
einem Doppelklick aus. Als Installationspfad wird automatisch 
*J:\\Programme\\LibUSB-Win32* ausgewählt. Während der Installation werden meine
USB-Geräte mächtig durchgeschüttelt und ein paar mal neu initialisiert. Das 
dürfte aber normal sein.


~~~~~~~~~~~~~~~~~~~~~~
LibUSB-win32-Quellcode
~~~~~~~~~~~~~~~~~~~~~~

Jetzt ist der Quellcode von LibUSB an der Reihe. Diesen findet man ebenfalls
in der Sourceforge Download-Seite unter
http://sourceforge.net/project/showfiles.php?group_id=78138.
Suche nach "libusb-win32-src-x.x.x.x.tar.gz". Die aktuelle Version während dem
Schreiben dieses Berichtes ist 0.1.12.1.

Den im Archiv enthaltenen Ordner *libusb-win32-src-0.1.12.1* entpacke ich 
ebenfalls in den Arbeitsordner. 

Lies **IMMER** die beigelegte README-Datei!!! Oft finden sich wichtige Details
darin.


-----
PyUSB
-----

PyUSB findest du hier: http://sourceforge.net/project/showfiles.php?group_id=145185
Hole dir einfach die neueste Version (das ist während meines Versuchs 
pyusb-0.4.1.tar.gz) und entpacke den Ordner *pyusb-0.4.1* in den oben angegebene
Arbeitsordner.

Lies **IMMER** die beigelegte README-Datei!!! Oft finden sich wichtige Details
darin.


--------------
Zwischenbilanz
--------------

Bei mir sieht das jetzt so aus::

  J:\
    |- Ablage\
      |- pyusb\
        |- libusb-win32-src-0.1.12.1
        |- pyusb-0.4.1


===========
Kompilieren
===========

Dazu wechsle ich mit der DOS-Konsole in den Ordner *J:\Ablage\pyusb\pyusb-0.4.1*.

Ich habe es mit den verschiedensten Varianten versucht. Am erfolgreichsten
schien mir::

  python setup.py build_ext -c mingw32 -I J:\Ablage\pyusb\libusb-win32-src-0.1.12.1\src

Aber es hat nicht sollen sein...

Er bricht mit diesen Meldungen ab::

  running build_ext
  building 'usb' extension
  J:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall 
    -IJ:\Ablage\pyusb\libusb-win32-src-0.1.12.1\src -IJ:\Python25\include 
    -IJ:\Python25\PC -c pyusb.c -o build\temp.win32-2.5\Release\pyusb.o
  pyusb.c:381: error: initializer element is not constant
  pyusb.c:381: error: (near initialization for `Py_usb_Endpoint_Type.tp_new')
  pyusb.c:514: error: initializer element is not constant
  pyusb.c:514: error: (near initialization for `Py_usb_Interface_Type.tp_new')
  pyusb.c:673: error: initializer element is not constant
  pyusb.c:673: error: (near initialization for `Py_usb_Configuration_Type.tp_new')
  pyusb.c:892: error: initializer element is not constant
  pyusb.c:892: error: (near initialization for `Py_usb_Device_Type.tp_new')
  pyusb.c:1043: error: initializer element is not constant
  pyusb.c:1043: error: (near initialization for `Py_usb_Bus_Type.tp_new')
  pyusb.c: In function `Py_usb_DeviceHandle_detachKernelDriver':
  pyusb.c:1281: warning: unused variable `ret'
  pyusb.c:1282: warning: unused variable `_self'
  pyusb.c: At top level:
  pyusb.c:2013: error: initializer element is not constant
  pyusb.c:2013: error: (near initialization for `Py_usb_DeviceHandle_Type.tp_new')
  error: command 'gcc' failed with exit status 1

Das war's. Weitere Versuche wird es nicht geben.


======
Testen
======

Falls erfolgreich kompiliert wurde.

http://wiki.erazor-zone.de/wiki:projects:python:pyusb:setup:examples:usbenum
mfg
Gerold
:-)
http://halvar.at | Kleiner Bascom AVR Kurs
Wissen hat eine wunderbare Eigenschaft: Es verdoppelt sich, wenn man es teilt.
HarryPython
User
Beiträge: 60
Registriert: Freitag 8. Juni 2007, 07:39

Hi Gerold,

danke mal wieder für die schnelle Antwort. Ich hatte die Dateien auch erst in einem eigenen Ordner aber da kommt dann folgende Fehlermeldung:

Code: Alles auswählen

C:\Dokumente und Einstellungen\Henry\Desktop\pyusb-0.4.1\pyusb0.4.1>python setup.py build
Der Befehl "python" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
daher die Kopie der Dateien in den Ordner selbst.

Hab deine Befehlskette (C:\Programme\Python25>python setup.py build -c mingw32 install) mal in diesem Ordner ausgeführt und dann DAS:

Code: Alles auswählen

pyusb.c:266: error: `USB_ENDPOINT_TYPE_BULK' undeclared (first use in this funct
ion)
pyusb.c:267: error: `USB_ENDPOINT_TYPE_INTERRUPT' undeclared (first use in this
function)
pyusb.c:268: error: `USB_MAXINTERFACES' undeclared (first use in this function)
pyusb.c:269: error: `USB_MAXALTSETTING' undeclared (first use in this function)
pyusb.c:270: error: `USB_MAXCONFIG' undeclared (first use in this function)
pyusb.c:271: error: `USB_REQ_GET_STATUS' undeclared (first use in this function)

pyusb.c:272: error: `USB_REQ_CLEAR_FEATURE' undeclared (first use in this functi
on)
pyusb.c:273: error: `USB_REQ_SET_FEATURE' undeclared (first use in this function
)
pyusb.c:274: error: `USB_REQ_SET_ADDRESS' undeclared (first use in this function
)
pyusb.c:275: error: `USB_REQ_GET_DESCRIPTOR' undeclared (first use in this funct
ion)
pyusb.c:276: error: `USB_REQ_SET_DESCRIPTOR' undeclared (first use in this funct
ion)
pyusb.c:277: error: `USB_REQ_GET_CONFIGURATION' undeclared (first use in this fu
nction)
pyusb.c:278: error: `USB_REQ_SET_CONFIGURATION' undeclared (first use in this fu
nction)
pyusb.c:279: error: `USB_REQ_GET_INTERFACE' undeclared (first use in this functi
on)
pyusb.c:280: error: `USB_REQ_SET_INTERFACE' undeclared (first use in this functi
on)
pyusb.c:281: error: `USB_REQ_SYNCH_FRAME' undeclared (first use in this function
)
pyusb.c:282: error: `USB_TYPE_STANDARD' undeclared (first use in this function)
pyusb.c:283: error: `USB_TYPE_CLASS' undeclared (first use in this function)
pyusb.c:284: error: `USB_TYPE_VENDOR' undeclared (first use in this function)
pyusb.c:285: error: `USB_TYPE_RESERVED' undeclared (first use in this function)
pyusb.c:286: error: `USB_RECIP_DEVICE' undeclared (first use in this function)
pyusb.c:287: error: `USB_RECIP_INTERFACE' undeclared (first use in this function
)
pyusb.c:288: error: `USB_RECIP_ENDPOINT' undeclared (first use in this function)

pyusb.c:289: error: `USB_RECIP_OTHER' undeclared (first use in this function)
pyusb.c:290: error: `USB_ENDPOINT_IN' undeclared (first use in this function)
pyusb.c:291: error: `USB_ENDPOINT_OUT' undeclared (first use in this function)
pyusb.c:292: error: `USB_ERROR_BEGIN' undeclared (first use in this function)
pyusb.c: At top level:
pyusb.c:381: error: initializer element is not constant
pyusb.c:381: error: (near initialization for `Py_usb_Endpoint_Type.tp_new')
pyusb.c:395: warning: "struct usb_endpoint_descriptor" declared inside parameter
 list
pyusb.c:396: error: conflicting types for 'set_Endpoint_fields'
pyusb.h:131: error: previous declaration of 'set_Endpoint_fields' was here
pyusb.c:396: error: conflicting types for 'set_Endpoint_fields'
pyusb.h:131: error: previous declaration of 'set_Endpoint_fields' was here
pyusb.c: In function `set_Endpoint_fields':
pyusb.c:397: error: dereferencing pointer to incomplete type
pyusb.c:398: error: dereferencing pointer to incomplete type
pyusb.c:399: error: dereferencing pointer to incomplete type
pyusb.c:400: error: dereferencing pointer to incomplete type
pyusb.c:401: error: dereferencing pointer to incomplete type
pyusb.c: At top level:
pyusb.c:407: warning: "struct usb_endpoint_descriptor" declared inside parameter
 list
pyusb.c:408: error: conflicting types for 'new_Endpoint'
pyusb.h:135: error: previous declaration of 'new_Endpoint' was here
pyusb.c:408: error: conflicting types for 'new_Endpoint'
pyusb.h:135: error: previous declaration of 'new_Endpoint' was here
pyusb.c:514: error: initializer element is not constant
pyusb.c:514: error: (near initialization for `Py_usb_Interface_Type.tp_new')
pyusb.c:528: warning: "struct usb_interface_descriptor" declared inside paramete
r list
pyusb.c:529: error: conflicting types for 'set_Interface_fields'
pyusb.h:140: error: previous declaration of 'set_Interface_fields' was here
pyusb.c:529: error: conflicting types for 'set_Interface_fields'
pyusb.h:140: error: previous declaration of 'set_Interface_fields' was here
pyusb.c: In function `set_Interface_fields':
pyusb.c:532: error: dereferencing pointer to incomplete type
pyusb.c:533: error: dereferencing pointer to incomplete type
pyusb.c:534: error: dereferencing pointer to incomplete type
pyusb.c:535: error: dereferencing pointer to incomplete type
pyusb.c:536: error: dereferencing pointer to incomplete type
pyusb.c:537: error: dereferencing pointer to incomplete type
pyusb.c:539: error: dereferencing pointer to incomplete type
pyusb.c:545: error: dereferencing pointer to incomplete type
pyusb.c:546: error: dereferencing pointer to incomplete type
pyusb.c: At top level:
pyusb.c:552: warning: "struct usb_interface_descriptor" declared inside paramete
r list
pyusb.c:553: error: conflicting types for 'new_Interface'
pyusb.h:144: error: previous declaration of 'new_Interface' was here
pyusb.c:553: error: conflicting types for 'new_Interface'
pyusb.h:144: error: previous declaration of 'new_Interface' was here
pyusb.c:673: error: initializer element is not constant
pyusb.c:673: error: (near initialization for `Py_usb_Configuration_Type.tp_new')

pyusb.c:687: warning: "struct usb_config_descriptor" declared inside parameter l
ist
pyusb.c:688: error: conflicting types for 'set_Configuration_fields'
pyusb.h:149: error: previous declaration of 'set_Configuration_fields' was here
pyusb.c:688: error: conflicting types for 'set_Configuration_fields'
pyusb.h:149: error: previous declaration of 'set_Configuration_fields' was here
pyusb.c: In function `set_Configuration_fields':
pyusb.c:692: error: dereferencing pointer to incomplete type
pyusb.c:693: error: dereferencing pointer to incomplete type
pyusb.c:694: error: dereferencing pointer to incomplete type
pyusb.c:695: error: dereferencing pointer to incomplete type
pyusb.c:696: error: dereferencing pointer to incomplete type
pyusb.c:697: error: dereferencing pointer to incomplete type
pyusb.c:699: error: dereferencing pointer to incomplete type
pyusb.c:703: error: dereferencing pointer to incomplete type
pyusb.c:704: error: dereferencing pointer to incomplete type
pyusb.c:710: error: dereferencing pointer to incomplete type
pyusb.c: At top level:
pyusb.c:719: warning: "struct usb_config_descriptor" declared inside parameter l
ist
pyusb.c:720: error: conflicting types for 'new_Configuration'
pyusb.h:153: error: previous declaration of 'new_Configuration' was here
pyusb.c:720: error: conflicting types for 'new_Configuration'
pyusb.h:153: error: previous declaration of 'new_Configuration' was here
pyusb.c:892: error: initializer element is not constant
pyusb.c:892: error: (near initialization for `Py_usb_Device_Type.tp_new')
pyusb.c: In function `set_Device_fields':
pyusb.c:908: error: dereferencing pointer to incomplete type
pyusb.c:911: error: dereferencing pointer to incomplete type
pyusb.c:912: error: dereferencing pointer to incomplete type
pyusb.c:914: error: dereferencing pointer to incomplete type
pyusb.c:915: error: dereferencing pointer to incomplete type
pyusb.c:918: error: dereferencing pointer to incomplete type
pyusb.c:919: error: dereferencing pointer to incomplete type
pyusb.c:921: error: dereferencing pointer to incomplete type
pyusb.c:922: error: dereferencing pointer to incomplete type
pyusb.c:925: error: dereferencing pointer to incomplete type
pyusb.c:926: error: dereferencing pointer to incomplete type
pyusb.c:927: error: dereferencing pointer to incomplete type
pyusb.c:928: error: dereferencing pointer to incomplete type
pyusb.c:929: error: dereferencing pointer to incomplete type
pyusb.c:930: error: dereferencing pointer to incomplete type
pyusb.c:931: error: dereferencing pointer to incomplete type
pyusb.c:932: error: dereferencing pointer to incomplete type
pyusb.c:933: error: dereferencing pointer to incomplete type
pyusb.c:934: error: dereferencing pointer to incomplete type
pyusb.c:937: error: dereferencing pointer to incomplete type
pyusb.c:942: error: dereferencing pointer to incomplete type
pyusb.c:946: error: dereferencing pointer to incomplete type
pyusb.c:947: error: dereferencing pointer to incomplete type
pyusb.c: At top level:
pyusb.c:1043: error: initializer element is not constant
pyusb.c:1043: error: (near initialization for `Py_usb_Bus_Type.tp_new')
pyusb.c:1056: warning: "struct usb_bus" declared inside parameter list
pyusb.c:1057: error: conflicting types for 'new_Bus'
pyusb.h:171: error: previous declaration of 'new_Bus' was here
pyusb.c:1057: error: conflicting types for 'new_Bus'
pyusb.h:171: error: previous declaration of 'new_Bus' was here
pyusb.c: In function `new_Bus':
pyusb.c:1065: error: dereferencing pointer to incomplete type
pyusb.c:1066: error: dereferencing pointer to incomplete type
pyusb.c:1067: error: dereferencing pointer to incomplete type
pyusb.c:1067: warning: left-hand operand of comma expression has no effect
pyusb.c:1067: error: dereferencing pointer to incomplete type
pyusb.c:1075: error: dereferencing pointer to incomplete type
pyusb.c:1075: warning: left-hand operand of comma expression has no effect
pyusb.c:1075: error: dereferencing pointer to incomplete type
pyusb.c:1075: warning: left-hand operand of comma expression has no effect
pyusb.c:1067: warning: value computed is not used
pyusb.c:1075: warning: value computed is not used
pyusb.c:1075: warning: value computed is not used
pyusb.c: In function `Py_usb_DeviceHandle_controlMsg':
pyusb.c:1100: error: `_self' undeclared (first use in this function)
pyusb.c:1100: error: syntax error before ')' token
pyusb.c:1174: warning: implicit declaration of function `usb_control_msg'
pyusb.c:1186: warning: implicit declaration of function `usb_strerror'
pyusb.c:1186: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_setConfiguration':
pyusb.c:1206: error: `_self' undeclared (first use in this function)
pyusb.c:1206: error: syntax error before ')' token
pyusb.c:1228: warning: implicit declaration of function `usb_set_configuration'
pyusb.c:1232: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_claimInterface':
pyusb.c:1245: error: `_self' undeclared (first use in this function)
pyusb.c:1245: error: syntax error before ')' token
pyusb.c:1265: warning: implicit declaration of function `usb_claim_interface'
pyusb.c:1266: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_detachKernelDriver':
pyusb.c:1282: error: `_self' undeclared (first use in this function)
pyusb.c:1282: error: syntax error before ')' token
pyusb.c:1281: warning: unused variable `ret'
pyusb.c: In function `Py_usb_DeviceHandle_releaseInterface':
pyusb.c:1321: error: `_self' undeclared (first use in this function)
pyusb.c:1321: error: syntax error before ')' token
pyusb.c:1326: warning: implicit declaration of function `usb_release_interface'
pyusb.c:1330: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_setAltInterface':
pyusb.c:1349: error: `_self' undeclared (first use in this function)
pyusb.c:1349: error: syntax error before ')' token
pyusb.c:1370: warning: implicit declaration of function `usb_set_altinterface'
pyusb.c:1374: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_bulkWrite':
pyusb.c:1393: error: `_self' undeclared (first use in this function)
pyusb.c:1393: error: syntax error before ')' token
pyusb.c:1421: warning: implicit declaration of function `usb_bulk_write'
pyusb.c:1427: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_bulkRead':
pyusb.c:1446: error: `_self' undeclared (first use in this function)
pyusb.c:1446: error: syntax error before ')' token
pyusb.c:1473: warning: implicit declaration of function `usb_bulk_read'
pyusb.c:1478: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_interruptWrite':
pyusb.c:1500: error: `_self' undeclared (first use in this function)
pyusb.c:1500: error: syntax error before ')' token
pyusb.c:1528: warning: implicit declaration of function `usb_interrupt_write'
pyusb.c:1534: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_interruptRead':
pyusb.c:1553: error: `_self' undeclared (first use in this function)
pyusb.c:1553: error: syntax error before ')' token
pyusb.c:1580: warning: implicit declaration of function `usb_interrupt_read'
pyusb.c:1585: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_resetEndpoint':
pyusb.c:1601: error: `_self' undeclared (first use in this function)
pyusb.c:1601: error: syntax error before ')' token
pyusb.c:1615: warning: implicit declaration of function `usb_resetep'
pyusb.c:1619: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_reset':
pyusb.c:1634: warning: implicit declaration of function `usb_reset'
pyusb.c:1634: error: syntax error before ')' token
pyusb.c:1638: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_clearHalt':
pyusb.c:1651: error: `_self' undeclared (first use in this function)
pyusb.c:1651: error: syntax error before ')' token
pyusb.c:1666: warning: implicit declaration of function `usb_clear_halt'
pyusb.c:1670: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_getString':
pyusb.c:1690: error: `_self' undeclared (first use in this function)
pyusb.c:1690: error: syntax error before ')' token
pyusb.c:1720: warning: implicit declaration of function `usb_get_string_simple'
pyusb.c:1722: warning: implicit declaration of function `usb_get_string'
pyusb.c:1729: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_getDescriptor':
pyusb.c:1751: error: `_self' undeclared (first use in this function)
pyusb.c:1751: error: syntax error before ')' token
pyusb.c:1783: warning: implicit declaration of function `usb_get_descriptor'
pyusb.c:1785: warning: implicit declaration of function `usb_get_descriptor_by_e
ndpoint'
pyusb.c:1792: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `Py_usb_DeviceHandle_del':
pyusb.c:1959: error: `_self' undeclared (first use in this function)
pyusb.c:1959: error: syntax error before ')' token
pyusb.c:1968: warning: implicit declaration of function `usb_close'
pyusb.c: At top level:
pyusb.c:2013: error: initializer element is not constant
pyusb.c:2013: error: (near initialization for `Py_usb_DeviceHandle_Type.tp_new')

pyusb.c:2024: error: syntax error before '*' token
pyusb.c:2027: warning: return type defaults to `int'
pyusb.c: In function `new_DeviceHandle':
pyusb.c:2028: error: `dh' undeclared (first use in this function)
pyusb.c:2031: error: syntax error before ')' token
pyusb.c:2034: warning: implicit declaration of function `usb_open'
pyusb.c:2034: warning: assignment makes pointer from integer without a cast
pyusb.c:2037: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c: In function `busses':
pyusb.c:2062: warning: implicit declaration of function `usb_find_busses'
pyusb.c:2063: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c:2067: warning: implicit declaration of function `usb_find_devices'
pyusb.c:2068: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c:2072: warning: implicit declaration of function `usb_get_busses'
pyusb.c:2072: warning: assignment makes pointer from integer without a cast
pyusb.c:2075: warning: passing arg 2 of `PyErr_SetString' makes pointer from int
eger without a cast
pyusb.c:2079: error: dereferencing pointer to incomplete type
pyusb.c:2083: error: dereferencing pointer to incomplete type
pyusb.c:2083: warning: value computed is not used
pyusb.c: In function `initusb':
pyusb.c:2144: warning: implicit declaration of function `usb_init'
pyusb.c: At top level:
pyusb.h:131: warning: 'set_Endpoint_fields' declared `static' but never defined
pyusb.h:135: warning: 'new_Endpoint' declared `static' but never defined
pyusb.h:140: warning: 'set_Interface_fields' declared `static' but never defined

pyusb.h:144: warning: 'new_Interface' declared `static' but never defined
pyusb.h:149: warning: 'set_Configuration_fields' declared `static' but never def
ined
pyusb.h:153: warning: 'new_Configuration' declared `static' but never defined
pyusb.h:171: warning: 'new_Bus' declared `static' but never defined
error: command 'gcc' failed with exit status 1

C:\Programme\Python25>
und was soll ich sagen. Das war noch mehr. Die Konsole konnte nur nicht mehr anzeigen. Ufff :shock:
Na das war wohl nicht sehr erfolgreich. Wenn ich das in einen extra Ordner packen soll wieso kennt er dann python nicht? ich denke da liegt bestimmt das Problem. Die Anweiung an sich scheint ja zu funktionieren.

mfg Harry
Zap
User
Beiträge: 533
Registriert: Freitag 13. Oktober 2006, 10:56

Zu deinem Problem Python von überall zu verwenden:

Du kannst die python.exe nur dann global verwenden wenn Windows weiß wo er suchen soll.
Dazu müsstest du dein Verzeichnis c:\Programme\Python25 in der PATH Valriable deiner Umgebungsvariablen hinzufügen.
( Rechtsklick auf Arbeitsplatz -> Eigenschaften - Erweitert -UmgebungsVariablen)

Ansonsten kannst du natürlich auch das hier machen:

Code: Alles auswählen

C:\Dokumente und Einstellungen\Henry\Desktop\pyusb-0.4.1\pyusb0.4.1>c:\Programme\Python25\python setup.py build ... 
Bei dem anderen Problem kann ich dir leider auch nicht weiterhelfen aber ich würde mal veruschen das ganze nochmal von vorne durchzuspielen.
Nicht das du sogar deine Python installation geschrottet hast indem du gleichnamige dateien überschrieben hast oder so Scherze.
Benutzeravatar
HWK
User
Beiträge: 1295
Registriert: Mittwoch 7. Juni 2006, 20:44

Hier gibt es die fertigen pyd-Dateien: http://sourceforge.net/project/showfile ... _id=542899. Ich habe pyusb-0.3.5.win32.zip für Python 2.4 bei mir installiert. pyusb-0.3.5-py25.zip ist wohl dasselbe für Python 2.5. Anders habe ich es auch nicht hinbekommen.
MfG
HWK
HarryPython
User
Beiträge: 60
Registriert: Freitag 8. Juni 2007, 07:39

Hi.

Danke für eure Antworten. Bin leider erst jetzt dazu gekommen eure Vorschläge zu testen.


@HWK:

Hast recht mit der alten Version geht das ohne Probleme. Nur die .pyd in einen eigenen Ordner entpacken und in den side-packedes Ordner von Python kopiert. Dann unter eclipse -> Preferences -> System PYTHONPATH hinzugefügt. Läuft.
Danke. :D

Schade das es mit der neuen Version nicht so einfach ist.

Da kommt dann jetzt diese Fehlermeldung:

Code: Alles auswählen

C:\Dokumente und Einstellungen\p311851\Desktop\pyusb0.4.0>c:\Python\python setup.py build -c mingw32
running build
running build_ext
building 'usb' extension
gcc -mno-cygwin -mdll -O -Wall -Ic:\Python\include -Ic:\Python\PC -c pyusb.c -o
build\temp.win32-2.5\Release\pyusb.o
error: command 'gcc' failed: No such file or directory

C:\Dokumente und Einstellungen\p311851\Desktop\pyusb-0.4.0>
Fehlt ihm eine Datei von mingw??? Kann das jemand interpretieren?? :?
Benutzeravatar
HWK
User
Beiträge: 1295
Registriert: Mittwoch 7. Juni 2006, 20:44

Wahrscheinlich steht ...\mingw\bin nicht im path.
MfG
HWK
minderbinder
User
Beiträge: 1
Registriert: Montag 27. Oktober 2008, 13:15

Hallo an Alle erstmal, das ist mein erster Post hier und auch die ganze händische Installiererei ist mir noch vollkommen fremd - ich würde Euch nicht damit nerven, aber ich komme einfach nicht mehr weiter:

Ich habe, meiner Meinung nach, alles nach Anweisung (z.B. http://web.media.mit.edu/~dmerrill/sens ... howto.html) erledigt, aber ich kriege auf ein testweises

help ('usb')

lediglich die Meldung

'Die Ordnungszahl 76 wurde in der DLL "libusb0.dll" nicht gefunden.'

Kann sich darauf jemand einen Reim machen?

Tausend Dank im Voraus,

Grüße

mb
Antworten