Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem installing Python API #235

Open
jiveshsem opened this issue Oct 25, 2021 · 0 comments
Open

Problem installing Python API #235

jiveshsem opened this issue Oct 25, 2021 · 0 comments

Comments

@jiveshsem
Copy link

jiveshsem commented Oct 25, 2021

I followed the steps mentioned on the homepage

http://homerreid.github.io/scuff-em-documentation/reference/Installing/#2-installing-on-debianubuntu-based-linux-systems

I installed python-dev through the command

% sudo apt-get install libopenblas-dev libhdf5-openmpi-dev python-dev python3-scipy gmsh

and then the next set of commands

% git clone https://github.com/HomerReid/scuff-em.git
% cd scuff-em
% sh autogen.sh --prefix=${HOME}/scuff-em-installation
% make -j 8 install

Now I have two folders: scuff-em and scuff-em-installation

In scuff-em, there is a libs folder, with python subfolder. I did a "make" there and then a "make install". I get the scuff.py file. But when I import scuff in python (not python3) while in that subfolder, I get the ImportError: _scuff not found. And _scuff is the C library that links to Python.

In scuff-em-installation, there is a lib subfolder, but that does not have many files, and the libscuff.a and libscuff.la files that it does have - I don't know what I can do to get the scuff.py or _scuff module out of it.

I have been trying to look for solutions on installing scuff-em API for Python (or even C), but I didn't get much help online, so I had to report this issue here. Thank you.

EDIT: I checked the config.log file in scuff-em folder. There is an error thrown by conftest.cpp:

conftest.cpp:41:10: fatal error: numpy/arrayobject.h: No such file or directory
   41 | #include <numpy/arrayobject.h>
        |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I have checked and even tried to install numpy all over again: but whether I try pip install numpy or pip3 install numpy it gives me the same message:

Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (1.20.1)

EDIT2: I was able to locate the source of the problem: from config.log, there was a compilation termination when trying to search for numpy/arrayobject.h. Even after installing python-dev this issue was not resolved. I manually found the numpy.get_include() pathway to arrayobject.h and modified the corresponding line in configure. At least now, there is NO compilation terminated in config.log *because of numpy/arrayobject.h (there are still 12 compilation terminated messages for C header files, but Python went through, so I was hoping this should've resolved it). BUT STILL, import scuff throws the ModuleNotFoundError: No module named '_scuff'. There is now a .deps folder in scuff-em/libs/python but it just has one file in it _scuff_la-scuff-python.Plo, with one line in the file: #dummy...

Further from the config.log:

| #include </home/tbit/.local/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h>
configure:15816: result: no
configure:15822: WARNING: disabling Python wrappers
configure:15855: checking tr1/unordered_map usability

so I am not sure if Python wrappers were installed or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant