Jump to content
Fedra853

Command prompt user package

Recommended Posts

Hi,

I need to use an external python package (openpyxl) to connect FLUX with a data sheet. I installed that package in the FLUX's "lib" folder but when i try to import it in the command prompt zone, an error showing "no module named openpyxl found" appears.

How can i install external python package in the correct way?

Grazie!

Share this post


Link to post
Share on other sites

use python import

e.g. import sys

sys.version

works for python 2.7 packages, for external don't works for example:

Can not execute the following command :
import scipy

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

 

 

Share this post


Link to post
Share on other sites

If you want to create or to modify excel file, you can have a look at the macro called BHSplineToExcel (located in C:\Altair\Extensions\Macros\BHSplinetoexcel.PFM for standard installation)

For example, the jxl library is already available.

from jxl import *
from jxl.write import *
import os
from java.io import *

 

name    = "name_of_file"

workbook = Workbook.createWorkbook(File(os.getcwd()+"/"+name+".xls"))
sheet = workbook.createSheet("BH", 0)

 

label1 = Label(0, 0, "Material")
label2 = Label(1, 0, mat.name)

sheet.addCell(label1)
sheet.addCell(label2)

workbook.write()
workbook.close()
 

If you want to add a library to Flux, you have to specify the path in the options by following the next steps:

 - Open Flux supervisor

 - Click on [Options] (on bottom left)

 - in [access path] click on [Python]

 - and then fill in the fields for the working directory of classes or libraries

I hope it will help

Louis Carlioz likes this

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...