Why do I get a ModuleNotFoundError: No module named 'keras' in SublimeText?

788 views Asked by At

Beginner here! I've successfully (I think) set up and installed all the required libraries for Deep Learning environment with Anaconda according to this post but now when I build the following code in SublimeText:

from numpy import loadtxt
from keras.models import Sequential
from keras.layers import Dense

it gives me the error:

ModuleNotFoundError: No module named 'keras'
[Finished in 1.8s with exit code 1]
[cmd: ['/Library/Frameworks/Python.framework/Versions/3.7/bin/python3', '-u', '/Users/Nik/Desktop/keras_first_network.py']]
[dir: /Users/Nik/Desktop]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

I thought it was a compatibility issue so i downgraded Python using conda install python=3.6.4 but the error keep coming up. What's happening?

I've tried downgrading Python to a lower version. When I run the above code directly in Python from the terminal there's no error.

1

There are 1 answers

0
Nik Supatravanij On

Solved! Did a reinstall of Python3 and SublimeText 3 according to sublimetext.com/docs/3/revert.html which solved my problem. Suspect it was just alot of mixed up pathways and pointing so had a hunch a reset would resolve which it did