简体   繁体   English

pip和python位于相同路径但版本不同

[英]pip and python in same path but different version

Update: 更新:

I've found a temporary solution. 我找到了一个临时解决方案。

/home/ubuntu/miniconda3/bin/pip install package / home / ubuntu / miniconda3 / bin / pip安装包

However, this still makes no sense to me. 但是,这对我来说仍然毫无意义。
Shouldn't "which pip" and "pip -V" show the same pip? “哪个点”和“点-V”不应该显示相同的点吗?

-- -

Background: I use CS50 IDE(Cloud 9 SDK), which comes with python 3.6 背景:我使用python 3.6随附的CS50 IDE(Cloud 9 SDK)
After install miniconda, now I have python 3.7 安装miniconda之后,现在我有了python 3.7
However, my python go to 3.7 correctly but pip stay on 3.6 但是,我的python正确地转到了3.7,但pip仍然保持在3.6

I've tried to use pyenv, but miniconda was not there. 我尝试使用pyenv,但是miniconda不存在。

My Goal is to use jupyter notebook with the same python version with pip. 我的目标是将具有相同python版本的jupyter笔记本与pip一起使用。
(which now is python 3.7, instead of pip is installing packages) (现在是python 3.7,而不是pip正在安装软件包)

~/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

Thanks you darthbith. 谢谢你达斯比。

I used ls -la ~/ | more 我用ls -la ~/ | more ls -la ~/ | more to find .bashrc then I removed it. ls -la ~/ | more找到.bashrc然后将其删除。

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. 但我会说这已经解决了核心问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM