Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ImportError: cannot import name 'component' from partially initialized module 'reactpy' (most likely due to a circular import) #1123

Answered by Archmonger
muhammadd8 asked this question in Problem
Discussion options

Current Situation

from reactpy import component, html, run
@component
def hello_world():
 return html.h1("Hello, World!")
run(hello_world)

when i execute this test code, it gives me the error below

Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/home/dev/Desktop/AIML/reactpy.py", line 1, in <module>
 from reactpy import component
ImportError: cannot import name 'component' from partially initialized module 'reactpy' (most likely due to a circular import) (/home/dev/Desktop/AIML/reactpy.py)

reactpy is installed and sample application pages is opening as well.
kindly tell how to cater this issue?

You must be logged in to vote

You cannot name your Python file reactpy, otherwise you are redefining where from reactpy import ... imports from.

Please change your file name.

Replies: 1 comment

Comment options

You cannot name your Python file reactpy, otherwise you are redefining where from reactpy import ... imports from.

Please change your file name.

You must be logged in to vote
0 replies
Answer selected by Archmonger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #1122 on August 01, 2023 21:23.

AltStyle によって変換されたページ (->オリジナル) /