Install python packages from local file directory?Hi all,
I got asked if it is possible to install python packages into the contained JMP Python installation from a local file directory and not from the net.
The jpip command seems to download the packages like the python pip command from web sources. Is there another way I might have missed?
My customer wants to avoid discussions with IT since most pip request are blocked from their network. They also use a lot of closed ecosystems without any outside connection.
Thanks,
Jonas
Re: Install python packages from local file directory?Hi @Jonas_Rinne . In my experience the answer is 'yes', but it's not the pip/install combo (since they're already local) but rather use of Python's import and modifying the sys.path on local folders already present.
if memory serves me correctly : 1) i've used the Python import statement to simply reference another .py file in the same folder as the .py file referencing it. so simple i was surprised it worked. 2) when I've needed to point to a directory of task-specific .py files to then import, I've used Python's sys.path.append() and sys.path.remove() to add & later remove the intended 'install' needed for that particular project.
Re: Install python packages from local file directory?I think you can just provide the local directory of the python package to install a library that's already available on your machine:
jmputils.jpip('install', 'C:/Users/python/package')
Re: Install python packages from local file directory?Great, I guess they already have their python installation in place this should be straight forward. Thanks!
Re: Install python packages from local file directory?Thanks @nick_shelton - never occurred to me it'd also be that easy!