tbenthompson / okada_wrapper

MATLAB and Python wrappers of the Okada Green's functions.
MIT License
67 stars 33 forks source link

Error on Python Installation #7

Closed ditafaith closed 1 year ago

ditafaith commented 1 year ago

Hi, I completed installed and try to runninh command test_okada.py, however, there is an error as follows,

ModuleNotFoundError: No module named 'DC3D' Is there any missing library ?

tbenthompson commented 1 year ago

Hi. Typically that means that either the installation failed or you're not using the same Python installation/virtualenv where you installed the package.

tbenthompson commented 1 year ago

If you share a bit more info, I can try to help debug.

ditafaith commented 1 year ago

If you share a bit more info, I can try to help debug.

I use python 3.8 version and so far no problem with existing software use python. Is there any python library that must installed ?

Here the result after run command python setup.py install

INFO: CCompilerOpt.init[781] : load cache from file -> /home/saka/work/okada_wrapper/build/temp.linux-x86_64-cpython-38/ccompiler_opt_cache_ext.py INFO: CCompilerOpt.init[792] : hit the file cache INFO: get_default_fcompiler: matching types: '['arm', 'gnu95', 'intel', 'lahey', 'pg', 'nv', 'absoft', 'nag', 'vast', 'compaq', 'intele', 'intelem', 'gnu', 'g95', 'pathf95', 'nagfor', 'fujitsu']' INFO: customize ArmFlangCompiler WARN: Could not locate executable armflang INFO: customize Gnu95FCompiler INFO: Found executable /usr/bin/gfortran INFO: customize Gnu95FCompiler INFO: customize Gnu95FCompiler using build_ext running install_lib creating /usr/lib/python3.8/site-packages error: could not create '/usr/lib/python3.8/site-packages': Permission denied INFO: ########### EXT COMPILER OPTIMIZATION ########### INFO: Platform : Architecture: x64 Compiler : gcc

CPU baseline : Requested : 'min' Enabled : SSE SSE2 SSE3 Flags : -msse -msse2 -msse3 Extra checks: none

CPU dispatch : Requested : 'max -xop -fma4' Enabled : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_KNM AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL Generated : none INFO: CCompilerOpt.cache_flush[825] : write cache to path -> /home/saka/work/okada_wrapper/build/temp.linux-x86_64-cpython-38/ccompiler_opt_cache_ext.py

This is after run python test_okada.py Traceback (most recent call last): File "test_okada.py", line 1, in from okada_wrapper import dc3d0wrapper, dc3dwrapper File "/home/saka/work/okada_wrapper/okada_wrapper/init.py", line 4, in from okada_wrapper.okada_wrapper import dc3d0wrapper, dc3dwrapper File "/home/saka/work/okada_wrapper/okada_wrapper/okada_wrapper.py", line 1, in from DC3D import dc3d0, dc3d ModuleNotFoundError: No module named 'DC3D'

tbenthompson commented 1 year ago

The error is:

creating /usr/lib/python3.8/site-packages error: could not create '/usr/lib/python3.8/site-packages': Permission denied

You are failing to install the package because you are installing into your system Python installation and do not have permission to do that. sudo would help but you should also consider using a virtualenv or conda env

Hope that helps!

ditafaith commented 1 year ago

It's done, after perform sudo.

running install_lib copying build/lib.linux-x86_64-3.8/DC3D.cpython-38-x86_64-linux-gnu.so -> /usr/local/lib/python3.8/dist-packages creating /usr/local/lib/python3.8/dist-packages/okada_wrapper copying build/lib.linux-x86_64-3.8/okada_wrapper/init.py -> /usr/local/lib/python3.8/dist-packages/okada_wrapper copying build/lib.linux-x86_64-3.8/okada_wrapper/okada_wrapper.py -> /usr/local/lib/python3.8/dist-packages/okada_wrapper byte-compiling /usr/local/lib/python3.8/dist-packages/okada_wrapper/init.py to init.cpython-38.pyc byte-compiling /usr/local/lib/python3.8/dist-packages/okada_wrapper/okada_wrapper.py to okada_wrapper.cpython-38.pyc running install_egg_info Writing /usr/local/lib/python3.8/dist-packages/okada_wrapper-18.12.07.3.egg-info running install_clib customize UnixCCompiler

However, it still has error as follows, Traceback (most recent call last): File "test_okada.py", line 1, in from okada_wrapper import dc3d0wrapper, dc3dwrapper File "/home/saka/work/okada_wrapper/okada_wrapper/init.py", line 4, in from okada_wrapper.okada_wrapper import dc3d0wrapper, dc3dwrapper File "/home/saka/work/okada_wrapper/okada_wrapper/okada_wrapper.py", line 1, in from DC3D import dc3d0, dc3d ImportError: /usr/local/lib/python3.8/dist-packages/DC3D.cpython-38-x86_64-linux-gnu.so: undefined symbol: Npy__PyLong_AsInt

tbenthompson commented 1 year ago

Perhaps the comments here would help? https://stackoverflow.com/questions/29080596/undefined-symbol-when-importing-f2py-module-using-python-3