How to configure Atom to run Python3 scripts?

前端 未结 8 1180
南旧
南旧 2020-11-27 19:12

In my terminal, I type $ which python3, outputting

/opt/local/bin/python3

I would like to configure Atom to run Python3 scrip

8条回答
  •  野性不改
    2020-11-27 19:38

    You are probably using atom-python-run package to run Python directly from Atom. If Python2 is the default version of Python in your system, then Atom will try to run your Python code with Python2 interpreter. All you have to do is to change some settings in atom-python-run package to tell it that we want to use Python3. The process is simple. Go to settings>>Packages, click the settings button on atom-python-run package and in the fields of F5 and F6 command, exchange python with python3. That's it. Now you can run your Python3 script by pressing F5 or F6 button.

提交回复
热议问题