I'm trying to install a third party python package in a QGIS plugin with the following code:
import sys
import platform
import subprocess
try:
import matplotlib
except ModuleNotFoundError:
print('installing matplotlib')
if platform.system() == 'Windows':
subprocess.call([sys.exec_prefix + '/python', "-m", 'pip', 'install', 'matplotlib'])
else:
subprocess.call(['python3', '-m', 'pip', 'install', 'matplotlib'])
This code snipped have worked previously but with the new(?) OSGeo4W package it fails since the SSL module is not loaded? The error message looks like this:
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/matplotlib/
Is it a bug or some intended change?