-
Notifications
You must be signed in to change notification settings - Fork 55
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
Error installing graphkernels/GKextCPy: Unable to locate python.h header file. #26
Comments
Sorry to hear this—not aware of this problem, but it's been a while since I was working on this project. Can you try installing everything from source (i.e. from the |
Thank you for the quick response! I have tried to install via src, and I get the output in the following file: I do not see any obvious errors during the installation. However, I seem to come across a second error later on. When I try to call CalculateWLKernel from my script, I get the following error: Is there a separate path that I need to link to be able to locate these attributes? |
That's weird—can you load the module and tell me the output of the following command, please:
|
The following is what is returned from running that command in the python interpreter: ">>> import pathlib, GKextCPy; pathlib.Path(GKextCPy.file).resolve().parent During handling of the above exception, another exception occurred: Traceback (most recent call last): |
This looks to me like the extension module was not installed. Can you try to install this manually as well (from the |
I believe that I have now installed GKextCPy from I ran I get the same error when I repeat the test from above ( |
I don't understand this fully. Is the module maybe already installed (if somewhat partially)? The setup script might refuse to overwrite it. |
I have cleared all the references I can find to the module and tried to install it from source from scratch. After clearing everything, the entire local GraphKernels directory was gone, and there was no listing of either GKextCPy or graphkernels in I re-cloned the repository and both built and installed GKextCPy and then graphkernels. I also built and installed with sudo permissions to ensure no access problems. The following files correspond to each command, such that the When I then run the command above |
Sorry for the hassle here... It seems that the packages are being installed for the root user only. If you use |
It's no problem. I appreciate you taking the time to help with this. I've deleted and re-installed it again to make sure there's no conflict, and I installed it without the --user flag. I seem to be getting the same ModuleNotFoundError when running the test command. Do I need to run the command from within a specific directory to ensure that all packages are locate-able? When I run the test from somewhere outside of the GraphKernels directories, I get the ModuleNotFoundError above: When I run within And when I run within the During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Still looks like there's something wrong with the installation. I see that you have Anaconda active as well. Can you try installing it in the Anaconda environment using |
(I just pushed a simplified module installation fix, but that should not apply to your issue, unfortunately. If we can't get anywhere, the main developers @mahito-sugiyama or @eghisu might want to weigh in.) |
When you say to install it in the Anaconda environment, do you mean using pip to install it? Or do you mean to install it into the directories for the conda packages? |
I mean installing it using |
The package is within my /opt directory, so it has limited permissions by default. To account for that, I have now added write permissions (using chmod +w) to each of the directories of GraphKernels so that the build process can create what it needs to. Afterward, I ran Requirement already satisfied: numpy in /opt/anaconda3/lib/python3.9/site-packages (1.21.5) |
Do you have the dev files for Python installed within your Anaconda environment? I think the command you ran at the very beginning only installs them for your global installation. I am not sure I understand the discussion on the |
I confirmed that I already have the devtools within the conda environment: $ conda install -c conda-forge python-devtools Additionally, I have cloned the repository into my home directory and tried to build GKextCPy from there, but I seem to get the same 'Python.h: No such file or directory' error. Specifically, when I run |
Things are getting curiouser and curiouser. Can you check where the file exists for your current Python installation? (It seems at this point that this is not necessary a problem with our |
The following are the paths I know of related to Python: Python binary: Is there a separate python file or directory that would be helpful to locate? |
What I find weird is that the second directory is not being used during the setup process. Can you try providing this directory as an additional |
Thank you for being patient while I work on this. It seems that the place that This update allowed GKextCPy and graphkernels to build and install from src seemingly without errors. However, when I try to run the test import command above (
|
Hmm, what I don't understand about this issue is that the Anaconda headers should 'live' under a different path than Can you please attach the output of (Not the main developer here; at this point I would really appreciate any additional input from @mahito-sugiyama or @eghisu) |
I was able to locate a separate version of the Python headers under the Anaconda installation at I also removed any existing versions of the Graphkernels repository on my system to ensure that there is not an existing installation elsewhere on the system being identified. And I recloned it into my home directory. Then I take the following steps:
|
OK, now there appears to be an issue with the linker dependencies. Is this the same environment? Might be an issue between the system C++ compiler and the Anaconda one. Can you check stan-dev/pystan#294 for a potential workaround? At this point, it seems that we are fighting a losing battle—maybe consider trying the GraKeL library? |
Hello!
I want to install graphkernels, and am receiving the output at the following file when using the command:
pip --no-cache-dir install graphkernels
:graphkernels_install_err.txt
The main error from this seems to be "Python.h: No such file or directory". My understanding is that this usually means that pythonX.Y-dev must be installed according to the python version used.
I have confirmed that I do have python3.9-dev installed corresponding to my version of python using the command
sudo apt-get install python3.9-dev
, which gave the output "python3.9-dev is already the newest version (3.9.13-1+jammy1)." And the Python.h file exists on my system at/usr/include/python3.9/Python.h
.Is there something else I should do to install the package?
The text was updated successfully, but these errors were encountered: