Coderunner uses old 2.71 version of Python instead of 3.2 on OSX 10.7.5

后端 未结 6 2002

I am trying to use the newer version of Python but when I type:

    import sys
    print sys.version_info

I get back:

    s         


        
相关标签:
6条回答
  • 2021-01-05 09:31

    Use Command+, to open the Preferences, and then make sure the Languages of Python3 have this:

    Right Run Command

    BTW, use which python3 to make sure the path is /usr/local/bin/python3 instead of /usr/bin/python3 to ensure safety

    0 讨论(0)
  • 2021-01-05 09:34

    For the latest vscode you need to go to settings (shift+command+p) and override python interpreter value.

    0 讨论(0)
  • 2021-01-05 09:34

    Crate a python file and get current sysinfo

    import sys
    print(sys.version_info)
    

    Need to change to python3?

    1. open your vscode settings file
      1.1 mac: command+shift+p
      1.2. search for openSettingsJson
    2. locate the python attribute in the json object
    3. change the value to python3
    4. validate results by running the aforementioned file
    5. profit
    0 讨论(0)
  • 2021-01-05 09:41

    Try changing Python's "run command" in the preferences to:

    python3 $filename;
    
    0 讨论(0)
  • 2021-01-05 09:49

    in new versions in setting.json file just add:

    "code-runner.

    *note that (")

    it predicts its continue or you can press ctrl+space and select "code-runner. "code-runner.executorMap" it show all of run commands easyly change

    "python": "python -u",

    to

    "python": "python3 -u",

    to change your intellisense for error handling in python3: then press ctrl+shift+P select python:select interpreter and select python 3.x.x

    0 讨论(0)
  • 2021-01-05 09:51

    CodeRunner->Preferences->Languages->Run Command

    edit "python $filename" to "python3 $filename"

    0 讨论(0)
提交回复
热议问题