Jump to content
qchen

How to import third party Python module in Flux

Recommended Posts

Hi,

 

I want to use a 3rd party Python module (numpy, which I successfully installed in Python 2.7) in Flux. When I tried ' import numpy' in command prompt in Flux the error comes as

 

Can not execute the following command :
import numpy

Problem to import the module : numpy
Enter sys.path to see if this module is accessible from your jython session
 

I guess my problem is the 3rd party module is not installed in C:\Altair\Flux_12.3\Third_party\python. So how can I install and use 3rd party Python modules in Flux?

 

Kind regards,

 

Chen

Share this post


Link to post
Share on other sites
2 hours ago, Flux support said:

You are welcome. For your information this will be available in Flux 2018.1,which will be available soon.

Best regards.

 

That's great!

 

Actually I (and many other Flux users I believe) find out there is little information about using Python to manipulate Flux, which is a very powerful way to make more use of Flux. If the Flux development group can provide more material/tutorials on this subject in the future, it's going to be very helpful for Flux users, especially for those who already have some knowledge of Python. 

 

Kind regards,

 

Chen

Share this post


Link to post
Share on other sites

Hi, 

 

I definitely agree with qchen regarding the doc :-)

I have a similar question:

I'm trying to import one of my scripts (imprtScrpt.py) in another script (mainScrpt.py). The imported script only contains functions.

The only solution that I've found until now is to call "executeBatchSpy('imprtScrpt.py')" in mainScrpt. When I simply try "import imprtScrpt", mainScrpt exits without any message.

 

Am I doing something wrong?

 

Thank you very much in advance for your help!

 

PS: until now, I've been ok with importing by using executeBatchSpy, but my script is starting to get quite big and I'd like to use imports to use profiling tools (such as doxy).

Louis Carlioz likes this

Share this post


Link to post
Share on other sites
On 1/22/2019 at 11:33 AM, Romain B said:

I'm trying to import one of my scripts (imprtScrpt.py) in another script (mainScrpt.py). The imported script only contains functions.

The only solution that I've found until now is to call "executeBatchSpy('imprtScrpt.py')" in mainScrpt. When I simply try "import imprtScrpt", mainScrpt exits without any message.

 

I would like to get an answer to the same question as well.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...