问题
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