pip not available to plugins
georgeboot opened this issue · comments
First of all: amazing work here!
I am trying to open a plugin that tries to install a package via pip (websockets).
It fails and results in the following error message:
Traceback (most recent call last):
File "/Users/george/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/orbit3dmapping/orbit_3dmapping.py", line 262, in doOpenPlugin
process = subprocess.Popen(["pip","install","websockets"], cwd=pluginDir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Applications/QGIS.app/Contents/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1022, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Applications/QGIS.app/Contents/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1899, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pip'
Oops. QGIS stores Python packages in Resources
outside the Python framework, and I bundled all the packages in Resources
for uniformity and didn't realize this might be problematic. Python also falls back to my local installation so the problem doesn't show up for me.
I repackaged a 3.28.1_1
which should fix this. After a bit of testing, sometimes pip
can't use TLS but python
apparently can. I'll figure this out for the next point release.