'How can I change the default version of Python Used by Atom?
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.
Solution 1:[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
Solution 2:[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.
Solution 3:[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.
Solution 4:[4]
I came up with an inelegant solution that may not be universal. Using platformio-ide-terminal, I simply had to call python3.9 instead of python or python3. Not sure if that is exactly what you're looking for.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | CryptoManiac |
| Solution 2 | Joshua Paulsen |
| Solution 3 | Natsfan |
| Solution 4 | Gray Yarbrough |
