Closed swedishmike closed 3 years ago
Hi Mike,
That is weird. I just tried this from scratch on a new project, same version of PyCharm (but on macOS) and it worked fine. Is there already a file named service.py or something installed in the environment that is a package called service
?
Hi Michael,
I'm a black belt in weird computer behavior... ;)
Thanks for getting back to me - I can't find anything else in the environment but I'll create a new venv, just in case, and see if that helps.
There is of course the empty service.py that's in the directory when I clone the repo from here - I can try and delete that one and try again?
Cheers, Mike
Yes, that is it probably. Try deleting the service.py file.
On Mon, Oct 8, 2018 at 9:13 AM Mike Eriksson notifications@github.com wrote:
Hi Michael,
I'm a black belt in weird computer behavior... ;)
Thanks for getting back to me - I can't find anything else in the environment but I'll create a new venv, just in case, and see if that helps.
There is of course the empty service.py that's in the directory when I clone the repo from here - I can try and delete that one and try again?
Cheers, Mike
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/talkpython/mastering-pycharm-course/issues/16#issuecomment-427893543, or mute the thread https://github.com/notifications/unsubscribe-auth/AB8Pafhw9InmB7s2wJUuC5NczGqIgAGcks5ui3m7gaJpZM4XLzvW .
That didn't resolve it - however, if I marked the 'smelly_podcast' directory as 'sources root' it works.
Many thanks for getting back to me - sometimes a bit of feedback is all that's needed to push me in the right direction. ;)
You're welcome. It's interesting that it had to do with "sources root". Thanks for digging that one up!
Same problem here. The refactoring move to service.py is prevented "cannot move module", until the folder containing both files is made a source root. Perhaps it would help to mention this in the video.
Hi @hewettp You're right about that sources root, depending on how you've opened the project you're editing. I'll add some info about this to the readme.
The error message may be underlying a different issue
PY-55436 Cannot use module name "..." in imports doesn't indicate the problem source
When I try to do the first part of the Large module smell exercise I get the following error:
The steps I'm trying to do is:
I'm not sure if I'm doing it the wrong way or if it might have something do do with my OS and/or version of PyCharm.
I'm running version 2018.2 on Xubuntu 16.04.