d4rty
d4rty

Reputation: 4188

Pycharm - Import Module in Python - Different behaviour - MAC vs Windows

My folder structure:

webservices.py starts like this:

from flask import Flask, request
from werkzeug.utils import secure_filename
from backend.csv_utilities import *
import os

Changing webservices.py like this:

from flask import Flask, request
from werkzeug.utils import secure_filename
from csv_utilities import *
import os

works on both; MAC and Windows. But in PyCharm (on MAC, I didn't try on Windows) now I get an error marked on csv_utilitiesand it says: unresolved reference 'csv_utilities'.

Why is this error there? I can run it without problems. Is it a Pycharm issue or am I doing something not in the right way?

Upvotes: 1

Views: 260

Answers (1)

ThReSholD
ThReSholD

Reputation: 698

I had a similar issue once. Try Mark directory as Sources Root option on your backend folder. It worked for me.

Upvotes: 2

Related Questions