thelfer / MFrontGenericInterfaceSupport

This project aims at providing support for MFront generic behaviours. This project can be embedded in open-source and propriary sofware
37 stars 35 forks source link

Failed to import the MGIS module. #101

Closed RokyC closed 1 year ago

RokyC commented 2 years ago
 I refer to "https://comet-fenics.readthedocs.io/en/latest/demo/plasticity_mfront/plasticity_mfront.py.html" installation TEFL and MGIS, 
 I run the following command on the terminal and execute it.However, the mGIS module cannot be found when running the Python file.
The following is terminal execution:
 ->source. / mgis/master/install/env. sh
 -> mfront --obuild --interface=generic IsotropicLinearHardeningPlasticity.mfront
Treating target : all
The following library has been built :
 - libBehaviour.so :   IsotropicLinearHardeningPlasticity_AxisymmetricalGeneralisedPlaneStrain  
 IsotropicLinearHardeningPlasticity_Axisymmetrical IsotropicLinearHardeningPlasticity_PlaneStrain  
 IsotropicLinearHardeningPlasticity_GeneralisedPlaneStrain IsotropicLinearHardeningPlasticity_Tridimensional
thelfer commented 2 years ago

Hi @RokyC,

I don't see the error in your logs.

Would you try:

$ source ./mgis/master/install/env. sh
$ echo $PYTHONPATH
$ ls  ./mgis/master/install/lib/
$ python3
>>> import mgis

and give us the output of every single command.

Best,

Thomas

RokyC commented 2 years ago

Thank you for your answer. This is the result after running: image

thelfer commented 2 years ago

would you just list the files of the first directory pointed by PYTHONPATH (i.e. mgis/install-..../lib/python.../site-packages/)

RokyC commented 2 years ago

I seem to have found a problem, python3.9 does not exist in the lib file, I have reconfigured PYTHONPATH in env.sh. Thank you very much for your patient reply.

image

thelfer commented 2 years ago

@RokyC It is always complicated to ensure a consistent environment. Always try to compile mfront with the compilers and python interpeters (and boost/python which is the hardest one) that you will use. Good luck !