How to install Python with NumPy, SciPy, Matplotlib on macOS Big Sur Apple Silicon M1. The procedure presented in the video should work on both Apple Silicon M1 (arm64) and Intel (x86-64) Macs.
Пікірлер: 93
@mehboobalam31673 жыл бұрын
You are just a life saver for me. Just now I received my M1 Mac. I was trying to set my working environment and nothing was working. Reading things on various blogs, forum...but nothing and then I find your video. Its awesome. Thanks a lot. You saved my several hours. God bless you.
@mcb73763 жыл бұрын
Thank you so much!!! Three hours of google producing creepy geek recipes that failed one after the other. Your simple tutorial was my rescue from this nightmare!
@k1arah7483 жыл бұрын
OMG! This is the best instructional video for installing python the right way. I appreciate you've made it concise and very understandable even if I don't have background in programming I was able to follow everything. Thank you
@ixxhar3 жыл бұрын
I had to log in to my account to say thanks for showing a quick workaround to these library incompatibility issues. I had to search around for a while but the solutions were mainly compiling those libraries and installing them yourself, which is a lot of work, for me at least. Nonetheless, thank you for the video.
@mitheleshkumar50343 жыл бұрын
Thanks a lot. Initially it didn't work. But i uninstalled my arm64 version of homebrew . installed homebrew in x86_64. then followed your steps. Now all set. Thanks again
@brijeshranu13 жыл бұрын
please tell how uninstalled my arm64 version of homebrew
@aydinonac52472 жыл бұрын
The video on installing pip, numpy and matplotlib was excellent. Thank you VERY much. Aydin
@thomasjirsch65723 жыл бұрын
3 Days of google solved by a simple explanation, thank you!
@empowercode3 жыл бұрын
Hey! I just found your channel and subscribed, love what you're doing! I like how clear and detailed your explanations are as well as the depth of knowledge you have surrounding the topic! Since I run a tech education channel as well, I love to see fellow Content Creators sharing, educating, and inspiring a large global audience. I wish you the best of luck on your KZbin Journey, can't wait to see you succeed! Your content really stands out and you've put so much thought into your videos! Cheers, happy holidays, and keep up the great work ;)
@AtoZProgrammingTutorials3 жыл бұрын
Thanks and best wishes for your KZbin Journey.
@empowercode3 жыл бұрын
@@AtoZProgrammingTutorials No problem, thank you!
@user-xf9oc5bl3v3 жыл бұрын
How can I use numpy in Python IDLE/in a new Python File? If I try to „import numpy“ I get an error. What can I do?
@siddharthachaganti56393 жыл бұрын
Love you dude. I am trying to do this since i bought my lap. u did it very simply thank you so much
@jakobj553 жыл бұрын
Hi, since I installed sympy on my mac an algorithm I wrote for checking primes doesnt work anymore. Do you know how to uninstall sympy? I am a complete noob btw Thx
@ethansrn22643 жыл бұрын
Thanks it works fine in the terminal but not at all in Idle, how can I do ?
@rahulshah32043 жыл бұрын
Hello Sir! Excellent video and really helped me get started. However, can you help me setting this up with Atom text editor? As of now I can use these 3 libraries since the terminal isn't closed. What steps should I follow so that even if I close the terminal, I don't have to worry about the virtual environment?
@AtoZProgrammingTutorials3 жыл бұрын
Hello. I don't know about Atom, but in Visual Studio Code it is quite simple to use an existing virtual environment (no need to keep the Terminal open). Check this video I recorded some time ago kzbin.info/www/bejne/jabYmpqXZdx-mrM .
@rahulshah32043 жыл бұрын
@@AtoZProgrammingTutorials thank you for your reply. I actually checked out on another video on KZbin and can now use VE for atom.
@johnlocke83893 жыл бұрын
What I experienced is that the Rosetta option is buried a bit deeper. You must right-click on the Terminal app, choose GET INFO, then select the box which says "Open using Rosetta." Just for clarity...
@therajvjain3 жыл бұрын
Simple and Correct. Worked like a charm
@wald019792 жыл бұрын
IMO, pipenv provides slightly better results then native venv. Also, macports or homebrew install may be a better dependency management solution for python kernels.
@victorcabritagomez40373 жыл бұрын
hey! I got this error while importing matplotlib "dlopen(/Users/victor/TIC/venv/lib/python3.9/site-packages/matplotlib/ft2font.cpython-39-darwin.so, 2): no suitable image found.". Does someone know how to fix this?
@lzdps2 жыл бұрын
Thank you! How to configure this "'arch -x86_64 zsh" using PyCharm?
@margitkonigsson6933 жыл бұрын
Get this error when using command "pip install scipy" : ERROR: Failed building wheel for scipy
@niranjanprasad92663 жыл бұрын
will it work on vs code ??
@avaamidei86353 жыл бұрын
I get an error "invalid syntax" when I am typing in the "-m venv work" . It says invalid syntax.
@nnasiri65163 жыл бұрын
This is great! Do you have a similar tutorial for Tensorflow?
@comhendrik15523 жыл бұрын
Very good video. But can someone tell me how to use the modules with vscode. because I want to create a file, which I can save.
@ПётрПетрович-х6ш Жыл бұрын
You helped a lot, thank you very much!!!👍🏻👍🏻👍🏻
@doer60023 жыл бұрын
Please, how can I install anaconda, and jupyter notebook on Macbook M1, and install NumPy, SciPy, and Matplotlib. Thank you for the above video.
@imaginaut3 жыл бұрын
Hi, how can I select this environment so I can use it with IDLE?
@AtoZProgrammingTutorials3 жыл бұрын
Open Terminal, switch to x86_64, activate the environment than write: python -m idlelib.idle The above should open an IDLE shell window that knows about the active environment (what libraries you've installed). You can create new files from the File menu and use Run to run the code ...
@AtoZProgrammingTutorials3 жыл бұрын
@AFIQAH IZZATI BINTI SUNDUSIN / UPM Hi, I don't understand the problem, what do you mean with "I cannot import file in my coding" ?
@bugzdesilva82163 жыл бұрын
how to download module named 'pyrsgis in macos please tell me
@johnlocke83893 жыл бұрын
"press the top key". What is the "top" key?
@bugzdesilva82163 жыл бұрын
omg you saved my life thank you so much !!!
@siddharthachaganti56393 жыл бұрын
mine too
@Fiop223 жыл бұрын
arch: posix_spawnp: zsh: Bad CPU type in executable Setting iTerm to Rosetta doesn't work either
@tobias13113 жыл бұрын
Hello, if I install this can I use it con Vs Code directly or do I have to write code like you did?
@AtoZProgrammingTutorials3 жыл бұрын
You can use your preferred editor (VS Code, PyCharm ...) just be sure to select the environment in which you've installed NumPy, SciPy and Matplotlib.
@tobias13113 жыл бұрын
@@AtoZProgrammingTutorials To select the environment do I have to do it in my vscode Terminal?
@AtoZProgrammingTutorials3 жыл бұрын
Bottom bar (left) of VS Code you can click on "Python ..." or "Select a Python interpreter" and than you can select what environment you need/wish.
@tobias13113 жыл бұрын
@@AtoZProgrammingTutorials thank you
@xxma1npr1est3 жыл бұрын
Hello sir, for running & debugging cpp files we have to set mingw path in environment variables on windows 10 ? Please help me
@AtoZProgrammingTutorials3 жыл бұрын
It depends, some MinGW installation come with a command prompt shortcut that sets up the path temporarily for you as long as you keep the window open. Personally if I'd want to use MinGW for C++ development on Windows I would install MSYS 2.
@xxma1npr1est3 жыл бұрын
@@AtoZProgrammingTutorials thanks for replying, I have installed clang(& clang++) & gdb debugger through MSYS2 but it doesn't working in my vscode on windows 10 machine. Many settings has been changed . Please can you make a new video on how to install clang on windows 10 & setting up the vscode for debugging.( I have also visited your GitHub page but didn't get any help)
@AtoZProgrammingTutorials3 жыл бұрын
@@xxma1npr1est I'll try to find some time this week to check what has changed for Clang under MSYS 2 (Clang was always pretty buggy with MinGW and MSYS 2). In the meantime you can use GCC (g++) under MSYS 2 for C++ programming.
@AtoZProgrammingTutorials3 жыл бұрын
I wrote a text post about the new procedure of using Clang from MSYS2, eventually I will record a video, in the meantime you can check this url solarianprogrammer.com/2021/06/11/install-clang-windows-msys2-mingw-w64/
@xxma1npr1est3 жыл бұрын
@@AtoZProgrammingTutorials thank you so much sir 🙏🙏, This means a lot .God bless you
@pratikpatil52613 жыл бұрын
Can u please tell me how to set work environment in visual studio... I don't know which path to use and which interpreter to set
@AtoZProgrammingTutorials3 жыл бұрын
I assume you are talking about Visual Studio Code. First make sure you can use the "code" command from your Terminal, see code.visualstudio.com/docs/setup/mac . From a new Terminal switched to x86_64 like I did in the video (command: "arch -x86_64 zsh". Navigate to the folder in which your Python file(s) are using the "cd" command. Once in the proper folder write: code . Select a Python file from the left panel. On the bottom left of VS Code you should see something like "Python 3.9.3" or similar, click on this and from the drop down list select the environment in which NumPy was installed, if you followed my video it should be something like "~/work/bin/python", you may need to scroll down to see it. (Be careful that if you if you didn't correctly setup the Terminal, switched to x86_64) you will not see the environment.) Try something simple first like: import numpy print(numpy.__version__) and use the run button (upper green triangle) to run the script. Let me know if it worked for you. Unfortunately this is more complicated than it will be on an Intel based Mac.
@pratikpatil52613 жыл бұрын
@@AtoZProgrammingTutorials yaa i did the same but while selecting interpreter i am not getting which file to select from work/bin
@AtoZProgrammingTutorials3 жыл бұрын
Try something else in a terminal (switch to x86_64 mode and activate the work environment): arch -x86_64 zsh source ~/work/bin/activate then navigate to the folder in which you have the Python code and write: code . Try again to select the interpreter.
@MrMrRioes3 жыл бұрын
@@AtoZProgrammingTutorials Your first description worked for me - thank you so much!
@sibasankar9893 жыл бұрын
still not working for me. I have python 3.8.2, when I enter the command python3.8 -m vent work it shows command not found
@AtoZProgrammingTutorials3 жыл бұрын
you have a spelling error it is "venv" and not "vent".
@sibasankar9893 жыл бұрын
Sorry, yes i hv used venv only. I am able to run it following by source. But when i try to install nympy, there are so mny errors Like environment, compiler error
@AtoZProgrammingTutorials3 жыл бұрын
@@sibasankar989 You are not supposed to build NumPy. Have you switched to x86_64 like I did in the video ? If nothing works, check this article solarianprogrammer.com/2021/06/15/install-python-numpy-scipy-matplotlib-macos-apple-silicon-arm64/
@sibasankar9893 жыл бұрын
Thanks a lot.
@justedms533 жыл бұрын
seems to work then not work. if i close the terminal and restart python3, it seems it doesn't even recognize SCIPY
@AtoZProgrammingTutorials3 жыл бұрын
That's because your Terminal forgets what architecture to use and defaults to arm64. So, you need to reenable the x64-86 architecture and activate the environment in which you've installed NumPy and SciPy.
@akellaniranjan2263 жыл бұрын
hey I got the following error when trying to install bumpy can you please help me resolve it Could not build wheels for bumpy which use PEP 517 and cannot be installed directly
@AtoZProgrammingTutorials3 жыл бұрын
If you are on M1, you need to make sure that you switched the Terminal to use x86-64 instructions like I do in the video and that you've updated pip, otherwise you will get the PEP 517 error.
@akellaniranjan2263 жыл бұрын
@@AtoZProgrammingTutorials yes I have switched the terminal to x86 and also upgraded the pip but still I am getting the same issue
@akellaniranjan2263 жыл бұрын
@@AtoZProgrammingTutorials will I succeed if I use anaconda ??
@akellaniranjan2263 жыл бұрын
@@AtoZProgrammingTutorials the output also shows me that “Failed building wheel for numpy ”
@AtoZProgrammingTutorials3 жыл бұрын
Do you have the Command Line Tools installed ? Have you installed Python 3.9 like I do in the video ?
@alex___dhl3 жыл бұрын
but how do you get the idle ?
@AtoZProgrammingTutorials3 жыл бұрын
Once the environment is activated, write: python -m idlelib.idle
@mohsenrahimi14603 жыл бұрын
Thank you so much, it's great.
@mahadihasan17303 жыл бұрын
thanks a lots bro!!
@rajatdevsharma87673 жыл бұрын
Many Thanks !
@saeedsobhani20882 жыл бұрын
thanks a lot
@urospocek46683 жыл бұрын
Yes this process will successfully install mentioned libraries, but you won't be able to use them and you will get "wrong architecture exception". DOES NOT WORK!
@AtoZProgrammingTutorials3 жыл бұрын
Actually it works, you are probably missing a step, like forgetting to switch the Terminal arch to x86-64.
@urospocek46683 жыл бұрын
@@AtoZProgrammingTutorials No, I have done everything you said in the video. Switched to x86-64 and successfully installed scikit-learn. Then in Pycharm everything was looking ok, but we I tried to run my program that uses scikit learn I got an error "wrong architecture". I will really like it to work and if you can help me and tell me what am I doing wrong I wiil be very grateful and I will delete my negative comment.
@AtoZProgrammingTutorials3 жыл бұрын
@@urospocek4668 Check first if you can use scikit-learn from the Terminal after you switch the arch and activate the environment. I suspect PyCharm somehow tries to use the installed scikit x86-64 lib with the arm64 version of Python (I had a similar problem in VS Code).
@urospocek46683 жыл бұрын
@@AtoZProgrammingTutorials I tried but I got and error even from the terminal. Traceback (most recent call last): File "/Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/__init__.py", line 22, in from . import multiarray File "/Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/multiarray.py", line 12, in from . import overrides File "/Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: dlopen(/Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 2): no suitable image found. Did find: /Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so: mach-o, but wrong architecture /Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so: mach-o, but wrong architecture During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/sklearn/__init__.py", line 82, in from .base import clone File "/Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/sklearn/base.py", line 13, in import numpy as np File "/Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/__init__.py", line 150, in from . import core File "/Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/__init__.py", line 48, in 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: numpy.org/devdocs/user/troubleshooting-importerror.html Please note and check the following: * The Python version is: Python3.8 from "/Users/urospocek/PycharmProjects/ML/venv/bin/python" * The NumPy version is: "1.21.1" and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: dlopen(/Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 2): no suitable image found. Did find: /Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so: mach-o, but wrong architecture /Users/urospocek/PycharmProjects/ML/venv/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so: mach-o, but wrong architecture >>> I gess because I was able to install arm version of numpy and with your video x86 version of scikit-learn they are incompatible (I really don't want to change version or architecture of numpy). But as you see from error message a got "but wrong architecture" exception by using your method, try it for yourself just use ordinary way (with arm terminal) to install numpay, pandas and any other library because they are now optimised for M1 and your way only for scikit-learn. If you succeed just let me know how. And a big thank you for your effort.
@AtoZProgrammingTutorials3 жыл бұрын
@@urospocek4668 Normally, if you use a separate environment you should not mess with your previously installed versions. This is the entire point of using a separate environment. There may be a way for you to install everything using arm64 (I know it works for NumPy, SciPy and Matplotlib, but I didn't tried for scikit-learn). See this article solarianprogrammer.com/2021/06/15/install-python-numpy-scipy-matplotlib-macos-apple-silicon-arm64/ You will need to use "conda install scikit-learn" as an extra command versus what is presented in the article. Always try to use a separate environment when you install new libraries. This way if something goes wrong you can always delete the environment and try again or use a different solution. I don't know about you, but I'm pretty disappointed about the compatibility problems with arm64/M1 processor from Apple. When I bought it I was hoping most problems will be solved in half a year ...