Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'utils' #27

Closed
guancheng817 opened this issue Oct 17, 2019 · 1 comment
Closed

ModuleNotFoundError: No module named 'utils' #27

guancheng817 opened this issue Oct 17, 2019 · 1 comment

Comments

@guancheng817
Copy link

hi, thanks for your works. The problem I met is that when I run the following in command line, it could run successfully.

python ./tools/live_demo.py --camera 0

However, when I run in pycharm, i appear the following errors:
Traceback (most recent call last):
File "/mnt/simple-HRNet/scripts/sit_ups.py", line 12, in
from SimpleHRNet import SimpleHRNet
File "/mnt/simple-HRNet/SimpleHRNet.py", line 7, in
from models.detectors.YOLOv3 import YOLOv3
File "/mnt/simple-HRNet/models/detectors/YOLOv3.py", line 12, in
from .yolo.models import Darknet
File "/mnt/simple-HRNet/models/detectors/yolo/models.py", line 10, in
from utils.parse_config import *
ModuleNotFoundError: No module named 'utils'

could you tell me how to solve this problem, thanks a lot.

@stefanopini
Copy link
Owner

Sure!

PyCharm runs the script from the script folder (/mnt/simple-HRNet/scripts/), while the script needs to be run from the project folder (/mnt/simple-HRNet/) as you do when you use the command line.

You just have to:

  • open Run > Edit configurations...
  • Select the script file you want to run
  • Change the working directory from /mnt/simple-HRNet/scripts to /mnt/simple-HRNet
  • Apply changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants