ModuleNotFoundError: No module named 'imageai'

11,161

Solution 1

Terensflow didn’t support Python 3.7 need to download python 3.6 uninstall python 3.7 and install all with python 3.6

Solution 2

Your First need to download this ImageAI whl file and from here. https://github.com/OlafenwaMoses/ImageAI/releases/download/2.0.2/imageai-2.0.2-py3-none-any.whl

Run following

pip install imageai-2.0.2-py3-none-any.whl

Solution 3

Also, you can install ImageAI directly from PyPi

pip3 install imageai --upgrade
Share:
11,161

Related videos on Youtube

עמית לוינזון
Author by

עמית לוינזון

Updated on June 04, 2022

Comments

  • עמית לוינזון
    עמית לוינזון almost 2 years

    I am tring to install the object detection or imageai for python in Pycharm. I did all the installation method but this shows me the error ModuleNotFoundError: No module named 'imageai'


    This is my code

    from imageai.Prediction import ImagePrediction
    import os
    execution_path = os.getcwd()
    
    
    prediction = ImagePrediction()
    prediction.setModelTypeAsResNet()
    prediction.setModelPath(os.path.join(execution_path, "resnet50_weights_tf_dim_ordering_tf_kernels.h5"))
    prediction.loadModel()
    
    
    predictions, probabilities = prediction.predictImage(os.path.join(execution_path, "1.jpg"), result_count=5 )
    for eachPrediction, eachProbability in zip(predictions, probabilities):
        print(eachPrediction , " : " , eachProbability)
    

    What do I need to do to fix it? I am new to python please help me.


    the output

     Traceback (most recent call last):
      File "C:/Python37/files/FirstPrediction/FirstPrediction.py", line 1, in <module>
        from imageai.Prediction import ImagePrediction
    ModuleNotFoundError: No module named 'imageai'
    

    C:\Users\משתמש>pip show imageai
    Name: imageai
    Version: 2.0.2
    Summary: A flexible Computer Vision and Deep Learning library for applications and systems.
    Home-page: https://moses.specpal.science
    Author: Moses Olafenwa and John Olafenwa
    Author-email: UNKNOWN
    License: MIT
    Location: c:\python37\lib\site-packages
    Requires:
    Required-by:
    

    C:\Users\משתמש>pip -V
    pip 18.1 from c:\python37\lib\site-packages\pip (python 3.7)
    
    • Mehran Torki
      Mehran Torki over 5 years
      How did you install the imageai module? using pip ?
    • Eskapp
      Eskapp over 5 years
      To add to the question above: in which terminal? The one embedded in pycharm or the one of the system? Most secure way of doing this when you begin is by using the Pycharm terminal that directly installs the module in the environment set for the project.
    • smm
      smm over 5 years
      Also, in which environment are you using? If it is conda/venv then you will need to change it in "project interpreter settings" in pycharm.
    • עמית לוינזון
      עמית לוינזון over 5 years
      I using pip to install and my project on pycharm
    • עמית לוינזון
      עמית לוינזון over 5 years
      @MehranTorki yes I use pip
    • עמית לוינזון
      עמית לוינזון over 5 years
      @smm I don’t understand what I need to do can you make an example
    • Boxer Robert
      Boxer Robert over 5 years
      have you solved this problem even i face same @עמיתלוינזון
  • gehbiszumeis
    gehbiszumeis almost 4 years
    Please put your answer always in context instead of just pasting code. See here for more details.
  • james-see
    james-see over 2 years
    This is actually very useful in case you need to install offline. You download first then install locally from the whl file itself. Thank you.