Search code examples
pythonjupyter-notebookcloud9-idecs50miniconda

pip and python in same path but different version


Update:

I've found a temporary solution.

/home/ubuntu/miniconda3/bin/pip install package

However, this still makes no sense to me.
Shouldn't "which pip" and "pip -V" show the same pip?

--

Background: I use CS50 IDE(Cloud 9 SDK), which comes with python 3.6
After install miniconda, now I have python 3.7
However, my python go to 3.7 correctly but pip stay on 3.6

I've tried to use pyenv, but miniconda was not there.

My Goal is to use jupyter notebook with the same python version with pip.
(which now is python 3.7, instead of pip is installing packages)

~/workspace/ (master) $ which pip
/home/ubuntu/miniconda3/bin/pip
~/workspace/ (master) $ which python
/home/ubuntu/miniconda3/bin/python
~/workspace/ (master) $ pip -V
pip 18.1 from /opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/pip (python 3.6)
~/workspace/ (master) $ /home/ubuntu/miniconda3/bin/pip -V
pip 10.0.1 from /home/ubuntu/miniconda3/lib/python3.7/site-packages/pip (python 3.7)
~/workspace/ (master) $ python -V
Python 3.7.0

Solution

  • Thanks you darthbith.

    I used ls -la ~/ | more to find .bashrc then I removed it.

    Now the output is.

    ubuntu@ikea-tys-ide50-6506503:~/workspace$ which pip
    /opt/pyenv/shims/pip
    ubuntu@ikea-tys-ide50-6506503:~/workspace$ which python
    /opt/pyenv/shims/python
    ubuntu@ikea-tys-ide50-6506503:~/workspace$ pip -V
    pip 18.1 from /opt/pyenv/versions/3.6.0/lib/python3.6/site-packages/pip (python 3.6)
    ubuntu@ikea-tys-ide50-6506503:~/workspace$ /opt/pyenv/shims/python -V
    Python 3.6.0
    

    It seems a bit of ugly, but indeed it worked!

    I think there might be a better solution to keep the pretty display, also fix the path.

    But I'll say it's solved the core issue.