我尝试将 example1.py 用作包,但出现未解决的引用错误。我该如何修复错误。
您可以在下面看到文件夹结构:
PycharmProjects
├── first_folder
│ └── example1.py
│ __init__.py
└── second_folder
└── example2.py
# example1.py
def example_1():
return None
# example2.py
import sys
sys.path.append('/home/user/PycharmProjects/')
from first_folder.example1 import example_1
# i am getting an error at above part