0

How should I remove multiple python versions due to which pip is pointing to some other version ?? due this even after successful installation the module is not getting imported??

Following is the error I was getting when I installed imutils successfully but still getting import error.

User-MacBook-Pro:~ user$ sudo pip install imutils

Collecting imutils
Installing collected packages: imutils
Successfully installed imutils-0.5.1
User-MacBook-Pro:~ user$ -H
-bash: -H: command not found
User-MacBook-Pro:~ user$ sudo -H pip install imutils
Requirement already satisfied: imutils in /usr/local/lib/python2.7/site-packages (0.5.1)

Installed imutils for Python2.7 and when I checked whether it is importing imutils library successfully or not then it displayed the following error message:

User-MacBook-Pro:~ user$ python
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 12:01:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>>import imutils
Traceback (most recent call last):
File "", line 1, in 
ImportError: No module named imutils

What is the problem here and how to fix it??

And following is my bin directory which has multiple python versions but I am not able to understand which one to remove??enter image description here

Sumedh Junghare
  • 381
  • 2
  • 4
  • 21
Jasch
  • 19
  • 1
  • 6
  • Possible duplicate of [How to run pip of different version of python using python command?](https://stackoverflow.com/questions/34803040/how-to-run-pip-of-different-version-of-python-using-python-command) – phd Aug 30 '18 at 19:32

1 Answers1

0

If there are multiple versions of Python on your computer, that's probably because you need different versions for the Software you have installed on your computer, or simply because you are working with different versions for different Projects.

Seeing that dependencies and the resolution thereof are a fairly intricate topic, it might be a good idea to use virtual environments to manage different versions, without interfering with an otherwise stable system python.

Once you wrap your head around virtual enviroments, they are not only convenient, but also elegant. Here's an introduction to get you started

MTTI
  • 391
  • 2
  • 10