stranskyjan / dem-fem-coupling

Open source codes for coupling of Finite Element Method and Discrete Element Method using YADE, and OOFEM softwares.
43 stars 24 forks source link

ImportError: No module named Xlib.display #18

Closed Nhabid closed 4 years ago

Nhabid commented 4 years ago

Hey Jan,

First of all thank you so much for uploading your codes. I really appreciate it. I have been using YADE for almost 6 months now and I want to start using the DEM FEM coupling. I installed the 'dem-fem-coupling-master' by going to dem-fem-coupling-master/installation and typing make all. The following is what I got when the installation was done:

Now everything should be compiled and prepared for use. Try out some examples :-) There is no need to run this script any more If you want to run examples directly in this terminal, execute the following command: export PYTHONPATH=$PYTHONPATH:/home/nabid/Downloads/dem-fem-coupling-master/installation/_build/install:

Now I went to the examples/multi1 directory and typed make all. I got the following error:

python -m cProfile -o /tmp/multi1.pro multi1.py /home/nabid/Downloads/dem-fem-coupling-master/installation/_build/yade/install/lib/x86_64-linux-gnu/yade/py/yade/system.py:9: RuntimeWarning: to-Python converter for std::vector<int, std::allocator > already registered; second conversion method ignored. from yade._customConverters import /home/nabid/Downloads/dem-fem-coupling-master/installation/_build/yade/install/lib/x86_64-linux-gnu/yade/py/yade/system.py:9: RuntimeWarning: to-Python converter for std::vector<double, std::allocator > already registered; second conversion method ignored. from yade._customConverters import Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/lib/python2.7/cProfile.py", line 200, in main() File "/usr/lib/python2.7/cProfile.py", line 193, in main runctx(code, globs, None, options.outfile, options.sort) File "/usr/lib/python2.7/cProfile.py", line 49, in runctx prof = prof.runctx(statement, globals, locals) File "/usr/lib/python2.7/cProfile.py", line 140, in runctx exec cmd in globals, locals File "multi1.py", line 9, in import libyade File "/home/nabid/Downloads/dem-fem-coupling-master/installation/_build/install/libyade.py", line 260, in import Xlib.display ImportError: No module named Xlib.display Makefile:41: recipe for target 'example' failed make: *** [example] Error 1

I get the same error for all the examples that are provided. Any help? I am very new to this thing, so i might have missed an obvious thing.

Thank you so much for your help!

Best Regards, Najm

stranskyjan commented 4 years ago

Hello, from the error message, the Xlip python package is missing. Xlib is used for some graphics. try sudo apt-get install python-xlib and run the examples again

Nhabid commented 4 years ago

Hey Jan,

Thank you so much for your prompt reply. I just intalled Xlib based on what you mentioned in your comment and now I get a new error message:

python -m cProfile -o /tmp/contact1.pro contact1.py /home/nabid/Downloads/dem-fem-coupling-master/installation/_build/yade/install/lib/x86_64-linux-gnu/yade/py/yade/system.py:9: RuntimeWarning: to-Python converter for std::vector<int, std::allocator > already registered; second conversion method ignored. from yade._customConverters import /home/nabid/Downloads/dem-fem-coupling-master/installation/_build/yade/install/lib/x86_64-linux-gnu/yade/py/yade/system.py:9: RuntimeWarning: to-Python converter for std::vector<double, std::allocator > already registered; second conversion method ignored. from yade._customConverters import Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/lib/python2.7/cProfile.py", line 200, in main() File "/usr/lib/python2.7/cProfile.py", line 193, in main runctx(code, globs, None, options.outfile, options.sort) File "/usr/lib/python2.7/cProfile.py", line 49, in runctx prof = prof.runctx(statement, globals, locals) File "/usr/lib/python2.7/cProfile.py", line 140, in runctx exec cmd in globals, locals File "contact1.py", line 7, in import libyade File "/home/nabid/Downloads/dem-fem-coupling-master/installation/_build/install/libyade.py", line 294, in import PyQt5 ImportError: No module named PyQt5 Makefile:41: recipe for target 'example' failed make: *** [example] Error 1

I would guess that PyQt5 is missing now? Any suggestions?

Thank you so much! Najm

stranskyjan commented 4 years ago

similarly, try: sudo apt-get install python-pyqt5

hint: internet search engine -> ImportError: No module named PyQt5 python2

Nhabid commented 4 years ago

Thank you so much Jan. After following your comment. I got the following error: ImportError: cannot import name QtWebKit which was solved with: sudo apt install python-pyqt5.qtwebkit

It is working now. Thank you so much! Najm