简体   繁体   中英

ModuleNotFoundError: No module named in ATOM Editor

Atom: 1.39.1

I am getting the below error while running python code from Atom editor.

ModuleNotFoundError: No module named 'foo'

The same code works fine from pycharm.

Note: Due to security reasons, I can't put the entire code here for reference.

I have added all the necessary paths in sys.path & environment variables but not sure why atom alone couldn't recognize python files. Any assistance?

autocomplete python does have some issues. I recommend you use atom python run .

  1. Install the package in atom. Then do the following.

  2. Make sure python is installed on your computer and it's added to your PATH.

  3. Restart atom

  4. To run your (.py) file, hit F5 or F6

If you just want to run python3 through atom: Open the atom-python-run package settings (atom Settings >> packages >> find atom-python-run >> settings)

In the F5 command section, change the default to python3 {file} . 它应该看起来像这样。

Make sure that F5 doesn't interfere with another command from another package. Or else you can use F6 as well.

You should be good to go!

Hope this helps!

I think the reason why this is not working is because there is no folder called venv. In pycharm it has the folder but in atom there is no folder like that. But I don't know to install the venv thing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM