Vithika joshi
Vithika joshi

Reputation: 9

Not able to import file as module in pycharm

I am trying to import a function from a file mydate.py which returns current date to another file using Pycharm but Pycharm is not detecting that function of the file. To do so I am using the following lines

from mydate import curdate

but Pycharm is not able to find this function.

Upvotes: 0

Views: 69

Answers (1)

Laurent LAPORTE
Laurent LAPORTE

Reputation: 22942

You need to mark a folder as a source root.

See https://www.jetbrains.com/help/pycharm/project-structure.html

Upvotes: 1

Related Questions