When I use Pycharm, whose default python interpreter is set to be python 2.7.14. When I run the integrated console in Pycharm several line of code bellow, the python versions are confusing. Could someone explain what's the difference between these two commands?
Asked
Active
Viewed 550 times
2

juanpa.arrivillaga
- 88,713
- 10
- 131
- 172

Jason
- 3,166
- 3
- 20
- 37
-
Can you try `os.system("which python")`? – juanpa.arrivillaga Feb 28 '18 at 18:13
-
1Are you sure that pycharm is set to work with python 2.7.14? I think that `os.system("python --version")` gives the version of the system default python interpreter, whereas `platform.python_version()` gives the version of the interpreter which calls this function. – nyr1o Feb 28 '18 at 18:29
-
@juanpa.arrivillaga, it gives: /Library/Frameworks/Python.framework/Versions/2.7/bin/python – Jason Feb 28 '18 at 19:29
-
@LouisSugy I'm sure the python in this project's venv/bin/python2.7 is 2.7.14 . After I set this up, I use the pycharm integrated python console to run those codes. – Jason Feb 28 '18 at 19:35