cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
%3CLINGO-SUB%20id%3D%22lingo-sub-773198%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EL'importation%20JMP%2018%20python%20pptx%20ne%20semble%20pas%20fonctionner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773198%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESalut%20tout%20le%20monde%2C%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EMon%20entreprise%20vient%20d'obtenir%20la%20licence%20JMP%2018%20et%20l'automatisation%20PowerPoint%20ne%20fonctionne%20plus%20%C3%A0%20cause%20des%20d%C3%A9pendances.%20D'apr%C3%A8s%20la%20documentation%20JMP%2C%20j'ai%20compris%20que%20python%20est%20d%C3%A9sormais%20une%20version%20int%C3%A9gr%C3%A9e%2C%20auquel%20cas%20les%20d%C3%A9pendances%20doivent%20%C3%AAtre%20install%C3%A9es%20via%20jmputils.%20Vous%20trouverez%20ci-dessous%20le%20code%20que%20j'ai%20jusqu'%C3%A0%20pr%C3%A9sent%20pour%20les%20importations%20utilis%C3%A9es%20par%20PowerPoint.%20J'obtiens%20toujours%20la%20m%C3%AAme%20erreur%20m%C3%AAme%20avec%20les%20d%C3%A9pendances%20qui%20semblent%20mises%20%C3%A0%20jour%20via%20la%20commande%20list.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Escr%20%3D%20Python%20Execute(%0A%09%7B%7D%2C%20%0A%09%7B%7D%2C%20%0A%09%22%5C%5B%0Aimport%20jmp%0Aimport%20jmputils%0A%0Ajmputils.jpip('list')%0Ajmputils.jpip('install%20--upgrade'%2C%20'pip%20setuptools%20python-pptx')%3CBR%20%2F%3E%0Afrom%20pptx%20import%20Presentation%20%23Problem%20Line%0Afrom%20pptx.util%20import%20Inches%0Afrom%20pptx.dml.color%20import%20RGBColor%0Afrom%20datetime%20import%20date%0A%5D%5C%22%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EVoici%20l'erreur%20de%20journal%20que%20je%20re%C3%A7ois%26nbsp%3B%3A%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22neelsrejan_0-1721096400037.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22neelsrejan_0-1721096400037.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22neelsrejan_0-1721096400037.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22neelsrejan_0-1721096400037.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22neelsrejan_0-1721096400037.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22neelsrejan_0-1721096400037.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22neelsrejan_0-1721096400037.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F66202iAAED414F2155B866%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22neelsrejan_0-1721096400037.png%22%20alt%3D%22neelsrejan_0-1721096400037.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EPour%20cette%20raison%2C%20je%20ne%20parviens%20pas%20%C3%A0%20cr%C3%A9er%20et%20%C3%A0%20enregistrer%20la%20pr%C3%A9sentation.%20Toute%20aide%20serait%20grandement%20appr%C3%A9ci%C3%A9e.%20Merci!%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-773198%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAutomatisation%20et%20scripts%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAcc%C3%A8s%20aux%20donn%C3%A9es%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPartager%20et%20communiquer%20les%20r%C3%A9sultats%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eles%20fen%C3%AAtres%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-773217%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%20%3A%20L'importation%20JMP%2018%20python%20pptx%20ne%20semble%20pas%20fonctionner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773217%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIl%20existe%20de%20nombreuses%20fa%C3%A7ons%20d'installer%20des%20packages%20Python%20dans%20JMP18%20(%20%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F18.0%2F%23page%2Fjmp%2Finstall-python-packages-using-jsl.shtml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EInstaller%20les%20packages%20Python%20%C3%A0%20l'aide%20de%20JSL%20(jmp.com)%3C%2FA%3E%20).%20Y%20a-t-il%20eu%20des%20erreurs%20lors%20de%20l%E2%80%99installation%20du%20package%20%3F%20Pouvez-vous%20utiliser%20jpip%20pour%20installer%20d%E2%80%99autres%20packages%20%3F%20Pour%20moi%2C%20ex%C3%A9cuter%20votre%20code%20semblait%20bien%20fonctionner.%20Les%20packages%20doivent%20%C3%AAtre%20install%C3%A9s%20dans%20votre%20r%C3%A9pertoire%20utilisateur%20JMP%20Python%2C%20vous%20pouvez%20le%20constater%20en%20ex%C3%A9cutant%20la%20commande%20python%20suivante%20dans%20JMP%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Eimport%20jmp%0Aprint(jmp.PY_USER_APPDIR)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3EMarquer%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F7172%22%20target%3D%22_blank%22%3E%40Paul_Nelson%3C%2FA%3E%20car%20il%20a%20probablement%20plus%20d'id%C3%A9es%20sur%20ce%20qui%20pourrait%20ne%20pas%20aller.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-773338%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%20%3A%20L'importation%20JMP%2018%20python%20pptx%20ne%20semble%20pas%20fonctionner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773338%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CPRE%3Eimport%20jmp%0Afrom%20jmputils%20import%20jpip%0A%0Ajpip('list')%0Ajpip('install%20--upgrade'%2C%20'pip%20setuptools%20python-pptx')%3C%2FPRE%3E%0A%3CP%3ELe%20r%C3%A9sultat%20que%20j'obtiens%20en%20ex%C3%A9cutant%20ce%20qui%20pr%C3%A9c%C3%A8de%20est%26nbsp%3B%3A%3C%2FP%3E%0A%3CPRE%3ERequirement%20already%20satisfied%3A%20pip%20in%20c%3A%5Cusers%5C_myUSERID_%5Cappdata%5Croaming%5Cjmp%5Cjmp%5Cpython%5Cpython311%5Csite-packages%20(24.0)%0ACollecting%20pip%0A%20%20Downloading%20pip-24.1.2-py3-none-any.whl.metadata%20(3.6%20kB)%0ARequirement%20already%20satisfied%3A%20setuptools%20in%20c%3A%5Cusers%5C_myUSERID_%5Cappdata%5Croaming%5Cjmp%5Cjmp%5Cpython%5Cpython311%5Csite-packages%20(70.0.0)%0ACollecting%20setuptools%0A%20%20Downloading%20setuptools-70.3.0-py3-none-any.whl.metadata%20(5.8%20kB)%0ACollecting%20python-pptx%0A%20%20Downloading%20python_pptx-0.6.23-py3-none-any.whl.metadata%20(18%20kB)%0ACollecting%20lxml%26gt%3B%3D3.1.0%20(from%20python-pptx)%0A%20%20Downloading%20lxml-5.2.2-cp311-cp311-win_amd64.whl.metadata%20(3.5%20kB)%0ACollecting%20Pillow%26gt%3B%3D3.3.2%20(from%20python-pptx)%0A%20%20Downloading%20pillow-10.4.0-cp311-cp311-win_amd64.whl.metadata%20(9.3%20kB)%0ACollecting%20XlsxWriter%26gt%3B%3D0.5.7%20(from%20python-pptx)%0A%20%20Downloading%20XlsxWriter-3.2.0-py3-none-any.whl.metadata%20(2.6%20kB)%0ADownloading%20pip-24.1.2-py3-none-any.whl%20(1.8%20MB)%0A%20%20%20----------------------------------------%201.8%2F1.8%20MB%208.3%20MB%2Fs%20eta%200%3A00%3A00%0ADownloading%20setuptools-70.3.0-py3-none-any.whl%20(931%20kB)%0A%20%20%20----------------------------------------%20931.1%2F931.1%20kB%204.9%20MB%2Fs%20eta%200%3A00%3A00%0ADownloading%20python_pptx-0.6.23-py3-none-any.whl%20(471%20kB)%0A%20%20%20----------------------------------------%20471.6%2F471.6%20kB%205.0%20MB%2Fs%20eta%200%3A00%3A00%0ADownloading%20lxml-5.2.2-cp311-cp311-win_amd64.whl%20(3.8%20MB)%0A%20%20%20----------------------------------------%203.8%2F3.8%20MB%208.1%20MB%2Fs%20eta%200%3A00%3A00%0ADownloading%20pillow-10.4.0-cp311-cp311-win_amd64.whl%20(2.6%20MB)%0A%20%20%20----------------------------------------%202.6%2F2.6%20MB%209.1%20MB%2Fs%20eta%200%3A00%3A00%0ADownloading%20XlsxWriter-3.2.0-py3-none-any.whl%20(159%20kB)%0A%20%20%20----------------------------------------%20159.9%2F159.9%20kB%203.2%20MB%2Fs%20eta%200%3A00%3A00%0AInstalling%20collected%20packages%3A%20XlsxWriter%2C%20setuptools%2C%20pip%2C%20Pillow%2C%20lxml%2C%20python-pptx%0A%20%20Attempting%20uninstall%3A%20setuptools%0A%20%20%20%20Found%20existing%20installation%3A%20setuptools%2070.0.0%0A%20%20%20%20Uninstalling%20setuptools-70.0.0%3A%0A%20%20%20%20%20%20Successfully%20uninstalled%20setuptools-70.0.0%0A%20%20Attempting%20uninstall%3A%20pip%0A%20%20%20%20Found%20existing%20installation%3A%20pip%2024.0%0A%20%20%20%20Uninstalling%20pip-24.0%3A%0A%20%20%20%20%20%20Successfully%20uninstalled%20pip-24.0%0ASuccessfully%20installed%20Pillow-10.4.0%20XlsxWriter-3.2.0%20lxml-5.2.2%20pip-24.1.2%20python-pptx-0.6.23%20setuptools-70.3.0%0A%3C%2FPRE%3E%0A%3CP%3E%C3%80%20quel%20point%3C%2FP%3E%0A%3CPRE%3Efrom%20pptx%20import%20Presentation%3C%2FPRE%3E%0A%3CP%3EDonne%20dans%20le%20journal%3C%2FP%3E%0A%3CPRE%3E%2F%2F%3A*%2F%0Afrom%20pptx%20import%20Presentation%0A%2F*%3A%0A%3C%2FPRE%3E%0A%3CP%3EJ'examinerais%20le%20journal%20et%20enqu%C3%AAterais%20sur%20ce%20que%20vous%20voyez%20dans%20le%20journal%20lorsque%20vous%20ex%C3%A9cutez%26nbsp%3B%3A%3C%2FP%3E%0A%3CPRE%3Ejmputils.jpip('install%20--upgrade'%2C%20'python-pptx')%3C%2FPRE%3E%0A%3CP%3EJe%20pense%20que%20vous%20avez%20d%C3%BB%20rencontrer%20un%20probl%C3%A8me%20lors%20de%20l'installation%20du%20package%2C%20qui%20devrait%20%C3%AAtre%20signal%C3%A9%20dans%20le%20journal.%20Il%20pourrait%20s'agir%20d'autorisations%26nbsp%3B%3B%20pour%20acc%C3%A9der%20%C3%A0%20Internet%2C%20cela%20peut%20%C3%AAtre%20d%C3%BB%20aux%20autorisations%20du%20disque%2C%20au%20manque%20d'espace%20disque%2C%20...%20Sans%20savoir%20ce%20que%20jpip%20a%20signal%C3%A9%20dans%20son%20journal%2C%20il%20est%20assez%20difficile%20%C3%A0%20retrouver.%20J'ai%20essay%C3%A9%20ce%20qui%20pr%C3%A9c%C3%A8de%20avec%2018.1.0%20et%20je%20n'ai%20eu%20aucun%20probl%C3%A8me.%20Avez-vous%20essay%C3%A9%20d'arr%C3%AAter%20JMP%20et%20de%20red%C3%A9marrer%20%3F%20Je%20n'ai%20eu%20aucun%20probl%C3%A8me%20pour%20installer%20ou%20ex%C3%A9cuter%20votre%20script.%20Puisque%20tout%20ce%20que%20nous%20ex%C3%A9cutons%20ici%20est%20du%20code%20Python%2C%20je%20l'ai%20ex%C3%A9cut%C3%A9%20directement%20%C3%A0%20partir%20d'une%20fen%C3%AAtre%20de%20script%20Python%2C%20plut%C3%B4t%20que%20%3CSTRONG%3EPython%20Submit()%3C%2FSTRONG%3E%20ou%20%3CSTRONG%3EPython%20Execute()%3C%2FSTRONG%3E%20de%20JSL.%20%3CSTRONG%3ELes%20packages%20d'installation%20Pyrthon%20de%20JSL%20(%22python-pptx%22)%3C%2FSTRONG%3E%20devraient%20%C3%A9galement%20fonctionner.%20Sous%20le%20capot%2C%20il%20appelle%20jmputils.jpip().%20Vous%20pouvez%20%C3%A9galement%20descendre%20au%20niveau%20du%20terminal%20pour%20installer%20les%20packages.%20Utilisez%20%3CSTRONG%3EPython%20Cr%C3%A9er%20JPIP%20CMD()%3B%3C%2FSTRONG%3E%20pour%20cr%C3%A9er%20une%20ligne%20de%20commande%20sur%20mesure%20jpip.bat%20ou%20un%20script%20shell%20jpip%20(macOS)%20personnalis%C3%A9%20pour%20votre%20environnement%20JMP.%20L'ex%C3%A9cution%20de%20la%20commande%20lance%20un%20s%C3%A9lecteur%20de%20bo%C3%AEte%20de%20dialogue%20pour%20choisir%20le%20r%C3%A9pertoire%20de%20destination%20pour%20enregistrer%20le%20script%20jpip.%20Depuis%20la%20fen%C3%AAtre%20cmd%20%2F%20Ex%C3%A9cution%20du%20terminal%3C%2FP%3E%0A%3CPRE%3Ec%3A%5Cpath_you_chose%5Cjpip.bat%20install%20python-pptx%3C%2FPRE%3E%0A%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-773434%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%20%3A%20L'importation%20JMP%2018%20python%20pptx%20ne%20semble%20pas%20fonctionner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773434%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESalut%20Paul%2C%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJ'ai%20red%C3%A9marr%C3%A9%20JMP%20et%20le%20code%20que%20j'ai%20fourni%20a%20fonctionn%C3%A9%20de%20mani%C3%A8re%20assez%20int%C3%A9ressante.%20J'appr%C3%A9cie%20la%20description%20d%C3%A9taill%C3%A9e%20et%20les%20%C3%A9tapes%20suppl%C3%A9mentaires%20que%20je%20pourrais%20utiliser%20pour%20d%C3%A9panner%20si%20j'en%20ai%20besoin%20%C3%A0%20l'avenir.%20Merci!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-773435%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%20%3A%20L'importation%20JMP%2018%20python%20pptx%20ne%20semble%20pas%20fonctionner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773435%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESalut%20Jarmo%2C%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EMerci%20pour%20l'aide%20initiale%20et%20pour%20avoir%20contact%C3%A9%20Paul%2C%20j'appr%C3%A9cie%20l'aide%26nbsp%3B!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-773721%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%20%3A%20L'importation%20JMP%2018%20python%20pptx%20ne%20semble%20pas%20fonctionner%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773721%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EJ'aurais%20d%C3%BB%20mentionner%20d%C3%A8s%20le%20d%C3%A9part%20le%20red%C3%A9marrage%20de%20JMP.%20C'%C3%A9tait%20l'un%20des%20premiers%20correctifs%20depuis%20JMP%2018.0.%20Au%20premier%20lancement%2C%20le%20r%C3%A9pertoire%20site-packages%20n'a%20%C3%A9t%C3%A9%20%C3%A9tabli%20que%20lorsque%20cela%20est%20n%C3%A9cessaire.%20Mais%20Python%20ne%20reconna%C3%AEt%20aucun%20package%20ajout%C3%A9%20si%20le%20r%C3%A9pertoire%20site-packages%20est%20cr%C3%A9%C3%A9%20apr%C3%A8s%20l'initialisation%20de%20Python.%20Une%20fois%20%C3%A9tabli%2C%20vous%20pouvez%20ajouter%20de%20nouveaux%20packages%20et%20l'int%C3%A9gration%20JMP%20Python%20devrait%20les%20voir%20imm%C3%A9diatement.%20Cela%20a%20%C3%A9t%C3%A9%20corrig%C3%A9%20dans%20la%20branche%20de%20d%C3%A9veloppement%20de%20JMP%2019%20car%20JMP%20%C3%A9tablit%20lui-m%C3%AAme%20le%20r%C3%A9pertoire%20site-packages%20avant%20l'initialisation%20de%20Python.%20Il%20s%E2%80%99agit%20d%E2%80%99un%20changement%20de%20code%20suffisamment%20important%20pour%20ne%20pas%20figurer%20dans%20la%20branche%2018.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
neelsrejan
Level III

JMP 18 python pptx import not seeming to work

Hi all, 

 

My company has just got the JMP 18 license and the PowerPoint automation is not working anymore due to the dependencies. From JMP documentation I have understood that python is now an integrated version in which case dependencies have to be installed through jmputils. Below is the code I have so far for the imports the powerpoint used to use. I am still getting the same error even with the dependencies looking updated through the list command. 

 

scr = Python Execute(
	{}, 
	{}, 
	"\[
import jmp
import jmputils

jmputils.jpip('list')
jmputils.jpip('install --upgrade', 'pip setuptools python-pptx')
from pptx import Presentation #Problem Line from pptx.util import Inches from pptx.dml.color import RGBColor from datetime import date ]\" );

Here is the log error I am receiving:

 

neelsrejan_0-1721096400037.png

Due to this I am not able to create and save the presentation. Any help would be greatly appreciated. Thanks!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: JMP 18 python pptx import not seeming to work

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

 

View solution in original post

Re: JMP 18 python pptx import not seeming to work

Should have mentioned right up front restarting JMP.  That was one of the early fixes since JMP 18.0.  On first launch, the site-packages directory hasn't been established until it's necessary.  But Python doesn't recognize any packages added if the site-packages directory is created after Python Initialization.  Once it's established, you can add new packages and the JMP Python integration should see them immediately.  That has been fixed in the JMP 19 development branch because JMP itself establishes the site-packages directory before Python initialization.  It's a large enough of a code change that it isn't in the 18 branch. 

View solution in original post

5 REPLIES 5
jthi
Super User

Re: JMP 18 python pptx import not seeming to work

There are many ways of installing Python packages in JMP18 (Install Python Packages using JSL (jmp.com)). Were there any errors during the package installation? Can you use jpip to install other packages? For me running your code seemed to work fine. The packages should be installed to your JMP Python user directory, you can find that by running following python command in JMP

 

import jmp
print(jmp.PY_USER_APPDIR)

 

 

Tagging @Paul_Nelson as he most likely has more ideas what could be wrong.

-Jarmo

Re: JMP 18 python pptx import not seeming to work

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

 

neelsrejan
Level III

Re: JMP 18 python pptx import not seeming to work

Hi Paul, 

 

I restarted JMP and the code I provided worked interestingly enough. I appreciate the detailed description and additional steps I could use to troubleshoot if I need in the future. Thank you!

Re: JMP 18 python pptx import not seeming to work

Should have mentioned right up front restarting JMP.  That was one of the early fixes since JMP 18.0.  On first launch, the site-packages directory hasn't been established until it's necessary.  But Python doesn't recognize any packages added if the site-packages directory is created after Python Initialization.  Once it's established, you can add new packages and the JMP Python integration should see them immediately.  That has been fixed in the JMP 19 development branch because JMP itself establishes the site-packages directory before Python initialization.  It's a large enough of a code change that it isn't in the 18 branch. 

neelsrejan
Level III

Re: JMP 18 python pptx import not seeming to work

Hi Jarmo, 

 

Thanks for the initial help and reaching out to Paul, I appreciate the help!