Library installieren

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
bertibott
User
Beiträge: 2
Registriert: Montag 9. Februar 2015, 21:42

Hallo,

ich würde gerne eine Bibliothek für Pyhton installieren. Um genau zu sein "pypcap" um Netzwerkpakete mitzuschneiden. Fernziel ist es auch etwas mit diesen Paketen anfangen zu können... aber so weit sind wir noch nicht.

Denn es scheitert bisher bei der Installation der Bibliothek.

Ich habe die Bibliothek als .tar.gz herunter geladen (ja, ich nutze Linux) und entpackt. Die ReadMe sagt ich sollte einfach die Zeilen:

Code: Alles auswählen

    easy_install pypcap
    pip install pypcap
ausführen.

Das führt aber icht zum gewünschten Ergebnis.

Code: Alles auswählen

sudo easy_install pypcap
Searching for pypcap                                                                                                                                                                                                                                                           
Reading https://pypi.python.org/simple/pypcap/                                                                                                                                                                                                                                 
Best match: pypcap 1.1.1                                                                                                                                                                                                                                                       
Downloading https://pypi.python.org/packages/source/p/pypcap/pypcap-1.1.1.tar.gz#md5=d32f422feba022dad219edb1e7de0366                                                                                                                                                          
Processing pypcap-1.1.1.tar.gz                                                                                                                                                                                                                                                 
Writing /tmp/easy_install-Bn50le/pypcap-1.1.1/setup.cfg                                                                                                                                                                                                                        
Running pypcap-1.1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Bn50le/pypcap-1.1.1/egg-dist-tmp-4ehCLw
Found pcap headers in /usr/src/linux-headers-3.13.0-43-generic/include/config/ezx/pcap.h
Found libraries in None
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 9, in <module>
    load_entry_point('setuptools==3.3', 'console_scripts', 'easy_install')()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1963, in main
    with_ei_usage(lambda:
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1950, in with_ei_usage
    return f()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1967, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 381, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 616, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 646, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 834, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1025, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 50, in run_setup
    lambda: execfile(
  File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 100, in run
    return func()
  File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 52, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 61, in <module>
    lib_file = os.path.basename(lib_file_path)
  File "/usr/lib/python2.7/posixpath.py", line 121, in basename
    i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'
und danach

Code: Alles auswählen

sudo pip install pypcap
Downloading/unpacking pypcap
  Downloading pypcap-1.1.1.tar.gz (44kB): 44kB downloaded
  Running setup.py (path:/tmp/pip_build_root/pypcap/setup.py) egg_info for package pypcap
    Found pcap headers in /usr/src/linux-headers-3.13.0-43-generic/include/config/ezx/pcap.h
    Found libraries in None
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/pypcap/setup.py", line 61, in <module>
        lib_file = os.path.basename(lib_file_path)
      File "/usr/lib/python2.7/posixpath.py", line 121, in basename
        i = p.rfind('/') + 1
    AttributeError: 'NoneType' object has no attribute 'rfind'
    Complete output from command python setup.py egg_info:
    Found pcap headers in /usr/src/linux-headers-3.13.0-43-generic/include/config/ezx/pcap.h

Found libraries in None

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/pypcap/setup.py", line 61, in <module>

    lib_file = os.path.basename(lib_file_path)

  File "/usr/lib/python2.7/posixpath.py", line 121, in basename

    i = p.rfind('/') + 1

AttributeError: 'NoneType' object has no attribute 'rfind'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pypcap
Storing debug log for failure in /home/berti/.pip/pip.log
Ich habe nach dem Problem gesucht... in der Python-Doku scheint der Fall, dass es nicht funktioniert, nicht vorgesehen zu sein.

Das einzige was ich daraus deuten kann, ist das vermutlich irgendwas fehlt...


Kann mir irgendhjemand weiterhelfen?

Ich sollte vielleicht noch anmerken, dass ich absoluter Neuling bin. Ich habe noch nie mit Python gearbeitet und das letze mal dass ich überhaupt was programmiert habe ist shcon ne ganze Weile her... für Python habe ich mich in diesem Fall entschieden, weil man ja angeblich so schnell einen Prototypen bekommt.... :(
Zuletzt geändert von bertibott am Montag 9. Februar 2015, 21:59, insgesamt 1-mal geändert.
EyDu
User
Beiträge: 4881
Registriert: Donnerstag 20. Juli 2006, 23:06
Wohnort: Berlin

Hallo und willkommen im Forum!

Hast du mal im Paketmanger deiner Distribution nachgeschaut? Unter Debian gibt es zum Beispiel das Paket python-pcapy.
Das Leben ist wie ein Tennisball.
bertibott
User
Beiträge: 2
Registriert: Montag 9. Februar 2015, 21:42

mhmh... ein ganz anderer Weg also....
naja... das hat funktioniert! dann kann ich mcih ja meinem eigentlichen Problem zuwenden...

Danke!
Antworten