Config Router

  • Google Sheets
  • CCNA Online training
    • CCNA
  • CISCO Lab Guides
    • CCNA Security Lab Manual With Solutions
    • CCNP Route Lab Manual with Solutions
    • CCNP Switch Lab Manual with Solutions
  • Juniper
  • Linux
  • DevOps Tutorials
  • Python Array
You are here: Home / Unresolved reference issue in PyCharm

Unresolved reference issue in PyCharm

August 1, 2021 by James Palmer

Manually adding it as you have done is indeed one way of doing this, but there is a simpler method, and that is by simply telling pycharm that you want to add the src folder as a source root, and then adding the sources root to your python path.
This way, you don’t have to hard code things into your interpreter’s settings:

Add src as a source content root:

                           

Then make sure to add add sources to your PYTHONPATH under:
Preferences ~ Build, Execution, Deployment ~ Console ~ Python Console

Now imports will be resolved:

                     

This way, you can add whatever you want as a source root, and things will simply work. If you unmarked it as a source root however, you will get an error:
                                 

After all this don’t forget to restart. In PyCharm menu select: File –> Invalidate Caches / Restart

check for __init__.py file in src folder
add the src folder as a source root
Then make sure to add add sources to your PYTHONPATH (see above)
in PyCharm menu select: File –> Invalidate Caches / Restart

Related

Filed Under: Uncategorized

Recent Posts

  • How do I give user access to Jenkins?
  • What is docker volume command?
  • What is the date format in Unix?
  • What is the difference between ARG and ENV Docker?
  • What is rsync command Linux?
  • How to Add Music to Snapchat 2021 Android? | How to Search, Add, Share Songs on Snapchat Story?
  • How to Enable Snapchat Notifications for Android & iPhone? | Steps to Turn on Snapchat Bitmoji Notification
  • Easy Methods to Fix Snapchat Camera Not Working Black Screen Issue | Reasons & Troubleshooting Tips to Solve Snapchat Camera Problems
  • Detailed Procedure for How to Update Snapchat on iOS 14 for Free
  • What is Snapchat Spotlight Feature? How to Make a Spotlight on Snapchat?
  • Snapchat Hack Tutorial 2021: Can I hack a Snapchat Account without them knowing?

Copyright © 2025 · News Pro Theme on Genesis Framework · WordPress · Log in