[SOLVED] – PyCharm: Unresolved reference issue

[SOLVED] – PyCharm: Unresolved reference issue

Unresolved reference issue is one of the most common problems that novice programmers face. The following article describes possible causes and solutions for the issue.

Let’s look on the example below. As you can see there is a snake.py file contains import graphics. The import is underlined in red. When you hover on t he line you can see the message “unresolved reference graphics”.

Cause 1: Missing graphics.py file

First of all ensure that your source directory contains files you want to include.

Cause 2: Invalid project configuration

Ensure that you have marked source directory as “sources” i project settings. Open File->Settings->Project->Project Structure. Select source directory you want to add to sources list and click “Sources” icon on the top.

At the end… May I ask you for something?

If I helped you solve your problem, please share this post. Thanks to this, I will have the opportunity to reach a wider group of readers. Thank You

3.7 3 votes
Article Rating
Notify of
newest most voted
Inline Feedbacks
View all comments
2 months ago

Thnaks a lot, my issue resolved too

1 month ago

Thanks for sharing!
Solved my issue too 🙂
I’d add right click on the folder to mark it as “source” and wait for about 15 sec
have a nice one!