How can I change the default version of Python Used by Atom?

家住魔仙堡 提交于 2021-02-08 08:11:29

问题


I have started using Atom recently and for the past few days, I have been searching on how to change the default version used in Atom (The default version is currently python 2.7 but I want to use 3.6). Is there anyone I can change the default path? (I have tried adding a profile to the "script" package but it still reverts to python 2.7 when I restart Atom. Any help will be hugely appreciated!! Thank you very much in advance.


回答1:


I am using script 3.18.1 in Atom 1.32.2

Navigate to Atom (at top left) > Open Preferences > Open Config folder.

Now, Expand the tree as script > lib > grammars

Open python.coffee and change 'python' to 'python3' in both the places in command argument




回答2:


I would look in the atom installed plugins in settings.. you can get here by pressing command + shift + p, then searching for settings.

The only reason I suggest this is because, plugins is where I installed swift language usage accessibility through a plugin that manages that in atom.

Other words for plugins on atom would be "community packages"

Hope this helps.




回答3:


Yes, there is. After starting Atom, open the script you wish to run. Then open command palette and select 'Python: Select interpreter'. A list appears with the available python versions listed. Select the one you want and hit return. Now you can run the script by placing the cursor in the edit window and right-clicking the mouse. A long menu appears and you should choose the 'Run python in the terminal window'. This is towards the bottom of the long menu list. The script will run using the interpreter you selected.



来源:https://stackoverflow.com/questions/50667214/how-can-i-change-the-default-version-of-python-used-by-atom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!