Jiaqi-Liu Jiaqi-Liu - 1 year ago 77
Python Question

"which version" output differently with setting version in PyCharm

I am using currently the latest version of PyCharm and python 2.7 (Home brew). I set python version in PyCharm like this:

enter image description here

However, when I run codes in the same project:

enter image description here

I get output like this:

enter image description here

Why is that? And how can I config the right Python?


Answer Source

You shouldn't be using which python to find out which python you're using. Try this instead:

import sys

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