Ondersteuning > Programmeren

Kan geen package installeren in Python virtual environment

(1/2) > >>

henkoegema:
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



--- Code: ---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$

--- Einde van code ---

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

erik1984:
Hoe (middels welk commando) is de virtual environment aangemaakt?

henkoegema:

--- Citaat van: erik1984 op 2021/07/25, 12:49:02 ---Hoe (middels welk commando) is de virtual environment aangemaakt?

--- Einde van citaat ---

--- Code: ---$python3 -m venv ~/Documents/ArduinoAndPython/venv
$source ~/Documents/ArduinoAndPython/venv/bin/activate

--- Einde van code ---

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

erik1984:
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:

--- Code: ---pip3 install --upgrade pip
--- Einde van code ---

henkoegema:
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.

Navigatie

[0] Berichtenindex

[#] Volgende pagina

Naar de volledige versie