Dnaiel Dnaiel - 1 year ago 235
Python Question

change python version in terminal and intelliJ

short Q,

In a mac OS sierra terminal,

If I do:

whereis python

Then if I do:
it opens python 2.10

but if I execute
it opens python 2.7.8.
and this one comes from

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

wim wim
Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download