mikaem / fenicstools

54 stars 36 forks source link

UserWarnings after "python setup.py install" #26

Open Fvergnet opened 6 years ago

Fvergnet commented 6 years ago

Hi Mikaem,

I cloned fenicstools and installed it with the command "python setup.py install". Importing your library I have the following error :

/Users/anonymous/anaconda2/envs/pyfenics/lib/python3.6/site-packages/fenicstools/init.py:7: UserWarning: Probe/Probes/StatisticsProbe/StatisticsProbes not installed warnings.warn("Probe/Probes/StatisticsProbe/StatisticsProbes not installed") /Users/anonymous/anaconda2/envs/pyfenics/lib/python3.6/site-packages/fenicstools/init.py:12: UserWarning: StructuredGrid/ChannelGrid not installed warnings.warn("StructuredGrid/ChannelGrid not installed") /Users/anonymous/anaconda2/envs/pyfenics/lib/python3.6/site-packages/fenicstools/init.py:42: UserWarning: ClementInterpolation not installed warnings.warn("ClementInterpolation not installed") /Users/anonymous/anaconda2/envs/pyfenics/lib/python3.6/site-packages/fenicstools/init.py:47: UserWarning: Lagrangian particles not installed warnings.warn("Lagrangian particles not installed")

Do you have any idea how to solve this issue ?

jorgensd commented 5 years ago

I have the same issue

mikaem commented 5 years ago

Well, it worked for me 4 months ago:-) First of all, are you using a compatible FEniCS version? If you think that you are, then please find out more about what is going wrong. Have a look at where the error occurs. Now do for example

from fenicstools.Probe import Probe

This should at least give us an indication about what goes wrong.

jorgensd commented 5 years ago

That is a very good question. I'm currently using the docker image of FEniCS, docker run -ti quay.io/fenicsproject/stable:current, then cloning and installing as:

git clone https://github.com/mikaem/fenicstools.git
cd fenicstools
sudo python3 setup.py install --prefix=/usr/local

Trying to import probe yields the following:

In [1]: from fenicstools.Probe import Probe
/usr/local/lib/python3.6/dist-packages/fenicstools/__init__.py:7: UserWarning: Probe/Probes/StatisticsProbe/StatisticsProbes not installed
  warnings.warn("Probe/Probes/StatisticsProbe/StatisticsProbes not installed")
/usr/local/lib/python3.6/dist-packages/fenicstools/__init__.py:12: UserWarning: StructuredGrid/ChannelGrid not installed
  warnings.warn("StructuredGrid/ChannelGrid not installed")
/usr/local/lib/python3.6/dist-packages/fenicstools/__init__.py:17: UserWarning: weighted_gradient_matrix/compiled_gradient_module not installed
  warnings.warn("weighted_gradient_matrix/compiled_gradient_module not installed")
/usr/local/lib/python3.6/dist-packages/fenicstools/__init__.py:22: UserWarning: getMemoryUsage/SetMatrixValue not installed
  warnings.warn("getMemoryUsage/SetMatrixValue not installed")
/usr/local/lib/python3.6/dist-packages/fenicstools/__init__.py:27: UserWarning: gauss_divergence/divergence_matrix not installed
  warnings.warn("gauss_divergence/divergence_matrix not installed")
/usr/local/lib/python3.6/dist-packages/fenicstools/__init__.py:32: UserWarning: interpolate_nonmatching_mesh/interpolate_nonmatching_mesh_any not installed
  warnings.warn("interpolate_nonmatching_mesh/interpolate_nonmatching_mesh_any not installed")
/usr/local/lib/python3.6/dist-packages/fenicstools/__init__.py:37: UserWarning: DofMapPlotter not installed
  warnings.warn("DofMapPlotter not installed") # Probably missing dependency

Earlier today I did some debugging, and i think I saw an error linking to scitools, which is only python2.7 compatible as far as I know

mikaem commented 5 years ago

I need to see one of the errors captured in the try: except clauses here.

jorgensd commented 5 years ago
 /home/fenics/local/lib/python3.6/site-packages/fenicstools/__init__.py(6)<module>()
-> from fenicstools.Probe import Probe, Probes, StatisticsProbe, StatisticsProbes
(Pdb) s
--Call--
> <frozen importlib._bootstrap>(966)_find_and_load()
(Pdb) n
> <frozen importlib._bootstrap>(968)_find_and_load()
(Pdb) n
> <frozen importlib._bootstrap>(969)_find_and_load()
(Pdb) n
> <frozen importlib._bootstrap>(970)_find_and_load()
(Pdb) n
> <frozen importlib._bootstrap>(971)_find_and_load()
(Pdb) n
nPermissionError: [Errno 13] Permission denied: '/home/fenics/local/lib/python3.6/site-packages/fenicstools/probe/.rendered.probe11.cpp'
> <frozen importlib._bootstrap>(971)_find_and_load()
mikaem commented 5 years ago

Aha! So there is a permission error on the docker. But that seems weird, the location '/home/fenics/local..' should be open? Could you try to build really locally? With python setup.py build_ext -i. Or simply add the location of the clone to pythonpath and then import fenicstools?

jorgensd commented 5 years ago

So list of stuff i needed when using the stable fenics-docker image:

  1. Run the python program as sudo
  2. Install cppimport: sudo pip3 install cppimport
  3. Install python3-h5py and pyvtk, sudo apt-get install python3-h5py, sudo pip3 install pyvtk

After this, I get the following:

  warnings.warn("Errors occurred attempting to import surfc and meshgrid from scitools")
--Return--

As far as I know, scitools only support python2.7. However, the 2018.1.0 release of dolfin only supports python3.

mikaem commented 5 years ago

So then everything works except the part with StructuredGrid that want to use scitools?

mikaem commented 5 years ago

And I should add install_requires with cppimport, python3-h5py and pyvtk to my setup:-) Note that python3-h5py is probably serial.

jorgensd commented 5 years ago

And I should add install_requires with cppimport, python3-h5py and pyvtk to my setup:-) Note that python3-h5py is probably serial.

Do you know how to get the parallel mpi version? At least the interpolation routine works now. https://github.com/mikaem/fenicstools/wiki/Interpolation-nonmatching-mesh-in-parallel

mikaem commented 5 years ago

You have to compile it yourself in parallel. It's not very difficult, I keep parallel versions on anaconda cloud, but only for conda. See docker-fenics-recipes for some build scripts to follow on the docker.

duyuan11 commented 4 years ago

Hi, @mikaem: I am a beginner of fenicstools, but I still could not succefully import fenicstools, even I follow all your discussion before. Could you please summarize a list step by step how to set up fenicstools? (I am using docker run fenics 2017.2.0) Thank you!

Tom303-afk commented 4 years ago

I followed the above steps and everything works except the part with StructuredGrid that want to use scitools, just like you mentioned. Do you think we could find a way to solve this? I do not get Time-series files, which I suspect might be because I get the error for scitools surfc and meshgrid.

apirogov commented 2 years ago

Please do add cppimport as a dependency, stumbled onto the same issue today.