How to get Pycharm to resolve "downward" file paths?
I've got a directory structure like
parent/
bin/
src/
x/
y/
a/
b/
file1
file2
c/
file3
I'm trying to import functions from file2 into file1, but pycharm keeps giving me import errors and I have no idea how to solve this. Pycharm is able to traverse up, so I can say "from .file2 import x" but not down, so I can't say from y.b.file2 or anything like that.
How can I fix this?
parent/
bin/
src/
x/
y/
a/
b/
file1
file2
c/
file3
I'm trying to import functions from file2 into file1, but pycharm keeps giving me import errors and I have no idea how to solve this. Pycharm is able to traverse up, so I can say "from .file2 import x" but not down, so I can't say from y.b.file2 or anything like that.
How can I fix this?
请先登录再写评论。
If you mark y as the source directory and if it is not the case for your project, you will not be able to run it outside of PyCharm, because your Python path will not include path to y.