DEV Community

Ravi Kumar Gupta
Ravi Kumar Gupta

Posted on

Setting up Python Development Environment on Apple M1

I recently moved to Apple M1. It was an awesome experience for my NodeJs, Java projects.

But a poor experience for python projects. I could not even install numpy properly.

I did not want to use Rosetta much. So, I had to install numpy using source. But then pandas did not install, then scipy has problems… Tired.

If you’ve reached here, you would have got a lot of articles where people tried to install by source or other ways. In this story, I am jumping straight to the solution which worked for me using miniforge

Install miniforge

brew install miniforge
Enter fullscreen mode Exit fullscreen mode

Setup conda with your shell(zsh or bash, whatever you use)

conda init zsh
Enter fullscreen mode Exit fullscreen mode

Create your venv using desired python version

conda create -n .venv python=3.9.2
Enter fullscreen mode Exit fullscreen mode

This will create a virtual env for python 3.9.2. All the packages you install will go inside this environment.

Now you can just go your python code directory and activate virtual env.

cd /path/to/my/python/source/dir
conda activate .venv
Enter fullscreen mode Exit fullscreen mode

Install the packages. Few packages I was not able to find in conda so if I install using pip that worked fine.

conda install numpy
conda install pandas
Enter fullscreen mode Exit fullscreen mode

Or using Pip

pip install celery
Enter fullscreen mode Exit fullscreen mode

That’s it, now you can simply run your app.

Hope this helps you. :)

You can follow me on Twitter — @kravigupta . You can also connect on LinkedIn — kravigupta.

Cheers!!

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay