I am unsure what could be causing the error below when I try to build a docker image with python scripts that are using the Orekit Python wrapper. I am also getting an error with another dependency, but Orekit is the main one causing the whole build to fail (when I remove it, it builds fine, but obviously the image will be useless because the whole thing needs Orekit to function).
I have matched the python version I have on my computer to the one in the Dockerfile and the Orekit version I have installed to the version number in “requirements.txt”
I am trying to build the image using powershell prompt (from Anaconda), but I am not using a virtual environment, since all my packages are installed in the global environment.
I have python 3.11.5
Orekit 12.0.1
Here is the error:
2.337 Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
2.579 ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11; 3.0.0 Requires-Python >=3.7, <=3.11
2.579 ERROR: Could not find a version that satisfies the requirement orekit==12.0.1 (from versions: none)
2.579 ERROR: No matching distribution found for orekit==12.0.1
Here is the relevant section of requirements.txt:
orekit==12.0.1
Here is the Dockerfile (pretty standard I think?):
FROM python:3.11.5
WORKDIR /working_python_code
COPY . /app
COPY requirements.txt app/tmp/requirements.txt
RUN python3 -m pip install -r app/tmp/requirements.txt
CMD [“python”, “master_initiator.py”]
So my question is, how do I fix this? and is it even possible to fix this (can the python wrapper of Orekit be dockerized at all? )
Thanks Petrus. I thought I maybe able to get around docker by “packing” Orekit (and other packages) using “conda-pack” (bundling a virtual environment where Orekit is installed).
The creation of the xxx.tar.gz file is fine and it can be activated successfully on any target machine, but somehow Orekit doesn’t get included in the bundling process.
Is this expected or am I doing something wrong ?(I am sure it is installed in the virtual environment on the host machine).
The other problem is that using pip or conda as the package manger is causing massive conflicts as pip overwrites a lot of files that other conda installed packages need…I’ve chosen to stick to conda as I needed to specify version numbers for packages.
I had a quick look at the orekit_jpype package and I might be wrong, but it looked like there will be a few changes needed (to the point where I’d be re-writing a lot of the code-highly dependent on the code of course, but for what I want to do, I can see it will take a bit of time to change everything to orekit_jpype). This is why I’m trying pretty hard to avoid orekit_jpype so far!
So finally, just wondering if you may have any suggestions on how I can get the “common” version of Orekit +other packages into some sort of “bundle”/“image”/“executable”? so that it can be deployed to any other target computer without needed additional setup.
I can re-write in orekit_jpype but if Im doing that, I may as well write it in java (my team knows java not python!).
Any advice would be greatly appreciated
Sounds indeed like staying on the conda version is right and distribution should be solvable.
I have not used conda-pack before but did now and I get a .tar.gz which I can expand and run orekit on. (same machine however). I am using linux and python 3.12.
I think there are successfull packagings with pyinstaller if that could be a path, haven’t used it myself.
Otherwise, have you checked conda environments, if you can have all packages as conda / pip packages?