Skip to content
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

ImportError: cannot import name 'driver' from partially initialized module 'celerite2' (most likely due to a circular import) #96

Open
eas342 opened this issue Nov 20, 2023 · 2 comments

Comments

@eas342
Copy link

eas342 commented Nov 20, 2023

I am happily using celerite2 with no issues on my local computer, but encountered a problem when importing celerite2 on readthedocs. I found a workaround but am posting here in case anyone has the same issue.

Full Read The Docs traceback Running Sphinx v7.2.6 1.12.5

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 358, in eval_config_file
exec(code, namespace) # NoQA: S102
^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/checkouts/latest/docs/conf.py", line 24, in
import jtow
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/checkouts/latest/jtow/init.py", line 7, in
from . import jtow
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/checkouts/latest/jtow/jtow.py", line 53, in
from tshirt.pipeline import phot_pipeline
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/init.py", line 2, in
from .pipeline import phot_pipeline, spec_pipeline, analysis, prep_images
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/init.py", line 1, in
from . import phot_pipeline
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/phot_pipeline.py", line 51, in
from .instrument_specific import rowamp_sub
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/instrument_specific/init.py", line 3, in
from . import rowamp_sub
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/instrument_specific/rowamp_sub.py", line 16, in
import celerite2
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/celerite2/init.py", line 4, in
from . import terms
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/celerite2/terms.py", line 22, in
from . import driver
ImportError: cannot import name 'driver' from partially initialized module 'celerite2' (most likely due to a circular import) (/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/celerite2/init.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/sphinx/cmd/build.py", line 293, in build_main
app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/sphinx/application.py", line 211, in init
self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 181, in read
namespace = eval_config_file(filename, tags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 371, in eval_config_file
raise ConfigError(msg % traceback.format_exc()) from exc
sphinx.errors.ConfigError: There is a programmable error in your configuration file:

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 358, in eval_config_file
exec(code, namespace) # NoQA: S102
^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/checkouts/latest/docs/conf.py", line 24, in
import jtow
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/checkouts/latest/jtow/init.py", line 7, in
from . import jtow
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/checkouts/latest/jtow/jtow.py", line 53, in
from tshirt.pipeline import phot_pipeline
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/init.py", line 2, in
from .pipeline import phot_pipeline, spec_pipeline, analysis, prep_images
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/init.py", line 1, in
from . import phot_pipeline
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/phot_pipeline.py", line 51, in
from .instrument_specific import rowamp_sub
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/instrument_specific/init.py", line 3, in
from . import rowamp_sub
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/instrument_specific/rowamp_sub.py", line 16, in
import celerite2
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/celerite2/init.py", line 4, in
from . import terms
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/celerite2/terms.py", line 22, in
from . import driver
ImportError: cannot import name 'driver' from partially initialized module 'celerite2' (most likely due to a circular import) (/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/celerite2/init.py)

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 358, in eval_config_file
exec(code, namespace) # NoQA: S102
^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/checkouts/latest/docs/conf.py", line 24, in
import jtow
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/checkouts/latest/jtow/init.py", line 7, in
from . import jtow
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/checkouts/latest/jtow/jtow.py", line 53, in
from tshirt.pipeline import phot_pipeline
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/init.py", line 2, in
from .pipeline import phot_pipeline, spec_pipeline, analysis, prep_images
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/init.py", line 1, in
from . import phot_pipeline
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/phot_pipeline.py", line 51, in
from .instrument_specific import rowamp_sub
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/instrument_specific/init.py", line 3, in
from . import rowamp_sub
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/tshirt/pipeline/instrument_specific/rowamp_sub.py", line 16, in
import celerite2
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/celerite2/init.py", line 4, in
from . import terms
File "/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/celerite2/terms.py", line 22, in
from . import driver
ImportError: cannot import name 'driver' from partially initialized module 'celerite2' (most likely due to a circular import) (/home/docs/checkouts/readthedocs.org/user_builds/jtow/envs/latest/lib/python3.11/site-packages/celerite2/init.py)

More information is available from this failed build:
https://readthedocs.org/api/v2/build/22591584.txt

This was with Python 3.11

@eas342
Copy link
Author

eas342 commented Nov 20, 2023

I found that I could make this error go away when I changed my .readthedocs.yaml file's Python version from 3.11 to

# Set the version of Python and other tools you might need
build:
  os: ubuntu-22.04
  tools:
    python: "3.10"

@dfm
Copy link
Member

dfm commented Nov 20, 2023

I expect that this is happening because 3.10 wheels are available on PyPI, but they aren't for 3.11. (Although I'm not sure why the source build is failing!)

We'll have a new release soon, which will include wheels for 3.11 and 3.12!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants