Tensorflow and Python using rosetta 2 instead of ARM natively causing tensorflow not to work

Hello! So I've been having this issue for quite some time and lets just say, strap yourself in cause this is gonna be a ride. So I'm a senior year compsci major working on an application and part of it involves machine learning (aka python) and one of the libraries I've been using is tensorflow. I had an older 2016 intel macbook pro which was great until the ribbon connector that powers the display decided to short from opening the hinge too many times and since my computer was out of warranty, It cost more money to fix than it was to trade in. So I got a new 2021 16" M1 Pro Macbook Pro! Which has been great.... for the most part. Since I just transfered all my data from my old computer to the new computer, it doesn't update all of the versions of python and it's modules/libraries weren't automatically updated to use the M1 Chip natively, but rather to still use the intel version running through Rosetta 2. You can check if python is using intel or apple through the activity monitor to see what I'm talking about.

ok parker just get to the frickin point, what do you need help with?

ok so when I import tensorflow, it kills the kernal saying:

The kernal 'base' (Python 3.9.7) died

which then makes me have to restart the kernel therefore making me start from scratch with running the program. 'base' is just the virtual environment I was in so don't mind that, the point is, for whatever reason, tensorflow is not liking that python is using intels version when running on an apple chip. I know that it's the new processor thats causing this issue because for the past week I've been working on this project on my dads older intel macbook and it's been running just fine (of course he does need his computer back so that's why I'm trying to get this resolved 😂)

So as a scientist, I did some research trying to solve this issue... a lot of research. I came across Miniforge3 which is supposed to help with a lot of this, and when I installed it, it gave me these issues

Encountered problems while solving:

 - nothing provides requested ca-certificates 2021.10.8 h4653dfc_0
 - nothing provides requested libffi 3.4.2 h3422bc3_5
 - nothing provides requested yaml 0.2.5 h642e427_0
 - nothing provides requested zlib 1.2.11 hee7b306_1013
 - nothing provides requested tk 8.6.11 he1e0b03_1
 - nothing provides requested certifi 2021.10.8 py39h2804cbe_1
 - nothing provides requested pycosat 0.6.3 py39h5161555_1009
 - nothing provides requested cryptography 36.0.0 py39hfb8cd70_0
 - nothing provides requested conda 4.11.0 py39h2804cbe_0
 - package sqlite-3.37.0-h72a2b83_0 requires zlib >=1.2.11,<1.3.0a0, but none of the providers can be installed

ERROR  Could not solve for environment specs

So I was like hmmmm, that doesn't seem right, but I'll just continue on with the rest of the commands for the proper installation

Then I do conda create -n np_veclib python=3.9

but it then says:

Collecting package metadata (current_repodata.json): failed
UnavailableInvalidChannel: The channel is not accessible or is invalid.

 channel name: miniforge3
 channel url: https://conda.anaconda.org/miniforge3
 error code: 404

You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.

While I do know a decent amount about code, I don't know a lot about how to adjust conda configurations which is where I would love it if anyone had any advice to offer me.

**at the end of the day, I would just love to know how to make my python versions use apple instead of intel, along with my libraries so that my code will run, if anyone is able to help me do that with miniforge3 or without miniforge3, I would be forever greatful as I am on a time crunch to get this full fledge mobile app to work as I am a senior year student. I am more than willing to get on zoom with someone and screenshare :)

Answered by parkerbath in 699863022

UPDATE! I figured it out! So I was using VSCode that was an older intel version (due to when I transfered my data from my last computer to this computer) and i just realized they have an apple silicon version of VSCode so I just downloaded that and now it makes python work! I should've just kept doing the rubber ducky method until I figured this out but oh well, you live and you learn.

Conclusion: make sure the apps you're all using are updated before checking if its other installations instead

sidenote, some of the issues that I mentioned might be part of a larger issue with my new computer's installations so if you think that's the case, please let me know! (and of ways to fix it of course lol)

Accepted Answer

UPDATE! I figured it out! So I was using VSCode that was an older intel version (due to when I transfered my data from my last computer to this computer) and i just realized they have an apple silicon version of VSCode so I just downloaded that and now it makes python work! I should've just kept doing the rubber ducky method until I figured this out but oh well, you live and you learn.

Conclusion: make sure the apps you're all using are updated before checking if its other installations instead

Actually now I am facing a different issue :/ Idk if anyone's gonna look at this post since its now marked resolved but now whenever I try and run snippets of the whole code in portions, after running maybe 15 lines of code, it will forget a function it executed 10 lines earlier, or forget that I already did import pandas as pd therefore not remembering what pandas is, if anyone has a fix for this please let me know!

Tensorflow and Python using rosetta 2 instead of ARM natively causing tensorflow not to work
 
 
Q