Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: Kan geen package installeren in Python virtual environment  (gelezen 4740 keer)

Kan geen package installeren in Python virtual environment
« Gepost op: 2021/07/25, 12:37:54 »
Ik heb python venv (virtual environment) succesvol geinstalleerd.
Maar als ik een package wil installeren (b.v. serial) krijg ik vele warnings en errors. 
o.a.   "Can't connect to HTTPS URL because the SSL module is not available.
en
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available


venv) henkoegema@HPHP2:~/Documents/ArduinoAndPython$ pip install serial
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/serial/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/serial/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/serial/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/serial/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/serial/
Could not fetch URL https://pypi.org/simple/serial/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/serial/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement serial (from versions: none)
ERROR: No matching distribution found for serial
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
(venv) henkoegema@HPHP2:~/Documents/ArduinoAndPython$

Wat gaat er hier fout?
Iets met TLS/SSL ? ...... :(

Miscere utile dulci. (Ter leering ende vermaeck)
http://henk.oegema.com  (On RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  22.04.3 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & Jetson Nano (voor AI & ML)

Re: Kan geen package installeren in Python virtual environment
« Reactie #1 Gepost op: 2021/07/25, 12:49:02 »
Hoe (middels welk commando) is de virtual environment aangemaakt?

Re: Kan geen package installeren in Python virtual environment
« Reactie #2 Gepost op: 2021/07/25, 14:12:09 »
Hoe (middels welk commando) is de virtual environment aangemaakt?
$python3 -m venv ~/Documents/ArduinoAndPython/venv
$source ~/Documents/ArduinoAndPython/venv/bin/activate

Volgde deze  https://www.youtube.com/watch?v=Kg1Yvry_Ydk  instructies.

Miscere utile dulci. (Ter leering ende vermaeck)
http://henk.oegema.com  (On RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  22.04.3 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & Jetson Nano (voor AI & ML)

Re: Kan geen package installeren in Python virtual environment
« Reactie #3 Gepost op: 2021/07/25, 15:48:18 »
Ok, vreemd. Ook geprobeerd (niet in exact dezelfde mappen) hier met zelfde commando's maar installeren van serial werkt gewoon. Wel een andere foutmelding tijdens pip install maar installatie lijkt gelukt.

Misschien is het een tijdelijk probleem met TLS. Probeer anders de virtuele omgeving gewoon eens opnieuw aan te maken? Dus de map venv
helemaal verwijderen en de twee commando's opnieuw draaien.

Toevoeging:
Gebaseerd op dit draadje: https://stackoverflow.com/questions/41328451/ssl-module-in-python-is-not-available-when-installing-package-with-pip3

Je zou de map venv kunnen verwijderen. Het volgende commando draaien (buiten de virtual environment, dus in een shell zonder (venv) voor de prompt) en daarna de venv opnieuw maken:
pip3 install --upgrade pip
« Laatst bewerkt op: 2021/07/25, 16:09:46 door erik1984 »

Re: Kan geen package installeren in Python virtual environment
« Reactie #4 Gepost op: 2021/07/26, 08:56:52 »
Ik dacht slim te zijn door Python3.8 te verwijderen en dan opnieuw te beginnen.  O0
Maar dat was toch niet zo'n slim idee.  :-[

Ben gelijk vele andere programma's kwijt.  (waar onder de terminal)   :evil:

Dit was een harde maar waardevolle les.
« Laatst bewerkt op: 2021/07/26, 08:59:01 door henkoegema »
Miscere utile dulci. (Ter leering ende vermaeck)
http://henk.oegema.com  (On RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  22.04.3 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & Jetson Nano (voor AI & ML)

Re: Kan geen package installeren in Python virtual environment
« Reactie #5 Gepost op: 2021/07/26, 18:56:12 »
Alles weer opnieuw geinstalleerd.
Had (heb) wel een backup van all m'n data.  ^-^

Nu werkt het wel.
Waarom eerder niet is mij nog steeds een raadsel.
Ik heb het op precies dezelfde manier geinstalleerd als eerder.
Omdat m'n probleem is opgelost, sluit ik dit draadje maar.
Miscere utile dulci. (Ter leering ende vermaeck)
http://henk.oegema.com  (On RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  22.04.3 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & Jetson Nano (voor AI & ML)