Can't get Python wrapper to work

I had my computer re-imaged and had to setup my Orekit installation. I can’t get the Python wrapper to work again. I have tried it on both Anaconda/Spyder and PyCharm. In Anaconda the Conda-Forge channel used to work for loading Orekit but not currently. I have also tried various repositories in PyCharm to load Orekit but with no success. I would appreciate any assistance if someone has figured out how to get this working. Thanks. (I am running Windows 10 on a HP ZBook G5)

Hi,

How exactly did you try to install Orekit in Anaconda? In the (base) environment or did you create a new environment?
I would recommend to create a YAML environment file containing all the dependencies for your project. A minimal example would be:

name: myCondaEnvironment
channels:
  - conda-forge
  - defaults
dependencies:
  - python
  - orekit

(In addition, you probably need numpy, etc.)

Then from Anaconda Navigator, in the “Environments” tab, select “Import” and choose your YAML file.

Cheers
Clément

Hi,

What kind of error message do you get?

Make sure that the conda environment is activated, it needs to be in order to get the path’s and some environment variables set. If you launch spyder from the anaconda launcher it is automatically set. If you use PyCharm, you either need to activate and then run pycharm, but the best way for pycharm is to use what is called conda-wrappers that automatically activates the environment when a special python is executed.

See

Let us know what error message you get, I run it on windows 10 so likely just the paths…

Regards
/Petrus

I followed Clément instructions and created the YAML file and created the environment. I re-started Anaconda and saw Orekit in the environment:

However when I go to launch Spyder I get the following error:

CondaHTTPError: HTTP 000 CONNECTION FAILED for url
https://repo.anaconda.com/pkgs/main/win-64/repodata.json.bz2

Elapsed: -

An HTTP error occurred when trying to retrieve this
URL.
HTTP errors are often intermittent, and a simple retry will get you
on your way.

If your current network has https://www.anaconda.com blocked,
please file
a support request with your network engineering team.

SSLError
(MaxRetryError(‘HTTPSConnectionPool(host=‘repo.anaconda.com’, port=443): Max retries
exceeded with url: /pkgs/main/win-64/repodata.json.bz2 (Caused by
SSLError(SSLError(“bad handshake: Error([(‘SSL routines’,
‘tls_process_server_certificate’, ‘certificate verify failed’)])”)))’))

When I try to add Orekit to PyCharm packages I get the following error:

Looking in indexes: https://www.orekit.org/forge/projects/orekit-python-wrapper/
Collecting Orekit
Could not fetch URL https://www.orekit.org/forge/projects/orekit-python-wrapper/orekit/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘www.orekit.org’, port=443): Max retries exceeded with url: /forge/projects/orekit-python-wrapper/orekit/ (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)’))) - skipping

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)’))’: /forge/projects/orekit-python-wrapper/orekit/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)’))’: /forge/projects/orekit-python-wrapper/orekit/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)’))’: /forge/projects/orekit-python-wrapper/orekit/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)’))’: /forge/projects/orekit-python-wrapper/orekit/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)’))’: /forge/projects/orekit-python-wrapper/orekit/
ERROR: Could not find a version that satisfies the requirement Orekit (from versions: none)
ERROR: No matching distribution found for Orekit

What is frustrating is that Orekit use to work in my Anaconda/Spyder setup before my PC was re-imaged. I appreciate your assistance with this.

Stephen

Hi,

I do not understand this, there seems to be some issue with the internet connections / certificates but no idea why it is trying to access the orekit forge url.

The first step is to understand if orekit is installed in the environment, second step is to find if there are any environment issues.

On the screenshot you included it looks indeed as it is installed, but after installation it should not access the anaconda site, which there seems to be some issues with reading your log.

To see if orekit is properly installed, select the Orekit environment in the home view, and then launch a simple prompt like the qtconsole by clicking its icon and issue the basic imports and startup as in the screenshot:

image

If it is not installed properly and this fails, I think the command prompt is the safest as there seems to be some issue:

Open the “Anaconda Prompt” from start menu in Windows. Type

conda activate orekitEnvironment

check which version is installed by

conda list orekit

Should be if not installed, install with

conda install -c conda-forge orekit

And let us know the results…

Petrus,
Thanks for the reply. Due to the SSL issues, I asked our IT person to run Anaconda as adminstrator and then I imported the *.YAML file
name: orekitEnv1
channels:

  • conda-forge
  • defaults
    dependencies:
  • python
  • spyder
  • orekit
  • numpy
  • poliastro

I was then able to activate this environment and get Orekit working. Thank you and Clement for your assistance.

Stephen

Great you got it working!

You should maybe ask the administrator to look at the installation and why it needed admin rights, one of the advantages with the anaconda distribution is that it should be possible to install in user space, which is good if you need to update some package in the future or create a new environment.

Regards
/Petrus