When I try to install packages (any package) using pip3.6 installations do not go into the correct python version. instead they go into 2.7
$ pip3.6 install sklearn
Collecting sklearn
Downloading sklearn-0.0.tar.gz
Collecting scikit-learn (from sklearn)
Downloading scikit_learn-0.19.1-cp36-cp36m-manylinux1_x86_64.whl (12.4MB)
100% |████████████████████████████████| 12.4MB 138kB/s
Installing collected packages: scikit-learn, sklearn
Running setup.py install for sklearn ... done
Successfully installed scikit-learn-0.19.1 sklearn-0.0
Target directory /usr/lib/python2.7/dist-packages/scikit_learn-0.19.1.dist-info already exists. Specify --upgrade to force replacement.
Target directory /usr/lib/python2.7/dist-packages/sklearn-0.0-py3.6.egg-info already exists. Specify --upgrade to force replacement.
Target directory /usr/lib/python2.7/dist-packages/sklearn already exists. Specify --upgrade to force replacement.
Note the python2.7 in Target directory /usr/lib/python2.7/dist-packages/scikit
even though i am using pip3.6
When I try to import in python3.6, the package is not found
$ python3.6
Python 3.6.1 (default, Feb 7 2018, 17:00:49)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sklearn'
The correct python version is mentioned in the pip3.6 file
$ cat /usr/local/bin/pip3.6
#!/usr/local/bin/python3.6
# -*- coding: utf-8 -*-
import re
import sys
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
And pip3.6 appears to be pointing to the correct python version
$ pip3.6 -V
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
Any thoughts on how to get pip3.6 to install packages in the correct python folders?