cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

JMP Wish List

We want to hear your ideas for improving JMP. Share them here.
Choose Language Hide Translation Bar

Allow custom Python package directories by respecting PYTHONUSERBASE

What inspired this wish list request? I need to install Python packages in a custom directory on my machine (e.g., C:\lib_jmp_python) using the standard Windows PYTHONUSERBASE environment variable. Currently, if I run jmputils.jpip('install', 'package_name'), my system variable is completely ignored. The jmputils.py script hardcodes the installation paths by forcing its own site.USER_BASE and overwriting the subprocess environment. This makes it impossible to route packages to a custom local folder using standard Python OS variables; everything is forced into the default JMP AppData/ProgramData directories.

 

What is the improvement you would like to see? I would like jmputils.py to respect the system's PYTHONUSERBASE variable if it is defined by the user, and only fall back to the default JMP paths if it is not set. Specifically, in the jpip() function, a simple conditional check could be added:

if 'PYTHONUSERBASE' in os.environ:
    site.USER_BASE = os.environ['PYTHONUSERBASE']
elif site.USER_BASE is None:
    site.getuserbase()

The exact same logic should be applied to the create_jpip() function when generating the jpip.bat script, replacing the currently hardcoded set PYTHONUSERBASE=%APPDATA%\JMP\JMP\Python with a dynamic check.

 

Why is this idea important? This is highly valuable for users and IT administrators who need strict control over their Python environments. It allows users to route potentially large Python packages to specific drives or custom directories without breaking JMP's isolated environment. Ultimately, it aligns JMP's Python integration with standard Python behaviors, reducing friction and confusion for developers trying to manage their packages efficiently.

2 Comments
scott_allen
Staff
Status changed to: Acknowledged

@guillaumebugnon - Thanks for submitting the wish. 

scott_allen
Staff

 @guillamebugnon - I would like to pass along some information from a developer regarding this Wish and the upcoming JMP version 20:

JMP version 20's Python now runs in isolated mode to ensure consistent behavior across the variety of user's environments. The effect of this is that the embedded Python now ignores all PYTHON* environment variables. 

JMP version 20 EA 1 and newer includes support for Python venv virtual environments. Under JMP->Preferences->Python is a pane that presents options to create, and select created virtual environments as alternates to the 'default' site-package environment. The venv needs to be created by JMP.  The virtual environment needs to point to the JMP supplied Python shared libraries, not those of an external Python installation.  The created virtual environment can be placed anywhere in the filesystem or shared drive.  The virtual environment selection, is a directory picker file dialog, again can reside anywhere on the filesystem. 

Once created the venv can be utilized from the terminal like any Python venv.  Including activating the venv from the command line and directly using pip within the venv environment instead of using jpip from within JMP.  Once created by JMP, external scripts could populate the venv or could utilize the environment.  However access to import jmp package is only available from within a running copy of JMP.

I encourage you to download the current JMP EA version and give it a try.