import jmp
from jmputils import jpip
jpip('list')
jpip('install --upgrade', 'pip setuptools python-pptx')
The result I get in running the above is:
Requirement already satisfied: pip in c:\users\_myUSERID_\appdata\roaming\jmp\jmp\python\python311\site-packages (24.0)
Collecting pip
Downloading pip-24.1.2-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: setuptools in c:\users\_myUSERID_\appdata\roaming\jmp\jmp\python\python311\site-packages (70.0.0)
Collecting setuptools
Downloading setuptools-70.3.0-py3-none-any.whl.metadata (5.8 kB)
Collecting python-pptx
Downloading python_pptx-0.6.23-py3-none-any.whl.metadata (18 kB)
Collecting lxml>=3.1.0 (from python-pptx)
Downloading lxml-5.2.2-cp311-cp311-win_amd64.whl.metadata (3.5 kB)
Collecting Pillow>=3.3.2 (from python-pptx)
Downloading pillow-10.4.0-cp311-cp311-win_amd64.whl.metadata (9.3 kB)
Collecting XlsxWriter>=0.5.7 (from python-pptx)
Downloading XlsxWriter-3.2.0-py3-none-any.whl.metadata (2.6 kB)
Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
---------------------------------------- 1.8/1.8 MB 8.3 MB/s eta 0:00:00
Downloading setuptools-70.3.0-py3-none-any.whl (931 kB)
---------------------------------------- 931.1/931.1 kB 4.9 MB/s eta 0:00:00
Downloading python_pptx-0.6.23-py3-none-any.whl (471 kB)
---------------------------------------- 471.6/471.6 kB 5.0 MB/s eta 0:00:00
Downloading lxml-5.2.2-cp311-cp311-win_amd64.whl (3.8 MB)
---------------------------------------- 3.8/3.8 MB 8.1 MB/s eta 0:00:00
Downloading pillow-10.4.0-cp311-cp311-win_amd64.whl (2.6 MB)
---------------------------------------- 2.6/2.6 MB 9.1 MB/s eta 0:00:00
Downloading XlsxWriter-3.2.0-py3-none-any.whl (159 kB)
---------------------------------------- 159.9/159.9 kB 3.2 MB/s eta 0:00:00
Installing collected packages: XlsxWriter, setuptools, pip, Pillow, lxml, python-pptx
Attempting uninstall: setuptools
Found existing installation: setuptools 70.0.0
Uninstalling setuptools-70.0.0:
Successfully uninstalled setuptools-70.0.0
Attempting uninstall: pip
Found existing installation: pip 24.0
Uninstalling pip-24.0:
Successfully uninstalled pip-24.0
Successfully installed Pillow-10.4.0 XlsxWriter-3.2.0 lxml-5.2.2 pip-24.1.2 python-pptx-0.6.23 setuptools-70.3.0
At which point
from pptx import Presentation
Gives in the log
//:*/
from pptx import Presentation
/*:
I would look into the log and investigate what you see in the log when you run:
jmputils.jpip('install --upgrade', 'python-pptx')
I feel you must have had some issue that occurred when installing the package, that should be reported in the log. Ir could be permissions; to access the internet, it could be disk permissions, it could be lack of disk space, ... Without knowing what jpip reported to log it's kind of hard to track down. I tried the above with 18.1.0 and had no issues. Have you tried shutting down JMP and restarting? I had no issues installing or running your script. Since all we are running here is Python code, I ran it directly from a Python script window, rather than Python Submit() or Python Execute() from JSL. JSL's Pyrthon Install Packages("python-pptx") should also work. Under the hood it calls jmputils.jpip(). You can also drop down to the terminal level to install packages. Use Python Create JPIP CMD(); to create a tailored command line jpip.bat or jpip shell script (macOS) which is customized to your JMP environment. Running the command launches a dialog picker to choose the destination directory for saving the jpip script. From cmd window / Terminal run
c:\path_you_chose\jpip.bat install python-pptx