1

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
林泓寬
  • 13
  • 5
  • check this : https://stackoverflow.com/questions/17443354/install-numpy-on-python3-3-install-pip-for-python3/33964956#33964956 – Loïc Oct 30 '18 at 20:58
  • Take a look in your `$PATH` environment variable. Both `python` and `pip` paths should be the left-most paths in order. – jonathadv Oct 30 '18 at 21:04
  • What is the output of `echo $PATH`? – darthbith Nov 01 '18 at 15:16
  • @darthbith /home/ubuntu/.nvm/versions/node/v9.8.0/bin:/home/ubuntu/bin:/home/ubuntu/miniconda3/bin:/usr/local/rvm/gems/ruby-2.4.0/bin:/usr/local/rvm/gems/ruby-2.4.0@global/bin:/usr/local/rvm/rubies/ruby-2.4.0/bin:/home/ubuntu/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/ubuntu/.cs50/bin:/opt/cs50/bin:/mnt/shared/bin:/home/ubuntu/workspace/node_modules/.bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/mnt/shared/sbin:/opt/gitl:/opt/go/bin:/mnt/shared/c9/app.nw/bin:/home/ubuntu/.local/bin:/usr/local/rvm/bin – 林泓寬 Nov 02 '18 at 17:26
  • I remember I've seen someone's advice to output this on a similar topic, but I have no idea how to work with it. – 林泓寬 Nov 02 '18 at 17:28
  • Right, so the `/opt/pyenv` stuff is probably the cause of this problem. I'm not sure where those are being added, but check your `.bashrc` and `.bash_profile` files and remove those, and you'll probably fix this error – darthbith Nov 06 '18 at 02:24

1 Answers1

0

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.

林泓寬
  • 13
  • 5