2017-12-28 2 views
0

Ich versuche, Wireless-radar mit dem Befehl sudo pip install wireless-radar zu installieren. Ich habe den Befehl mehrmals versucht und ich habe immer den gleichen Fehler bekommen.Python-Fehler beim Installieren des Pakets

Was mache ich falsch und was soll ich tun, um es zu beheben?

ich ein MacBook Pro 2015 läuft MacOS 10.13.1

Die Version von Python bin mit, dass ich verwende ist 2.7.10

die komplette Ausgabe für den Befehl ist. Dies gewährt Administratorrechte, um das Modul zu installieren

Requirement already satisfied: wireless-radar in /Library/Python/2.7/site-packages/wireless_radar-0.2.2-py2.7.egg 
Collecting scapy (from wireless-radar) 
    Using cached scapy-2.3.3.tgz 
Collecting netaddr (from wireless-radar) 
    Downloading netaddr-0.7.19-py2.py3-none-any.whl (1.6MB) 
    100% |████████████████████████████████| 1.6MB 482kB/s 
Collecting python_wifi>=0.5.0 (from wireless-radar) 
    Downloading python-wifi-0.6.1.tar.bz2 (73kB) 
    100% |████████████████████████████████| 81kB 1.3MB/s 
Collecting pybluez (from wireless-radar) 
    Downloading PyBluez-0.22.zip (109kB) 
    100% |████████████████████████████████| 112kB 45kB/s 
Building wheels for collected packages: scapy, python-wifi, pybluez 
    Running setup.py bdist_wheel for scapy ... done 
    Stored in directory: /Users/matthew/Library/Caches/pip/wheels/bd/cf/05/d5abc9b4434f39ffe231517dfb8dab96241fef6a99459051f9 
    Running setup.py bdist_wheel for python-wifi ... done 
    Stored in directory: /Users/matthew/Library/Caches/pip/wheels/3c/e1/4c/7bf310130cf8817e31716e49146f738410c929ff1952af3081 
    Running setup.py bdist_wheel for pybluez ... error 
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/6d/7_lbk_0n6253nqmdsvdbnz600000gn/T/pip-build-gobwaR/pybluez/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/6d/7_lbk_0n6253nqmdsvdbnz600000gn/T/tmpnl9CZ5pip-wheel- --python-tag cp27: 
    running bdist_wheel 
    running build 
    running build_py 
    creating build 
    creating build/lib.macosx-10.13-intel-2.7 
    creating build/lib.macosx-10.13-intel-2.7/bluetooth 
    copying bluetooth/btcommon.py -> build/lib.macosx-10.13-intel-2.7/bluetooth 
    copying bluetooth/ble.py -> build/lib.macosx-10.13-intel-2.7/bluetooth 
    copying bluetooth/__init__.py -> build/lib.macosx-10.13-intel-2.7/bluetooth 
    copying bluetooth/bluez.py -> build/lib.macosx-10.13-intel-2.7/bluetooth 
    copying bluetooth/msbt.py -> build/lib.macosx-10.13-intel-2.7/bluetooth 
    copying bluetooth/widcomm.py -> build/lib.macosx-10.13-intel-2.7/bluetooth 
    copying bluetooth/osx.py -> build/lib.macosx-10.13-intel-2.7/bluetooth 
    running build_ext 
    building 'bluetooth._osxbt' extension 
    creating build/temp.macosx-10.13-intel-2.7 
    creating build/temp.macosx-10.13-intel-2.7/osx 
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/IOBluetooth.framework/Headers -I/System/Library/Frameworks/CoreFoundation.framework/Headers -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c osx/_osxbt.c -o build/temp.macosx-10.13-intel-2.7/osx/_osxbt.o 
    osx/_osxbt.c:676:5: error: unknown type name 'IOBluetoothDeviceInquiryRef'; did you mean 'IOBluetoothDeviceRef'? 
     IOBluetoothDeviceInquiryRef inquiry; 
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     IOBluetoothDeviceRef 
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47: note: 'IOBluetoothDeviceRef' declared here 
    typedef struct OpaqueIOBluetoothObjectRef *      IOBluetoothDeviceRef; 
                   ^
    osx/_osxbt.c:688:17: error: unknown type name 'IOBluetoothDeviceInquiryRef'; did you mean 'IOBluetoothDeviceRef'? 
        IOBluetoothDeviceInquiryRef inquiryRef, 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 
        IOBluetoothDeviceRef 
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47: note: 'IOBluetoothDeviceRef' declared here 
    typedef struct OpaqueIOBluetoothObjectRef *      IOBluetoothDeviceRef; 
                   ^
    osx/_osxbt.c:703:19: warning: implicit declaration of function 'IOBluetoothDeviceInquiryCreateWithCallbackRefCon' is invalid in C99 [-Wimplicit-function-declaration] 
     dd->inquiry = IOBluetoothDeviceInquiryCreateWithCallbackRefCon (&dd); 
        ^
    osx/_osxbt.c:703:19: warning: this function declaration is not a prototype [-Wstrict-prototypes] 
    osx/_osxbt.c:703:17: warning: incompatible integer to pointer conversion assigning to 'IOBluetoothDeviceRef' (aka 'struct OpaqueIOBluetoothObjectRef *') from 'int' [-Wint-conversion] 
     dd->inquiry = IOBluetoothDeviceInquiryCreateWithCallbackRefCon (&dd); 
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    osx/_osxbt.c:705:5: warning: implicit declaration of function 'IOBluetoothDeviceInquirySetCompleteCallback' is invalid in C99 [-Wimplicit-function-declaration] 
     IOBluetoothDeviceInquirySetCompleteCallback (dd->inquiry, 
    ^
    osx/_osxbt.c:705:5: warning: this function declaration is not a prototype [-Wstrict-prototypes] 
    osx/_osxbt.c:717:5: warning: implicit declaration of function 'IOBluetoothDeviceInquiryStart' is invalid in C99 [-Wimplicit-function-declaration] 
     IOBluetoothDeviceInquiryStart (dd->inquiry); 
    ^
    osx/_osxbt.c:717:5: warning: this function declaration is not a prototype [-Wstrict-prototypes] 
    osx/_osxbt.c:721:5: warning: implicit declaration of function 'IOBluetoothDeviceInquiryDelete' is invalid in C99 [-Wimplicit-function-declaration] 
     IOBluetoothDeviceInquiryDelete (dd->inquiry); 
    ^
    osx/_osxbt.c:721:5: warning: this function declaration is not a prototype [-Wstrict-prototypes] 
    9 warnings and 2 errors generated. 
    error: command 'cc' failed with exit status 1 

    ---------------------------------------- 
    Failed building wheel for pybluez 
    Running setup.py clean for pybluez 
Successfully built scapy python-wifi 
Failed to build pybluez 
Installing collected packages: scapy, netaddr, python-wifi, pybluez 
Exception: 
Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run 
    prefix=options.prefix_path, 
    File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install 
    **kwargs 
    File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install 
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix) 
    File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files 
    isolated=self.isolated, 
    File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files 
    clobber(source, lib_dir, True) 
    File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 316, in clobber 
    ensure_dir(destdir) 
    File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 83, in ensure_dir 
    os.makedirs(path) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs 
    mkdir(name, mode) 
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/scapy-2.3.3.dist-info' 
+0

sagt ziemlich deutlich eine Genehmigung verweigert Fehler haben. Entweder hat etwas diese Datei gesperrt oder Sie benötigen erhöhte Rechte. Ich benutze keine Macs, aber sie haben ein Terminal-System oder? Wenn Sie ein Terminal öffnen und zu dem Verzeichnis navigieren können, können Sie möglicherweise die Berechtigung des Verzeichnisses ändern. Meine Vermutung wäre vielleicht, dass du etwas anderes installiert hast, das das gleiche installiert hat, aber du hast es als Admin oder etwas Dummes getan. – FredMan

+0

@FredMan Sudo am Anfang hinzufügen sollte Root-Berechtigungen geben, damit ich nicht verstehe, warum es mir eine Erlaubnis verweigert Fehler gibt. –

+0

Ich bin kein Pip-Master, aber Sudo und Pip mischen sich nicht gut. Es gibt ein Kaninchenloch, das du untergehen kannst, aber du kannst versuchen, was brian hier im ersten Kommentar beschreibt: https://stackoverflow.com/questions/15028648/is-it-acceptable-and-safe-to-run-pip- install-under-sudo cd/tmp; sudo pip install foo Der Anspruch, den jemand gemacht hat, ist, dass pip versucht, einen Schreibvorgang an einige Orte als ein anderer Benutzer als derjenige durchzuführen, der den Befehl an erster Stelle aufgerufen hat und somit keine Berechtigung zum Schreiben in die Datei hat weil Sudo-Privilegien es blockiert haben. Mit tmp, einem Ordner, in den alle Personen schreiben, wird es umgangen – FredMan

Antwort

0

Verwenden sudo pip3 install wireless-radar statt „Pip“, wenn Sie Mac OS X verwenden.

+0

OP verwendet Python 2.7., pip3 ist für Python 3 – ShpielMeister

0

gibt es mehrere vorherigen Qs auf SO über den Fehler, den Sie

angetroffen

Failed to build pybluez and cc -fno-strict-aliasing -fno-common - ...... osx/_osxbt.c:676:5: error: unknown type name 'IOBluetoothDeviceInquiryRef'; did you mean 'IOBluetoothDeviceRef'? IOBluetoothDeviceInquiryRef

pybluez installation errors on Mac OS

pybluez repo sehen. insbesondere Note

Mac OS X (Unstable - tested only on OS X 10.10/10.11):

pybluez installation errors on Mac OS

+0

Ihr stackoverflow Link ist mit etwas anderem als Stack-Überlauf verknüpfen, meinst du das zu tun oder war es ein Fehler beim Einrichten der Link zum pybluez Repo? – FredMan

+0

der Text war korrekt. Ich habe den Link repariert. suche SO nach pybluez und du wirst andere finden. Viel Glück beim Recherchieren – ShpielMeister

Verwandte Themen