cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
txnelson
Super User

How to install a mySQL connector for use in a JMP 18 python program

What are the steps to install a Connector for use in the integrated Python in JMP 18.  Specifically, I need to connect to a mySQL database.

Jim
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to install a mySQL connector for use in a JMP 18 python program

JMP 18.0 improved the package handling that was present in the Early Adopter (EA) releases.  You can install most packages from within JMP from either the JSL environment or the Python environment.  All methods are documented in the Scripting Index.

In the case of packages needing compilation, there is a workaround if jpip fails build and install into the JMP environment.  In this case make sure you have the necessary development tools, Python 3.11.x from Python.org and Visual Studio or Xcode.  

 

Do a normal

pip3.11 install package_name

If the package itself isn't broken this should compile the package locally.

Then with JMP run the jpip or Python Install Packages(); JMP will then pick up the locally built and cached version of the package and install into the JMP environment.

 

With a quick search there is a mysqlclient package which may require binary compilation, and a pure Python PyMySQL https://github.com/PyMySQL/PyMySQL package.  

 

From JSL there are two commands

Python Install Packages("package_name");

and 

Python Create JPIP CMD();   which creates a command line pip wrapper script jpip (or jpip.bat) in a location the user chooses with a directory picker dialog.

 

NOTE: if you use the command line jpip you should also add the --user flag to the install

jpip install --user some_package

 

From Python 

import jmputils

jmputils.jpip('install', 'package_name')

 

# you can generate jpip from jmputils as well

jmputils.create_jpip(destination_path)

 

 

 

View solution in original post

4 REPLIES 4
Craige_Hales
Super User

Re: How to install a mySQL connector for use in a JMP 18 python program

Not tried it, but I think you might start with https://pypi.org/project/mysql/ and use JMP 18's "mypip" command. I think something I did playing the 18's python made a bat file named mypip that manipulated the virtual environment correctly.

@Paul_Nelson 

Craige
jthi
Super User

Re: How to install a mySQL connector for use in a JMP 18 python program

I did have to use something like this to get package install to work https://www.jmp.com/support/help/en/18.0/#page/jmp/install-python-packages-using-jsl.shtml (Python Create JPIP CMD();) but this might have became a bit easier since then (was in some not the latest JMP18 EA version). And my issue was that my package was compiled source code (nptdms)

-Jarmo

Re: How to install a mySQL connector for use in a JMP 18 python program

JMP 18.0 improved the package handling that was present in the Early Adopter (EA) releases.  You can install most packages from within JMP from either the JSL environment or the Python environment.  All methods are documented in the Scripting Index.

In the case of packages needing compilation, there is a workaround if jpip fails build and install into the JMP environment.  In this case make sure you have the necessary development tools, Python 3.11.x from Python.org and Visual Studio or Xcode.  

 

Do a normal

pip3.11 install package_name

If the package itself isn't broken this should compile the package locally.

Then with JMP run the jpip or Python Install Packages(); JMP will then pick up the locally built and cached version of the package and install into the JMP environment.

 

With a quick search there is a mysqlclient package which may require binary compilation, and a pure Python PyMySQL https://github.com/PyMySQL/PyMySQL package.  

 

From JSL there are two commands

Python Install Packages("package_name");

and 

Python Create JPIP CMD();   which creates a command line pip wrapper script jpip (or jpip.bat) in a location the user chooses with a directory picker dialog.

 

NOTE: if you use the command line jpip you should also add the --user flag to the install

jpip install --user some_package

 

From Python 

import jmputils

jmputils.jpip('install', 'package_name')

 

# you can generate jpip from jmputils as well

jmputils.create_jpip(destination_path)

 

 

 

Re: How to install a mySQL connector for use in a JMP 18 python program

Setting this up in the JMP Python environment is exactly the same as you would for standalone Python.  In JMP 18 there isn't yet any integration with the new JMP 18 data connectors functionality.