-
Notifications
You must be signed in to change notification settings - Fork 72
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
No module named 'capytaine.green_functions.libs.Delhommeau_float64' #395
Comments
The error comes from missing compiled Fortran core routines. It occurs for instance when you download the source from the Github repository and run a script from this directory: when importing Capytaine, Python tries to use the content of the nearby How did you install Capytaine and how did you run the script? |
Thanks for the readiness of your answer. I installed Capytaine as a library in a conda environment and after that, I downloaded the GitHub repository. I tried to follow the instructions I found in the library itself. I do not understand what are the Fortran routines that I am missing. How can I get them? |
Then the compiled Fortran routines you need are already installed with
the library in the conda environment. What if you just try to run a
script from somewhere else than the directory with the sources from
Github? My guess is that Python is confused and is using the content of
this source directory and not the library you have already installed.
|
Indeed, I am running the scripts inside the directory downloaded from Github. So, are you advising me to create a new project and paste the scripts (inside Example folders) to make them run? |
This is the error I am finding. |
Yes.
This is the same error as above, but when trying to run the test suite with pytest. What did you try to do? |
Basically, I have taken a copy of the git hub repository and pasted it there changing the name to Capytaine_Hydro: I work with Pycharm and I open the Capytaine_Hydro folder to run the tests using the environment from Anaconda. |
Could you try creating a new Pycharm project, without the Github repository, and associate it with the conda environment in which Capytaine is installed? Then create a new file, for instance with the code below and run it. import capytaine
print(capytaine.__version__) Does it works? The issue is when the Github repository is in your Pycharm project (wherever it is). Then Python is confused because there are two capytaine: one is the "capytaine" directory in the Github repository and the other one is the package in the conda environment. |
I received this answer: C:\Users\0030562\Anaconda3\envs\DEME_simulator\python.exe C:\Users\0030562\PycharmProjects\Hydrodynamic_sim\Test.py Process finished with exit code 0 Therefore, I think indeed the problem is what you have said. But what do you think if I change the names of all the folders from GitHub containing Capytaine in their name? Otherwise, how can I see some examples running? |
Thanks a lot :) |
Renaming just the "capytaine" folder at the top of the Github repository might work. Otherwise, just copy one of the example file into your new Pycharm project. The examples are meant to work independently from anywhere as long as you have Capytaine installed in the environment of your project. |
This issue could be avoided for future users by switching to an src layout instead of the current flat layout. Since Capytaine cannot run without some compilation phase anyway, the flat layout offers no advantage. It just stays there because of legacy. |
Learned recently that the
will not use the local |
I downloaded the 2.0 version of Capytain and tried to run some examples inside the folder but I saw this error.
Inside the path (capytaine-green functions-libs) there is no "Delhommeau_float64" (I hope it can be helpful information)
The text was updated successfully, but these errors were encountered: