Yaroslav Bulatov
Yaroslav Bulatov

Reputation: 57923

Getting PyCharm to find dependencies under

Is there some way to tell PyCharm where to look for files?

Here's an example, I clone this repo, cd into transformer-xl/pytorch and run train.py and it works because utils is in . which Python interpreter includes in it's list of places it searches for imports.

However, when I open this project in PyCharm, it underlines all instances of utils, is there some way to fix this?

enter image description here

Upvotes: 2

Views: 732

Answers (1)

Shintlor
Shintlor

Reputation: 812

Yes there is. You can define folders of a project as a source:

Settings -> Project: YourProject -> Project Structure

Here mark the folders you want as Project Sources. You can also add different Projects as root folders if you needed.

Upvotes: 4

Related Questions