No module named 'keras_tuner'

Question:

I’m executing this code on Kaلgle, and install autokeras library on it,

!pip install autokeras
import matplotlib.pyplot as plt 
import pandas as pd 
import datetime
%matplotlib inline


#Control the default size of figures in this Jupyter notebook
%pylab inline 
pylab.rcParams['figure.figsize'] = (14, 9) # Change the size of plots

#cib = pd.read_csv("../input/balmhils1/balmhils1015.csv") 
# load data from csv 
cib_f = pd.read_csv("../input/jkse1234/JKSE.csv") # load data from csv
f, ax = plt.subplots(figsize=(11,8))
plt.xlabel("Number of trading day")
plt.ylabel("Close price")

but I got this error.
No module named ‘keras_tuner’

Asked By: muhammad

||

Answers:

Upgrade the keras_tuner

!pip install keras-tuner --upgrade
Answered By: Prakash Dahal

I had a similar issue using PyCharm. When I installed the keras-tuner package in the Anaconda 3 prompt, I got the message that everything is already installed. The problem was, that the keras-tuner was installed in my base environment and not in the environment (virtual) which I use in PyCharm. You simply need to do the following.

  1. check out your environments in the anaconda prompt using: conda env list
    you will probably see the * on the base environment
  2. now change to your working environment for example conda activate tf_cpu -> tf_cpu needs to be changed by your envs name (see on your list)
  3. install your package such as pip install keras_tuner
Answered By: Sam
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.