0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Pycharmでimport errorが表示される解決方法

Posted at

djangoでimportしたら違うディレクトリでエラーがでる。

Root
  ∟ Projects
    __init__.py
    manage.py
      ∟ config
      ∟ main
          ∟ decorators
               __init__.py
               login.py
          ∟ utils
               __init__.py
               config.py

原因は、Source RootがRootになっているからなので、ProjectsをSourceRootにしてあげると解決します。

1. ディレクトリを右クリック
2. Mark Directory asを選択
3. Source Rootを選択
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?