question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError during selfcheck

See original GitHub issue

Trying to install metview-python in a fresh anaconda environment (Python 3.8) on my Ubuntu 20.04.

1. Install Metview

conda install metview -c conda-forge

This succesfully installs Metview version 5.13.1 (51301, 64-bit). Calling metview open the GUI of metview.

2. Install Metview-python

conda install metview-python -c conda-forge

Runs without error and installs version 1.8.1. However when running the selfcheck

python -m metview selfcheck

it throws

Traceback (most recent call last):
  File "/home/nrieger/anaconda3/envs/ecmwf/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/nrieger/anaconda3/envs/ecmwf/lib/python3.8/runpy.py", line 144, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/home/nrieger/anaconda3/envs/ecmwf/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/nrieger/anaconda3/envs/ecmwf/lib/python3.8/site-packages/metview/__init__.py", line 35, in <module>
    from . import style
  File "/home/nrieger/anaconda3/envs/ecmwf/lib/python3.8/site-packages/metview/style.py", line 20, in <module>
    from metview.param import ParamInfo
  File "/home/nrieger/anaconda3/envs/ecmwf/lib/python3.8/site-packages/metview/param.py", line 12, in <module>
    from metview import dataset
  File "/home/nrieger/anaconda3/envs/ecmwf/lib/python3.8/site-packages/metview/dataset.py", line 24, in <module>
    from metview.track import Track
  File "/home/nrieger/anaconda3/envs/ecmwf/lib/python3.8/site-packages/metview/track.py", line 17, in <module>
    from metview.style import Style
ImportError: cannot import name 'Style' from partially initialized module 'metview.style' (most likely due to a circular import) (/home/nrieger/anaconda3/envs/ecmwf/lib/python3.8/site-packages/metview/style.py)

Interestingly, when starting Python within a terminal,

import metview as mv
mv.lowercase('Hello World!')

works without problems.

When running a simple test script to download data from ECMWF’s Mars catalogue, no data is downloaded but no error is thrown neither. It just simply runs forever although test data which is to be download is very tiny.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
iainrussellcommented, Oct 26, 2021

Hi @nicrie , this is strange - for me, the same environment successfully runs your script and gets the file! My current suspicion is that there’s something wrong in your .ecmwfapirc file, maybe a stray character. I think that’s what your error message is telling you, an invisible 0x23 character in your file, although it is printing ‘#’ as the value of it, so perhaps you have a comment in your file, but the JSON format does not permit such things so that would be the error.

1reaction
iainrussellcommented, Oct 26, 2021

Hi, it might be ok, it’s just the dying cries of Metview being shut down at the end of the process, but the messages are a bit scary if you’re not used to them! It looks like it worked, I think your file should be there now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Import Error: cannot import name 'self_check ...
Using Anaconda, I installed the libraries and active both (tensorflow and tensorflow-gpu) I have also installed Keras in this anaconda ...
Read more >
importError
I run 'python manage.py runserver'. but this message appear. Traceback (most recent call last):. File "C:\Users\gkfka\PycharmProjects ...
Read more >
Error reporting returns a circular import error on a python ...
In Django 2.2.1, a python formatting error, such as a NameError or IndentationError will give the error shown below: Exception in thread django-main-thread: ......
Read more >
Source code for fs.osfs
In essence, an `OSFS` is a thin layer over the `io` and `os` modules of the ... stat import tempfile try: from os...
Read more >
cannot import name 'self_check' | Onephin - YouTube
Tensorflow | Import Error : cannot import name 'self_check' ... If yes support us on Patreon https://www.patreon.com/onephin For More Updates ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found