SSL-Paket kann nicht installiert werden. Kann mir jemand das Problem erklären?
Servus alle zusammen.
Ich habe mal wieder eins der unnötigsten Probleme die man so gar nicht gebrauchen kann.
Vorab: Ich verwende PyCharm CommunityEdit2023
Folgende Problematik stellt sich mir:Ich versuche über den PyCharm Interpreter das Paket ssl zu laden und erhalte:
Collecting ssl
Using cached ssl-1.16.tar.gz (33 kB)
Using cached ssl-1.15.tar.gz (32 kB)
ERROR: Command errored out with exit status 1:
command: 'D:\Python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Paddy\\AppData\\Local\\Temp\\pip-install-6xunn48y\\ssl_93be5a3dfd464eefb55e12eacc1c7aae\\setup.py'"'"'; __file__='"'"'C:\\Users\\Paddy\\AppData\\Local\\Temp\\pip-install-6xunn48y\\ssl_93be5a3dfd464eefb55e12eacc1c7aae\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Paddy\AppData\Local\Temp\pip-pip-egg-info-xz6xi0b2'
cwd: C:\Users\Paddy\AppData\Local\Temp\pip-install-6xunn48y\ssl_93be5a3dfd464eefb55e12eacc1c7aae\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Paddy\AppData\Local\Temp\pip-install-6xunn48y\ssl_93be5a3dfd464eefb55e12eacc1c7aae\setup.py", line 33
print 'looking for', f
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/83/21/f469c9923235f8c36d5fd5334ed11e2681abad7e0032c5aba964dcaf9bbb/ssl-1.16.tar.gz#sha256=ac21156fee6aee9eb8d765bbb16f5f49492d81ff4b22f7b8fc001d2251120930 (from https://pypi.org/simple/ssl/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1:
command: 'D:\Python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Paddy\\AppData\\Local\\Temp\\pip-install-6xunn48y\\ssl_0d4afefa00504f218b834c3475a8235c\\setup.py'"'"'; __file__='"'"'C:\\Users\\Paddy\\AppData\\Local\\Temp\\pip-install-6xunn48y\\ssl_0d4afefa00504f218b834c3475a8235c\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Paddy\AppData\Local\Temp\pip-pip-egg-info-2f8p2rk1'
cwd: C:\Users\Paddy\AppData\Local\Temp\pip-install-6xunn48y\ssl_0d4afefa00504f218b834c3475a8235c\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Paddy\AppData\Local\Temp\pip-install-6xunn48y\ssl_0d4afefa00504f218b834c3475a8235c\setup.py", line 74
print 'looking for', f
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3a/c2/846a19d1572ec6cb8ac438d58a898de8926d32e13f0355cdf4ab00864b5f/ssl-1.15.tar.gz#sha256=1266302ce62c4b60c7ca0e1d3d104ba11d2749e5881d8ac4f006cf9a0446d589 (from https://pypi.org/simple/ssl/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement ssl (from versions: 1.15, 1.16)
ERROR: No matching distribution found for ssl
WARNING: You are using pip version 21.1.3; however, version 24.0 is available.
You should consider upgrading via the 'D:\Python\python.exe -m pip install --upgrade pip' command.
Via cmd erhalte ich die gleiche Meldung.
Ich habe alle Python-Versionen schon deinstalliert, System neu gestartet und wieder installiert. Das gleiche habe ich auch mit pip probiert.
Kann mir hier vielleicht jemand weiterhelfen?
Vielen Dank und liebe Grüße im Voraus! :)
2 Antworten
Welche Python-Version nutzt Du?
Der Syntaxfehler deutet für mich darauf hin, daß Du Python3 nutzt, aber ein Paket, das für Python2 ist, zu installieren versuchst.
Randnotizen:
- Python besitzt ein SSL-Modul als Teil der Standardbibliotherk.
- Das Paket aus dem Installationsversuch ist für Python 2.3/2.5, 2.5 ist sit mindestens 15 Jahren veraltet. Es unterstützt im Zweifelsfall die heute notwendigen TLS-Standards nicht.
- Falls Du das Standardmodul das die SSL-Bibliothek wrapped nicht nutzen willst, so kannst Du je nach Anwendungsfall zu dingen wie cryptography, M2Crypto udn diversen anderen Paketen greifen.
Erst mal hast du da einen Syntaxfehler in Zeile 33 von setup.py
Abgesehen davon könnte es daran liegen dass die Paketabhängigkeiten nicht erfüllt werden. Du kannst einmal versuchen alle Pakete zu deinstallieren und wieder zu installieren. Nutzt du eine requirements.txt Date? Da könnte da Problem liegen. Wie importierst du die SSL Bilbiothek?
Danke für deine schnelle Antwort!
Den Syntaxfehler habe ich auch gesehen, kann ich mir aber nicht erklären, da nie etwas verändert wurde. Auch nicht in irgendwelch Configs.
Nutzt du eine requirements.txt Date? Wie finde ich das heraus?
Kannst du mir evtl. auf die Schnelle erklären wie ich sämtliche pip-Pakete deinstalliere? Finde die pip-Docs nicht gerade übersichtlich.
Die SSL-Bibliothek habe ich einmal direkt via Pycharm Interpreter zu installieren. Also File>Settings>Projekt>Pyton Interpreter> Auf das + Klicken> ssl suchen und dann installieren.
Im Programm selbst wird es standardmäßig importiert via imports ssl, kann allerdings nicht gefunden werden.
Ich habe eben festgestellt, dass dieses Problem mit mehreren Paketen besteht.