Skip to content

ImportError: No module named imutils #39

Closed

Description

@Loco123

Hello,
I installed imutils in Ubuntu 16.04 using the next command:

sudo pip apt-get install imutils

I ran "pip list" and show me that imutils (0.4.3) is already installed, but when I tried to use it in a python script:

import imutils

show me the next error:

Traceback (most recent call last):
File "/home/epic/Documentos/python test/OpenCV/curso/test2.py", line 3, in
import imutils
ImportError: No module named imutils

any idea what is wrong?

SALUDOS!!!!!!!!!!

Activity

  1. jrosebr1 commented on Oct 10, 2017

    @jrosebr1
    Contributor

    Hm, I think you have an issue with your command. This is not how you install a package with pip:

    $ sudo pip apt-get install imutils

    You should be doing:

    $ sudo pip install imutils

    To install globally on your system.

    If you are using virtual environments, don't forget the workon command:

    $ workon your_env_name
    $ pip install imutils
  2. Loco123 commented on Oct 10, 2017

    @Loco123
    Author

    My apologize my mistake when I open this "help request", thats right the command is:

    sudo pip install imutils

    I thougt that maybe the problem is that the installation was made under python 3.5 instead of python 2.7, any idea how to fix this problem, I ran again the installation command to see for more information and gave this:

    The directory '/home/epic/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    Requirement already satisfied: imutils in /usr/local/lib/python3.5/dist-packages

    after run with

    sudo -H pip install imutils

    gave me the next message:

    Requirement already satisfied: imutils in /usr/local/lib/python3.5/dist-packages

    any idea how to fix it?

    SALUDOS!!!!

  3. Loco123 commented on Oct 10, 2017

    @Loco123
    Author

    Ok I found the problem, after run:

    sudo -H pip2.7 install imutils

    All workied fine.

    SALUDOS!!!!!

  4. jrosebr1 commented on Oct 11, 2017

    @jrosebr1
    Contributor

    Congrats on resolving the issue!

    I'll go ahead and close this now.

  5. jrosebr1 commented on May 17, 2018

    @jrosebr1
    Contributor

    I'm not an Anaconda user myself but I think there may be some sort of Python/Pip discrepancy between your system version and your Python version. It looks like imutils is installed in Python 3.6. Perhaps trying launching Python 3.6 specific shell and trying the import:

    $ python3
    >>> import imutils
    

    You should of course ensure that python3 is indeed for your Python 3.6 Anaconda install.

  6. jrosebr1 commented on May 18, 2018

    @jrosebr1
    Contributor

    My only suggestion would be to ensure your pip3 actual does indeed point to your Anaconda Python 3.6.2. You may have different Python 3.6 versions installed on your system. Sorry, I'm not sure.

  7. Omkar-Darekar commented on Jun 21, 2018

    @Omkar-Darekar

    After installing imutils on windows by pip install imutils I got this error

    Traceback (most recent call last):
    File "C:\Users\OMKAR\Downloads\real-time-object-detection\real_time_object_detection.py", line 5, in
    from imutils.video import VideoStream
    ImportError: No module named imutils.video

    what should i do????

  8. jrosebr1 commented on Jun 21, 2018

    @jrosebr1
    Contributor

    It sounds like imutils has not been properly installed on your system. Double-check that you have properly installed it into your Anaconda environment and not your system Python.

  9. nanowinner commented on Dec 15, 2018

    @nanowinner

    My only suggestion would be to ensure your pip3 actual does indeed point to your Anaconda Python 3.6.2. You may have different Python 3.6 versions installed on your system. Sorry, I'm not sure.

    This did it for me. I used the instructions found for activating my virtual environment here:
    https://packaging.python.org/guides/installing-using-pip-and-virtualenv/#activating-a-virtualenv

    One activated my console now printed:
    (venv) (base) C:\Users<user>\PycharmProjects\keras-multi-label>

    Since the console was pointing to (venv) I could then install imutils and it was then made available to the project.

    Thanks!

  10. tejasri19 commented on Feb 28, 2019

    @tejasri19

    pip install imutils
    This worked fine with me in conda environment.

  11. iampujan commented on Mar 21, 2019

    @iampujan

    try using this command.
    I faced the same situation and this worked.
    pip install –upgrade imutils (pip3 if python3)

  12. Pupan-cpe commented on Dec 25, 2019

    @Pupan-cpe

    Hm, I think you have an issue with your command. This is not how you install a package with pip:

    $ sudo pip apt-get install imutils

    You should be doing:

    $ sudo pip install imutils

    To install globally on your system.

    If you are using virtual environments, don't forget the workon command:

    $ workon your_env_name
    $ pip install imutils

    Good job!

  13. luisliborio commented on Jan 22, 2020

    @luisliborio

    Hello. I have the same problem. I a virtual env, so, this is the way I installed imutils:

    workon cv
    sudo -H pip3.7 install --upgrade imutils

    it says that it has been successfully installed. but when I do:

    pip3.7 list

    imutils doens't appears on the packages list.

    Can someone help me? None of the above answers had been useful yet. :(

  14. jrosebr1 commented on Jan 24, 2020

    @jrosebr1
    Contributor

    I would strongly recommend that you learn how to use Python virtual environments. You are installing imutils incorrectly. To install it inside a virtualenv you would:

    $ workon your_env_name (or however you access your virtualenv)
    $ pip install imutils
    

    DO NOT use sudo or any other pip commands with specific versions as those will install imutils outisde the virtualenv.

    Again, do not blindly copy and paste commands -- that's a recipe for failure. Learn how the commands work and what they are doing. Spend 10 minutes educating yourself, it will save you hours of frustration.

  15. luisliborio commented on Jan 24, 2020

    @luisliborio

    Thank you very much! I'm sorry for the mistake, I'm new at this whole thing so it's too much information to take in a short time.

    Now it works fine 💃

  16. PoorneshVelineni commented on Apr 10, 2020

    @PoorneshVelineni

    after runing the command "sudo -H pip2.7 install imutils"
    i got the below error
    sudo: pip: command not found
    how to solve this problem

  17. Omkar-Darekar commented on Apr 10, 2020

    @Omkar-Darekar
  18. amrfodd commented on Oct 11, 2020

    @amrfodd

    import pip
    pip.main(['install', 'imutils'])
    Try This in Jupyter Notebook

  19. neha210 commented on Apr 18, 2021

    @neha210

    please can anyone help me out with what command could be helpful to install imutils in jupytor notebook

  20. iampujan commented on Apr 19, 2021

    @iampujan

    please can anyone help me out with what command could be helpful to install imutils in jupytor notebook

    !pip install package_name

  21. bishab commented on May 8, 2021

    @bishab

    import pip
    pip.main(['install', 'imutils'])
    Try This in Jupyter Notebook

    This helped me. Thanks!

  22. miiikan commented on Jan 3, 2022

    @miiikan

    import pip pip.main(['install', 'imutils']) Try This in Jupyter Notebook

    thank you, it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions