Python Python Import Error from urllib2 import ssl - not found

Falc410

Vice Admiral
Registriert
Juni 2006
Beiträge
6.400
Ich hab hier eine IBM Maschine die mit Red Hat läuft und ein Script von IBMs github heruntergeladen aber irgend etwas ist mit der Python installation kaputt. In ihrem Script werden mehrere Module von urllib2 importiert. Es funktionieren alle (wie urlopen etc.) bis auf ssl. Auf meinem Mac geht es ohne Probleme.
Mit pip kann ich urllib2 nicht installieren und google hat mir auch nicht geholfen. Hat jemand eine Idee woran es liegen könnte? Vielleicht einfach weil Python 2.6.6 zu alt ist oder kann ich mit yum irgend etwas nach installieren?

Es handelt sich um dieses Script hier:
https://github.com/ibm-security-intelligence/data-import/blob/master/assets/update_assets.py

Hier mal ein Test:
Code:
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib2 import ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name ssl
>>> from urllib2 import urlopen
>>> quit()

Und hier mal zum Vergleich:
Code:
Python 2.7.9 (default, Jan  7 2015, 11:49:12) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib2 import ssl
>>> quit()
 
Das sollte eigentlich drauf sein, außer falls es ersetzt worden ist wegen Security Update. Danke das prüfe ich mal.
 

Ähnliche Themen

Zurück
Oben