I have a working Python 3.6 and the package imutils
is recognized, importable in its shell. Today I installed some packages on my Python 2 for another task, and now my IPython does not recognize imutils
anymore:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-b01afa4ab41d> in <module>()
4 import random
5 import math
----> 6 import imutils
7 import re
8 import time
ImportError: No module named imutils
What's going on? How fragile are these things, seriously.
I run sys.executable
on both environments and the result is the same:
/usr/bin/python3
I checked my Python2 and the package is not installed there:
sudo -H pip2.7 uninstall imutils
Skipping imutils as it is not installed.
Doing this:
/usr/bin/python3 -V
Returns this:
Python 3.6.7
Restarting does not work. I did use sudo commands, installed, uninstalled several times - no luck. Something has screwed up my Python, I think.
P.S: I do use Python3 on my IPython as interpreter.
P.S: I don't use Python 3.4 as a kernel whatsoever, they are all 3.6.
EDIT: Okay it is clear that ROS installation screwed up my Python path since I see this:
os.getenv("PYTHONPATH")
'/home/user/ros_ws/devel/lib/python2.7/dist-packages:/opt/ros/melodic/lib/python2.7/dist-packages'
HOW CAN I SET IT BACK TO WHERE IT WAS BY DEFAULT?