Setting up Orekit in Anaconda

I am very new to the Orekit community! I am trying to use Orekit with Basemap and Tkinter in Python. I am having a lot of trouble getting the wrapper to function in Spyder.

I used the commands to download Orekit to my virtual environment on the conda-forge channel, and I have the JCC_JDK=C:/Directory path in existence. Now, Python doesn’t have an issue importing the orekit library with the command ‘import orekit’, but as soon as I insert the next line, vm = orekit.initVM(), the following error is output: ‘AttributeError: module ‘orekit’ has no attribute ‘initVM’’. Or when I try to import from orekit.pyhelpers the error is as follows: ‘ModuleNotFoundError: No module named ‘orekit.pyhelpers’; ‘orekit’ is not a package.’

I am a beginner to programming, too. So I am having issues trouble-shooting this on my own. Please let me know other information you might need to help me resolve this issue. I am looking forward to working with Orekit! My theory is that I do not have the transition from Java to Python properly configured on my computer… I really have no clue though. Thanks for your help!


First, check that you are not doing this in a place where you already have a directory called orekit. The python does not find any module somehow. I don’t think this is the activation of the environment, this is likely some installation / directory problem.

Regarding activation, which is likely a second step, if you use the anaconda navigator to launch spyder or ipython it will set the environment prior to launching it.

Thanks for the reply! So now, I have all of the dependent libraries and orekit and the proper versions installed to my environment and no directories with the name orekit. But I get this error:

import orekit

ModuleNotFoundError: No module named ‘orekit’

Any ideas?? I have no idea why Spyder wouldn’t be able to read this if I have all of the libraries and the environment activated in the console.

Another interesting point is that in Visual Studio Code I do not have this error. Instead it states the following:

from . import _orekit
ImportError: DLL load failed: The specified module could not be found.

Hi hard to tell. it really sounds like something is wrong with the installation / activation.

If you co to a command prompt, activate your environment “conda activate myenv” where orekit is installed. Then run python from the comand line and import orekit?

I have done this and I have made sure that all of the dependencies are in the right environment. I think it may have to do with Java DLL… I’ve also looked at many of the other forums you’ve replied to where users have similar issues and I still cannot get it to run!

Questions: in the conda prompt, it says

set "JAVA_HOME=C:\Users\irste\Anaconda3\envs\MAPS\Library"
set "JCC_JDK=C:\Users\irste\Anaconda3\envs\MAPS\Library"

In my Windows Environment Variables settings, the JAVA_HOME path points to

C:\Program Files\AdoptOpenJDK\jdk-\

And there is no path for JCC_JDK. I did set both equal to what the conda prompt said, (by making JCC_JDK manually) but this didn’t do anything.

Do you think there is an issue here? That Java isn’t set up properly?

Thank you so much again for taking this time!

Now, when I run from the command line in the environment like you said, the error is:

ModuleNotFoundError: No module named 'orekit'

But it is definitely installed in the environment!

I have resolved the issue. You are right (of course!). Specifically I used this forum conversation to solve my issue:

Thank you so much, Petrus! It was such a simple fix. I was activating Spyder from Windows Start, not within Anaconda Navigator or Anaconda Prompt.