intellij idea python_在终端和intelliJ中更改python版本

short Q,

In a mac OS sierra terminal,

If I do:

whereis python

/usr/bin/python

Then if I do:

/usr/bin/python it opens python 2.10

but if I execute

python it opens python 2.7.8.

and this one comes from

/Library/Frameworks/Python.framework/Versions/2.7/bin/python

How do I change the default python to point to python 2.7.8? In the terminal and in intelliJ?

解决方案

Check the PATH environment variable with

echo $PATH

The python version you get when typing bare 'python' will be the first one found in that list of directories.

It is possible to control which python version is launched by, for example, rearranging the entries in PATH or by adding a symbolic link to the desired version in a position before the current version.

However, a more popular way to manage multiple python versions on the same machine is to use virtualenv. This will give you much less headaches when using pip to install/uninstall packages for particular python versions.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值