# Problem about installing mgis.fenics Python module

**URL:** <https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197>\
**Category:** installation\
**Created:** [May 14, 2020, 8:09am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197 "2020-05-14T08:09:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 14, 2020, 8:09am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/1 "2020-05-14T08:09:08Z")

</div>

hi, everyone, i want to use `mgis.fenics` python module.  
I have done the following steps to install “MFrontGenericInterfaceSupport”  
1 unzip field in `C:/MFrontGenericInterfaceSupport` (field from [this website](https://github.com/thelfer/MFrontGenericInterfaceSupport))  
2 type `cd /mnt/c/MFrontGenericInterfaceSupport` on terminal windows  
3 type `cmake .`  
4 type `cmake`  
5 type `make`  
6 type `make check`  
7 type `make install`

but after completing above steps, pycharm can not still identify `mgis.fenics`. i don’t know which step i wrongly make or lost.

I have found in the “INSTALL-cmake.md” field, there are 2 options could be related but i do not know in which step i should use them.

- `enable-python-bindings` : compiles the `Python` bindings. This requires the `Boost/Python` library to be available (default=OFF)
- `enable-fenics-bindings` : compiles the `FEniCS` bindings. Those bindings are experimental and very limited. To use `MGIS` with `FEniCS` , usage of the `Python` bindings are encouraged.

My OS is win10 and install ubuntu on it.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![bleyerj](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/bleyerj/32/6020_2.png) [@bleyerj](https://fenicsproject.discourse.group/u/bleyerj)\
**Post date:** [May 14, 2020, 8:35am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/2 "2020-05-14T08:35:03Z")

</div>

Hi, you need to indeed activate the python bindings which contain the `mgis.fenics` module with

```auto
cmake -Denable-python-bindings=ON

```

The FEniCS bindings were an attempt using the C++ interface.

You should also have `libboost_python` installed before compiling MGIS.

You may also want to specify the python version associated with FEniCS if you have different versions installed using in the cmake command an additional `-DPython_ADDITIONAL_VERSIONS=3.6` for instance for Python 3.6

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 14, 2020, 10:04am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/3 "2020-05-14T10:04:23Z")

</div>

Hi, bleyerj. after runing `cmake -Denable-python-bindings=ON` and `cmake -Denable-fenics-bindings=ON` in step4. Pycharm can not still identify mgis.  
when installing this package, the terminal windows return the following details (just parts and sorry for uploading so many, i really do not know what mistakes happen.

step3: type `cmake .`

> zhiyi@DESKTOP-9ME6CPV:/mnt/c/MFrontGenericInterfaceSupport-master$ cmake .  
> – found python 3.6.9  
> – python include path /usr/include/python3.6m  
> – python libraries path /usr/lib/x86\_64-linux-gnu  
> – python library python3.6m  
> – python interpreter /usr/bin/python3.6  
> – Trying to find libboost\_python-py36  
> – Could NOT find Boost: missing: python-py36 (found /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version “1.72.0”, minimum required is “1.36.0”))  
> – Trying to find libboost\_python36  
> – Boost library python found (Boost::python).  
> – python bindings support enabled  
> – enabling flag ‘Wno-conversion’  
> – enabling flag ‘Wall’  
> …  
> – enabling flag ‘fno-fast-math’  
> – enabling flag ‘ffast-math’  
> unknown option --python-version  
> Valid options are:  
> –all : request flags for all librairies.  
> –compiler-flags : return tfel recommended compiler flags.  
> –cppflags : return preprocessor flags.  
> –cxx-standard : print the version of the C++ standard used to compile TFEL.  
> –exceptions : request flags for TFELException.  
> –glossary : request flags for TFELGlossary.  
> –help : print this help message.  
> –include-path : return the path to the `TFEL` headers.  
> –includes : return tfel include path.  
> –ldflags : return linking flags.  
> –library-dependency: return the dependencies of a `TFEL` library.  
> –library-path : return the path to the `TFEL` library.  
> –libs : return linking flags.  
> –licence : print tfel licences.  
> –major-number : print tfel major version.  
> –material : request flags for TFELMaterial.  
> –math : request flags for TFELMath.  
> –math-cubic-spline: request flags for TFELMathCubicSpline.  
> –math-kriging : request flags for TFELMathKriging.  
> –math-parser : request flags for TFELMathParser.  
> –mfront-profiling: request flags for libMFrontProfiling.  
> –minor-number : print tfel minor version.  
> –numodis : request flags for TFELNUMODIS.  
> –oflags : return tfel recommended optimisation flags with architecture specific flags.  
> –oflags0 : return tfel recommended optimisation flags without architecture specific flags.  
> –oflags2 : return some aggressive optimisation flags, possibly at the expense of numerical precision. This shall be added to `--oflags` results.  
> –physical-constants: request flags for TFELPhysicalConstants.  
> –revision-number : print tfel revision version.  
> –system : request flags for TFELSystem.  
> –tests : request flags for TFELTests.  
> –unicode-support : request flags for TFELUnicodeSupport.  
> –utilities : request flags for TFELUtilities.  
> –version : print tfel version and svn revision.  
> –warning : return tfel recommended warnings.  
> – no tfel python bindings  
> – tfel version : 3.3.0  
> – tfel C++ standard : 11  
> – mfront : /usr/local/bin/mfront  
> – tfel-config : /usr/local/bin/tfel-config  
> – tfel-check : /usr/local/bin/tfel-check  
> – tfel include : /usr/local/include  
> – tfel libs : /usr/local/lib  
> – TFELTests : /usr/local/lib/libTFELTests.so  
> – TFELTests : /usr/local/lib/libTFELTests.so  
> – TFELException : /usr/local/lib/libTFELException.so  
> – TFELUtilities : /usr/local/lib/libTFELUtilities.so  
> – TFELMath : /usr/local/lib/libTFELMath.so  
> – TFELMaterial : /usr/local/lib/libTFELMaterial.so  
> – TFELPhysicalConstants : /usr/local/lib/libTFELPhysicalConstants.so  
> – doxygen documentation is not enabled  
> – Enabling generation of documentation based on jupyter-nbconvert  
> – jupyter-nbconvert: /home/zhiyi/.local/bin/jupyter-nbconvert  
> – Adding library : BehaviourTest (src/StandardElastoViscoPlasticityPlasticityTest11.cxx;src/StandardElastoViscoPlasticityPlasticityTest11-generic.cxx;src/FiniteStrainSingleCrystal.cxx;src/FiniteStrainSingleCrystal-generic.cxx;src/ParameterTest.cxx;src/ParameterTest-generic.cxx;src/BoundsCheckTest.cxx;src/BoundsCheckTest-generic.cxx;src/Gurson.cxx;src/Gurson-generic.cxx;src/Plasticity.cxx;src/Plasticity-generic.cxx;src/Norton.cxx;src/Norton-generic.cxx;src/Elasticity.cxx;src/Elasticity-generic.cxx)  
> – Configuring done  
> – Generating done  
> – Build files have been written to: /mnt/c/MFrontGenericInterfaceSupport-master

step4: type `cmake -DPython_ADDITIONAL_VERSIONS=3.6` and `cmake -Denable-python-bindings=ON` and `cmake -Denable-fenics-bindings=ON`

> zhiyi@DESKTOP-9ME6CPV:/mnt/c/MFrontGenericInterfaceSupport-master$ cmake -DPython\_ADDITIONAL\_VERSIONS=3.6  
> CMake Warning:  
> No source or binary directory provided. Both will be assumed to be the  
> same as the current working directory, but note that this warning will  
> become a fatal error in future CMake releases.
> 
> – found python 3.6.9  
> – python include path /usr/include/python3.6m  
> – python libraries path /usr/lib/x86\_64-linux-gnu  
> – python library python3.6m  
> – python interpreter /usr/bin/python3.6  
> – Trying to find libboost\_python-py36  
> – Could NOT find Boost: missing: python-py36 (found /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version “1.72.0”, minimum required is “1.36.0”))  
> – Trying to find libboost\_python36  
> – Boost library python found (Boost::python).  
> – python bindings support enabled  
> – enabling flag ‘Wno-conversion’  
> – enabling flag ‘Wall’  
> zhiyi@DESKTOP-9ME6CPV:/mnt/c/MFrontGenericInterfaceSupport-master$ cmake -Denable-python-bindings=ON  
> CMake Warning:  
> No source or binary directory provided. Both will be assumed to be the  
> same as the current working directory, but note that this warning will  
> become a fatal error in future CMake releases.
> 
> – found python 3.6.9  
> – python include path /usr/include/python3.6m  
> – python libraries path /usr/lib/x86\_64-linux-gnu  
> – python library python3.6m  
> – python interpreter /usr/bin/python3.6  
> – Trying to find libboost\_python-py36  
> – Could NOT find Boost: missing: python-py36 (found /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version “1.72.0”, minimum required is “1.36.0”))  
> – Trying to find libboost\_python36  
> – Boost library python found (Boost::python).  
> – python bindings support enabled  
> – enabling flag ‘Wno-conversion’  
> – enabling flag ‘Wall’  
> zhiyi@DESKTOP-9ME6CPV:/mnt/c/MFrontGenericInterfaceSupport-master$ cmake -Denable-fenics-bindings=ON  
> CMake Warning:  
> No source or binary directory provided. Both will be assumed to be the  
> same as the current working directory, but note that this warning will  
> become a fatal error in future CMake releases.
> 
> – found python 3.6.9  
> – python include path /usr/include/python3.6m  
> – python libraries path /usr/lib/x86\_64-linux-gnu  
> – python library python3.6m  
> – python interpreter /usr/bin/python3.6  
> – Trying to find libboost\_python-py36  
> – Could NOT find Boost: missing: python-py36 (found /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version “1.72.0”, minimum required is “1.36.0”))  
> – Trying to find libboost\_python36  
> – Boost library python found (Boost::python).  
> – Found PkgConfig: /usr/bin/pkg-config (found version “0.29.1”)  
> – Checking for one of the modules ‘craypetsc\_real;PETSc’  
> – Looking for sys/types.h  
> – Looking for sys/types.h - found  
> – Looking for stdint.h  
> – Looking for stdint.h - found  
> – Looking for stddef.h  
> – Looking for stddef.h - found  
> – Check size of PetscInt  
> – Check size of PetscInt - done  
> – Checking for one of the modules ‘crayslepc\_real;SLEPc’  
> – python bindings support enabled  
> – FEniCS bindings support enabled  
> – enabling flag ‘Wno-conversion’  
> – enabling flag ‘Wall’

step5:type `make`

> zhiyi@DESKTOP-9ME6CPV:/mnt/c/MFrontGenericInterfaceSupport-master$ make  
> [2%] Building CXX object src/CMakeFiles/MFrontGenericInterface.dir/ThreadPool.cxx.o  
> [5%] Building CXX object src/CMakeFiles/MFrontGenericInterface.dir/ThreadedTaskResult.cxx.o  
> [8%] Building CXX object src/CMakeFiles/MFrontGenericInterface.dir/LibrariesManager.cxx.o  
> [10%] Building CXX object src/CMakeFiles/MFrontGenericInterface.dir/Markdown.cxx.o  
> /mnt/c/MFrontGenericInterfaceSupport-master/src/Markdown.cxx: In function ‘std::\_\_cxx11::string mgis::utilities::get\_heading\_signs(mgis::size\_type)’:  
> /mnt/c/MFrontGenericInterfaceSupport-master/src/Markdown.cxx:21:57: warning: unused parameter ‘l’ [-Wunused-parameter]  
> std::string get\_heading\_signs(const mgis::size\_type l) {  
> ^  
> [13%] Building CXX object src/CMakeFiles/MFrontGenericInterface.dir/MatrixView.cxx.o  
> [16%] Building CXX object src/CMakeFiles/MFrontGenericInterface.dir/Variable.cxx.o  
> [18%] Building CXX object src/CMakeFiles/MFrontGenericInterface.dir/Hypothesis.cxx.o  
> [21%] Building CXX object src/CMakeFiles/MFrontGenericInterface.dir/Behaviour.cxx.o  
> /mnt/c/MFrontGenericInterfaceSupport-master/src/Behaviour.cxx: In lambda function:  
> /mnt/c/MFrontGenericInterfaceSupport-master/src/Behaviour.cxx:190:7: warning: control reaches end of non-void function [-Wreturn-type]  
> }();  
> ^  
> /mnt/c/MFrontGenericInterfaceSupport-master/src/Behaviour.cxx: In lambda function:  
> /mnt/c/MFrontGenericInterfaceSupport-master/src/Behaviour.cxx:222:7: warning: control reaches end of non-void function [-Wreturn-type]  
> }();  
> ^  
> [24%] Building CXX object src/CMakeFiles/MFrontGenericInterface.dir/ChangeBasis.cxx.o  
> …  
> [75%] Linking CXX shared module behaviour.so  
> [75%] Built target py\_mgis\_behaviour  
> [78%] Building CXX object bindings/python/src/CMakeFiles/py\_mgis.dir/mgis-module.cxx.o  
> [81%] Building CXX object bindings/python/src/CMakeFiles/py\_mgis.dir/ThreadPool.cxx.o  
> [81%] Linking CXX shared module \_mgis.so  
> [81%] Built target py\_mgis  
> Scanning dependencies of target MFrontGenericInterface-FEniCS  
> [83%] Building CXX object bindings/fenics/src/CMakeFiles/MFrontGenericInterface-FEniCS.dir/Utils.cxx.o  
> [86%] Building CXX object bindings/fenics/src/CMakeFiles/MFrontGenericInterface-FEniCS.dir/NonLinearMaterial.cxx.o  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> /usr/include/eigen3/Eigen/src/Core/Matrix.h:178:7: required from ‘class Eigen::Matrix\<double, -1, 1\>’  
> /usr/include/dolfin/function/GenericFunction.h:82:49: required from here  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> [100%] Linking CXX shared library libMFrontGenericInterface-FEniCS.so  
> [100%] Built target MFrontGenericInterface-FEniCS

step6: `make check`

> zhiyi@DESKTOP-9ME6CPV:/mnt/c/MFrontGenericInterfaceSupport-master$ make check  
> [0%] Generating MGISSmallStrainFormulation3D.cpp, MGISSmallStrainFormulation3D.h  
> [1%] Generating MGISSmallStrainFormulation2D.cpp, MGISSmallStrainFormulation2D.h  
> Scanning dependencies of target MFrontGenericInterfaceFEniCSTestingUtilities  
> [2%] Building CXX object bindings/fenics/tests/src/CMakeFiles/MFrontGenericInterfaceFEniCSTestingUtilities.dir/FEniCSTestingUtilities.cxx.o  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]  
> cc1plus: warning: this condition has identical branches [-Wduplicated-branches]

step7: `sudo make install`

> zhiyi@DESKTOP-9ME6CPV:/mnt/c/MFrontGenericInterfaceSupport-master$ sudo make install  
> [40%] Built target MFrontGenericInterface  
> [75%] Built target py\_mgis\_behaviour  
> [81%] Built target py\_mgis  
> [100%] Built target MFrontGenericInterface-FEniCS  
> Install the project…  
> – Install configuration: “”  
> – Up-to-date: /usr/local/share/doc/mgis/web/css  
> – Up-to-date: /usr/local/share/doc/mgis/web/css/main.css  
> – Up-to-date: /usr/local/share/doc/mgis/web/css/normalize.css  
> – Up-to-date: /usr/local/share/doc/mgis/web/css/slideshow.css  
> – Up-to-date: /usr/local/share/doc/mgis/web/img  
> – Up-to-date: /usr/local/share/doc/mgis/web/img/finite\_strain\_plasticity\_solution.png  
> – Up-to-date: /usr/local/share/doc/mgis/web/img/fuel\_rod\_solution.png  
> – Up-to-date: /usr/local/share/doc/mgis/web/img/multiphase\_kinematics.svg  
> – Up-to-date: /usr/local/share/doc/mgis/web/img/phase\_change\_law.svg  
> – Up-to-date: /usr/local/share/doc/mgis/web/img/solidification\_front.gif  
> – Up-to-date: /usr/local/share/doc/mgis/web/img/Temperature\_Castem\_FEniCS.png  
> – Up-to-date: /usr/local/include/MGIS/Config-c.h  
> – Up-to-date: /usr/local/include/MGIS/Config.hxx  
> – Up-to-date: /usr/local/include/MGIS/Cste.hxx  
> – Up-to-date: /usr/local/include/MGIS/MatrixView.hxx  
> – Up-to-date: /usr/local/include/MGIS/MatrixView.ixx  
> – Up-to-date: /usr/local/include/MGIS/Raise.ixx  
> – Up-to-date: /usr/local/include/MGIS/Raise.hxx  
> – Up-to-date: /usr/local/include/MGIS/Span.hxx  
> – Up-to-date: /usr/local/include/MGIS/StringView.hxx  
> – Up-to-date: /usr/local/include/MGIS/StringView.ixx  
> – Up-to-date: /usr/local/include/MGIS/Variant.hxx  
> – Up-to-date: /usr/local/include/MGIS/ThreadPool.hxx  
> – Up-to-date: /usr/local/include/MGIS/ThreadPool.ixx  
> – Up-to-date: /usr/local/include/MGIS/ThreadedTaskResult.hxx  
> – Up-to-date: /usr/local/include/MGIS/ThreadedTaskResult.ixx  
> – Up-to-date: /usr/local/include/MGIS/Utilities/Markdown.hxx  
> – Up-to-date: /usr/local/include/MGIS/LibrariesManager.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/Hypothesis.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/Variable.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/BehaviourFctPtr.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/Behaviour.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/ChangeBasis.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/StateView.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/StateView.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/BehaviourData.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/BehaviourDataView.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/State.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/MaterialStateManager.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/MaterialDataManager.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/Integrate.hxx  
> – Up-to-date: /usr/local/include/MGIS/Behaviour/Integrate.ixx  
> – Installing: /usr/local/lib/libMFrontGenericInterface.so  
> – Up-to-date: /usr/local/share/mgis/cmake/MFrontGenericInterfaceConfig.cmake  
> – Installing: /usr/local/share/mgis/cmake/MFrontGenericInterfaceConfig-noconfig.cmake  
> – Installing: /usr/local/lib/python3.6/site-packages/mgis/\_mgis.so  
> – Set runtime path of “/usr/local/lib/python3.6/site-packages/mgis/\_mgis.so” to “”  
> – Installing: /usr/local/lib/python3.6/site-packages/mgis/behaviour.so  
> – Set runtime path of “/usr/local/lib/python3.6/site-packages/mgis/behaviour.so” to “”  
> – Up-to-date: /usr/local/lib/python3.6/site-packages/mgis/ **init**.py  
> – Up-to-date: /usr/local/lib/python3.6/site-packages/mgis/fenics/ **init**.py  
> – Up-to-date: /usr/local/lib/python3.6/site-packages/mgis/fenics/gradient\_flux.py  
> – Up-to-date: /usr/local/lib/python3.6/site-packages/mgis/fenics/utils.py  
> – Up-to-date: /usr/local/lib/python3.6/site-packages/mgis/fenics/nonlinear\_material.py  
> – Up-to-date: /usr/local/lib/python3.6/site-packages/mgis/fenics/nonlinear\_problem.py

---

<div class="post-metadata">

**Author:** ![bleyerj](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/bleyerj/32/6020_2.png) [@bleyerj](https://fenicsproject.discourse.group/u/bleyerj)\
**Post date:** [May 14, 2020, 12:47pm UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/4 "2020-05-14T12:47:09Z")

</div>

It seems that it has been correctly installed in `/usr/local/lib/python3.6/site-packages`  
Can you run with `python3` :

```python
import sys
sys.path

```

if `/usr/local/lib/python3.6/site-packages` is not in the list, then add it to your .basrhc file

```bash
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.6/site-packages
```

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 14, 2020, 1:21pm UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/5 "2020-05-14T13:21:57Z")

</div>

have add it to .basrhc file but still doesn’t work.

```
zhiyi@DESKTOP-9ME6CPV:~$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/home/zhiyi', '/usr/local/lib/python3.6/site-packages', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/zhiyi/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages']
>>>

```

 ![image](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/5/551f35b0425b46976ca9852c065178fb42db5497.png)

---

<div class="post-metadata">

**Author:** ![bleyerj](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/bleyerj/32/6020_2.png) [@bleyerj](https://fenicsproject.discourse.group/u/bleyerj)\
**Post date:** [May 14, 2020, 2:09pm UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/6 "2020-05-14T14:09:28Z")

</div>

Strange, what happens if you type in `python3`:

```auto
import mgis

```

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 14, 2020, 2:11pm UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/7 "2020-05-14T14:11:40Z")

</div>

```
zhiyi@DESKTOP-9ME6CPV:~$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mgis
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/mgis/ __init__.py", line 1, in <module>
    from ._mgis import *
ImportError: libMFrontGenericInterface.so: cannot open shared object file: No such file or directory
>>>
```

---

<div class="post-metadata">

**Author:** ![bleyerj](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/bleyerj/32/6020_2.png) [@bleyerj](https://fenicsproject.discourse.group/u/bleyerj)\
**Post date:** [May 14, 2020, 2:31pm UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/8 "2020-05-14T14:31:34Z")

</div>

I think that the problem comes from Boost python. Do you have `libboost-python-dev` installed ?

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 14, 2020, 2:42pm UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/9 "2020-05-14T14:42:12Z")

</div>

```
zhiyi@DESKTOP-9ME6CPV:~$ sudo apt-get install -y libboost-python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libboost-python-dev is already the newest version (1.65.1.0ubuntu1).
libboost-python-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 51 not upgraded.

```

but still doesn’t work

---

<div class="post-metadata">

**Author:** ![thelfer](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@thelfer](https://fenicsproject.discourse.group/u/thelfer)\
**Post date:** [May 14, 2020, 3:47pm UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/10 "2020-05-14T15:47:09Z")

</div>

Hi Daniel,  
Thanks for your interest for MGIS.  
the `mgis` python modules is based on the C++ `libMFrontGenericInterface.so` shared library. My bet would be that you updated you PYTHONPATH and not your LD\_LIBRARY\_PATH. Could you check ?

According to this line:

```auto
/usr/local/lib/libMFrontGenericInterface.so

```

you must check that `/usr/local/lib/` is in the linker search path.

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 15, 2020, 1:47am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/11 "2020-05-15T01:47:22Z")

</div>

Hi, thelfer. I found “`libMFrontGenericInterface.so`” is in the “lib” folder

```
zhiyi@DESKTOP-9ME6CPV:/usr/local/lib$ ls
cmake libboost_iostreams.a libboost_random.so.1.72
libMFMTestGenerator.so libboost_iostreams.so libboost_random.so.1.72.0
libMFrontGenericInterface.so libboost_iostreams.so.1 libboost_regex.a
libMFrontLogStream.so libboost_iostreams.so.1.72 libboost_regex.so
libMFrontProfiling.so libboost_iostreams.so.1.72.0 libboost_regex.so.1
libMTestFileGenerator.so libboost_locale.a libboost_regex.so.1.72

```

is that mean “`LD_LIBRARY_PATH`” has been updated?

 ![image](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/9/94bb402595e06c8828b43b89ce1d1e8230165c72.png)  
but the color of `libMFrontGenericInterface.so` is white, which mean no-updated?

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 15, 2020, 2:36am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/12 "2020-05-15T02:36:19Z")

</div>

I guess the following info could be a problem but i di not know how to fix it.

```
zhiyi@DESKTOP-9ME6CPV:~$ sudo /sbin/ldconfig -v
[sudo] password for zhiyi:
/sbin/ldconfig.real: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/usr/local/lib/libMFrontGenericInterface.so' given more than once
/sbin/ldconfig.real: Path `/usr/local/lib/libMFrontGenericInterface.so' given more than once
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/usr/lib/x86_64-linux-gnu/libfakeroot:
        libfakeroot-0.so -> libfakeroot-tcp.so
/usr/local/lib/libMFrontGenericInterface.so:
/sbin/ldconfig.real: Can't open directory /usr/local/lib/libMFrontGenericInterface.so: Not a directory
/usr/local/lib:
        libboost_wserialization.so.1.72.0 -> libboost_wserialization.so.1.72.0
        libboost_wave.so.1.72.0 -> libboost_wave.so.1.72.0
        libboost_unit_test_framework.so.1.72.0 -> libboost_unit_test_framework.so.1.72.0
```

---

<div class="post-metadata">

**Author:** ![thelfer](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@thelfer](https://fenicsproject.discourse.group/u/thelfer)\
**Post date:** [May 15, 2020, 5:49am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/13 "2020-05-15T05:49:24Z")

</div>

Can you give me the resutls of :

1. `ldd /usr/local/lib/python3.6/site-packages/mgis/_mgis.so`
2. `echo $LD_LIBRARY_PATH`

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 15, 2020, 6:08am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/14 "2020-05-15T06:08:21Z")

</div>

```
zhiyi@DESKTOP-9ME6CPV:~$ ldd /usr/local/lib/python3.6/site-packages/mgis/_mgis.so
        linux-vdso.so.1 (0x00007fffd2662000)
        libMFrontGenericInterface.so => /usr/local/lib/libMFrontGenericInterface.so (0x00007f1157a40000)
        libboost_python36.so.1.72.0 => /usr/local/lib/libboost_python36.so.1.72.0 (0x00007f1157800000)
        libpython3.6m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0 (0x00007f1157140000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1156db0000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1156b90000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1156790000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1156570000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1156350000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1158000000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f1156110000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1155ef0000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f1155ce0000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1155940000)
zhiyi@DESKTOP-9ME6CPV:~$ echo $LD_LIBRARY_PATH
:/usr/local/lib/
```

---

<div class="post-metadata">

**Author:** ![thelfer](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@thelfer](https://fenicsproject.discourse.group/u/thelfer)\
**Post date:** [May 15, 2020, 6:15am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/15 "2020-05-15T06:15:56Z")

</div>

> [@Daniel](#):
>
> libMFrontGenericInterface.so =\> /usr/local/lib/libMFrontGenericInterface.so

This is the revelant line. So `libMFrontGenericInterface.so` is found. And in this configuration, you still get an error when importing the `mgis` module ?

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 15, 2020, 6:33am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/16 "2020-05-15T06:33:28Z")

</div>

still get an error.

 ![image](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/9/9fd313837818716df4c49c995de08e6dbd7cafab.png)

---

<div class="post-metadata">

**Author:** ![thelfer](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@thelfer](https://fenicsproject.discourse.group/u/thelfer)\
**Post date:** [May 15, 2020, 6:36am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/17 "2020-05-15T06:36:05Z")

</div>

What is the return of `python3 -c "import mgis"` ?

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 15, 2020, 6:38am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/18 "2020-05-15T06:38:04Z")

</div>

```
zhiyi@DESKTOP-9ME6CPV:~$ python3 -c "import mgis"
zhiyi@DESKTOP-9ME6CPV:~$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mgis
>>>
```

---

<div class="post-metadata">

**Author:** ![thelfer](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@thelfer](https://fenicsproject.discourse.group/u/thelfer)\
**Post date:** [May 15, 2020, 6:54am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/19 "2020-05-15T06:54:05Z")

</div>

So we made some progress.  
What is the error when running the `mgis.fenics` example ?

---

<div class="post-metadata">

**Author:** ![Daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daniel](https://fenicsproject.discourse.group/u/Daniel)\
**Post date:** [May 15, 2020, 6:56am UTC](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197/20 "2020-05-15T06:56:12Z")

</div>

still can not identify mgis module

```
C:\Users\Danie\AppData\Local\Microsoft\WindowsApps\ubuntu.exe run "export PYTHONUNBUFFERED=1 && export PYTHONIOENCODING=UTF-8 && export \"PYTHONPATH=/mnt/c/Users/Danie/OneDrive/桌面/PhaseField_fracture:/mnt/c/Program Files/JetBrains/PyCharm 2020.1/plugins/python/helpers/pycharm_matplotlib_backend:/mnt/c/Program Files/JetBrains/PyCharm 2020.1/plugins/python/helpers/pycharm_display\" && export PYCHARM_HOSTED=1 && export PYCHARM_DISPLAY_PORT=63342 && cd /mnt/c/Users/Danie/OneDrive/桌面/PhaseField_fracture && /usr/bin/python3 /mnt/c/Users/Danie/OneDrive/桌面/PhaseField_fracture/PhaseFieldFracture.py"
Traceback (most recent call last):
  File "/mnt/c/Users/Danie/OneDrive/桌面/PhaseField_fracture/PhaseFieldFracture.py", line 276, in <module>
    import mgis.fenics as mf
ModuleNotFoundError: No module named 'mgis'

Process finished with exit code 1
```

[Next page](https://fenicsproject.discourse.group/t/problem-about-installing-mgis-fenics-python-module/3197.md?page=2)
