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.

circular (or cyclic) import problem occurred in doctest of rdkit_utils.py

See original GitHub issue

🐛 Bug

While running doctest on deepchem/utils/rdkit_utils.py, an error occurred which suggested that may be, the file: deepchem/utils/typing.py having the same name as the module it imports (typing), is causing the circular (or cyclic) import problem.

To Reproduce

Steps to reproduce the behavior:

  1. open terminal from deepchem/utils
  2. python -m doctest rdkit_utils.py
  3. Following error is reported:-

image

Expected behavior

There should not be any problem importing type annotations from the typing module or importing from the deepchem.utils.typing file.

Environment

  • OS: Ubuntu 20.04.3 LTS
  • Python version: Python 3.8.8
  • DeepChem version: 2.6.1
  • RDKit version (optional):
  • TensorFlow version (optional):
  • PyTorch version (optional):
  • Any other relevant information: NA

Additional context

https://stackoverflow.com/questions/744373/circular-or-cyclic-imports-in-python

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
arunppsgcommented, Jul 7, 2022

@arunppsg So, how does CI run the doctests? Hope it is the same way as you told me to do.

CI runs from the root folder of the repository.

0reactions
ARY2260commented, Jul 7, 2022

@arunppsg So, how does CI run the doctests? Hope it is the same way as you told me to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What happens when using mutual or circular (cyclic) imports?
I'm using python 3.7.2 and am still having a runtime error because of circular dependencies. – Richard Whitehead. Mar 15, 2019 at 10:19....
Read more >
Python Circular Import Problem and Solutions
Generally, the Python Circular Import problem occurs when you accidentally name your working file the same as the module name and those...
Read more >
Why cyclic dependency errors occur - a look into the Python ...
In simplest terms, a circular import occurs when module A tries to import and use an object from module B, while module B...
Read more >
Python Circular Imports Module: Solving Circular Import Problem
Python Circular Imports is a type of Circular dependency. It occurs in python when two or more models import each other and it...
Read more >
So you got a circular import in Python. | by Hadrien Hamana
You're just done writing code and you launch your app to see how it works; Here it is, you see this dreaded circular...
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