1

When I run the pyversion command in MATLAB, it returns 3.7 as the version number. But when I run system('python --version') it shows version 2.7. Is there any make the system function use 3.7?

hoffee
  • 470
  • 3
  • 16

1 Answers1

1

The easy answer is to call python as python3 from system, rather than just python. The slightly more involved answer is to modify your system environment variables to either remove python 2.7 from the path, or move python3 higher up in the path so that it takes priority over python 2.7. You can find information on how to edit the system path here.

EDIT: I just realised that I was assuming that you were using Windows. If you are using linux, you should use update-alternatives as per the answer here.

MrAzzaman
  • 4,734
  • 12
  • 25