atom-script
atom-script copied to clipboard
How do i make atom run python 3 instead of default 2.7 mac?
I have seen the other threads on this and it is either not fully explained or just too confusing. i am new! Thank you in advance, for now i just paste "#!/Library/Frameworks/Python.framework/Versions/3.7/bin/python3" in the top of every .py file and it does it, and im using script. not sure how to permanitly make it run python 3.
bump
#1787
If you want to use Python3 by default, you can open Atom Settings,
Atom→Preferences→Open Config Folder, and open.atom/packages/script/lib/grammars/python.coffee, Changingpythontopython3under'Selection Based'and'File Based', saving it.
It is works for me.
Thank you! Only solution that worked.
Grant
On Mar 14, 2019, at 10:02 PM, Lokkie Ho [email protected] wrote:
#1787 https://github.com/rgbkrk/atom-script/pull/1787 If you want to use Python3 by default, you can open Atom Settings, Atom→Preferences→Open Config Folder, and open.atom/packages/script/lib/grammars/python.coffee, Changing python to python3 under 'Selection Based' and 'File Based', saving it.
It is works for me.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rgbkrk/atom-script/issues/1797#issuecomment-473159819, or mute the thread https://github.com/notifications/unsubscribe-auth/Aq2h6eA1hDm16UAqLYPZd1iCTw2w6bxGks5vWyljgaJpZM4afL5y.
In my opinion this should be more easily configurable or script should detect whether it is an python2 or python3 script. I'll consider making a patch / pull request for this or at least opening an improvement proposal (issue) for this.
#1787
If you want to use Python3 by default, you can open Atom Settings,
Atom→Preferences→Open Config Folder, and open.atom/packages/script/lib/grammars/python.coffee, Changingpythontopython3under'Selection Based'and'File Based', saving it.It is works for me.
I did that, now I have the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/__init__.py", line 23, in <module>
from . import multiarray
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/multiarray.py", line 10, in <module>
from . import overrides
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/_multiarray_umath.cpython-310-darwin.so' (no such file)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/jacobivanov/Desktop/Electric Field Simulator.py", line 2, in <module>
import matplotlib.pyplot as plot
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib/__init__.py", line 104, in <module>
import numpy
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/__init__.py", line 144, in <module>
from . import core
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.10 from "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
* The NumPy version is: "1.22.2"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/_multiarray_umath.cpython-310-darwin.so' (no such file)
[Finished in 0.818s]