ipm icon indicating copy to clipboard operation
ipm copied to clipboard

enhance: allow specifying pip/pip3 path

Open isc-shuliu opened this issue 1 year ago • 5 comments

Allow specifying path to pip or pip3 for installation of requirements.txt.

On many Unix systems, pip command is a symlink to pip3 located somewhere on $PATH. In some cases, pip can be nonexistent and there's only pip3.

With this PR, users can specify path to pip/pip3 by running config set PipPath xxxx in zpm. Otherwise, the default location is wherever pip3 first appears on $PATH. This allows for maximum compatibility.

isc-shuliu avatar Jul 30 '24 18:07 isc-shuliu

@isc-shuliu the docs seem to indicate that python -m is right for 2024.2+ but irispip is to be used for Windows on 2024.1 and earlier. Done right this would also fix #540.

isc-tleavitt avatar Aug 01 '24 17:08 isc-tleavitt

CI failures are because the 2023.2 built-in license expired. We should cut that from CI.

isc-tleavitt avatar Aug 01 '24 17:08 isc-tleavitt

For 2024.2 / flexible python runtime I think the python executable should be located based on PythonRuntimeLibrary - gave this a try without it (and with WSGIApplication ported to v1, which we still need to do) and I'm running into issues because of different python versions being in play.

For <=2024.1 and Windows specifically, I think we need to stick with irispip to get things right.

@isc-tleavitt What is PythonRuntimeLibrary? Is it a $System function or something else?

isc-shuliu avatar Aug 01 '24 19:08 isc-shuliu

@isc-tleavitt I made the changes to check for <IRIS-ROOT>/bin/irispip.exe first. If found, it will use that on windows. For 2024.2+, where irispip.exe doesn't exist, we proceed to check for python3.exe -m pip and python.exe -m pip.

For Unix, we still use python3 -m pip and python -m pip, whichever found first.

Does that make sense?

isc-shuliu avatar Aug 01 '24 19:08 isc-shuliu

@isc-shuliu thanks - that's progress.

The problem is that we're finding python3/python based on the path, and it's possible if not likely that there would be multiple versions installed. It looks like, from some basic experimentation, if we pip install with the wrong version things end up broken. You know Python way better than I do - does this sound right? (looks like related to having the wrong cpython stuff)

Re: PythonRuntimeLibrary, see: https://docs.intersystems.com/iris20242/csp/docbook/Doc.View.cls?KEY=RACS_PythonRuntimeLibrary - this is new to 2024.2

isc-tleavitt avatar Aug 01 '24 20:08 isc-tleavitt

This should also fix #546

isc-shuliu avatar Aug 19 '24 20:08 isc-shuliu