Open MalteSil opened 3 years ago
So, I got it working yesterday after a long time of similar problems. What helped me was the following:
conda deactivate
python3 -m venv .venv
tensorflow_macos/arm64
from *_11_0_*.whl
to *_10_16_*.whl
install_venv.sh
to *_10_16*.whl
install_venv.sh
Then it should work! I hope that helps!
Edit: I just forked the repo and added my own instructions on how to properly install it for future reference. Maybe that will help you more: https://github.com/andy-96/tensorflow_macos
Thank you! My Conda environment was indeed active, will try it later. What is the reason behind changing the files and filenames?
Tbh, I don't know...
Python3 is shipped with 2 architectures in M1.
$ file $(which python3)
/usr/bin/python3: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/python3 (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/python3 (for architecture arm64e): Mach-O 64-bit executable arm64e
Here, you might need to specify which one to use. You can do this by installing the script like this:
arch -arm64 bash install_venv.sh my_tf_env
if you have multiple python installations, use:
arch -arm64 bash install_venv.sh --python=/usr/bin/python3 my_tf_env
You can replace my_tf_env
with any other name/path you choose.
@Alyetama is right, I got this issue fixed in my repo, just make sure you have installed Xcode (download the latest version and install it): https://developer.apple.com/download/more/?=command%20line%20tools
Then in a terminal paste
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/chinitaberrio/tensorflow_macos/master/scripts/download_and_install.sh)"
That should fix the issue :)
uninstalling tensorflow worked for me
1.1 Install Homebrew Type in your terminal (not in rosetta environment):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then add homebrew's path to the variable path:
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/bcghostpc/.zprofile eval $(/opt/homebrew/bin/brew shellenv)
1.2 Install libjpeg
brew install libjpeg
1.3 Install Matplotlib
In the virtual environment, type:
pip install matplotlib
Type in terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/apple/tensorflow_macos/master/scripts/download_and_install.sh)"
then name your virtual environment's folder
In your virtual environment, type:
pip install cython
git clone https://github.com/pandas-dev/pandas.git
cd pandas
python3 setup.py install
In your virtual environment, type:
pip install notebook
Then go to lib/python3.8/site-packages/ipykernel
Edit the eventloops.py
file using nano eventloops.py
In the _use_appnope() function, edit the return line as follows:
return sys.platform == 'darwin' and V(platform.mac_ver()[0]) >= V('10.9') and platform.mac_ver()[2] != 'arm64'
About Installing Different Modules You can install any module using pip inside Virtual Environment:
pip install <moduleName>
About Virtual Environment
You can create a virtual environment by:
python3 -m venv <name>
After creating the environment, you can activate the environment by:
source <name>/bin/activate
To exit the environment, type:
deactivate
I'll give that a shot.
There might also be a fix by upgrading to this tensorflow alpha, but I haven't trie dit because it requires that I down grade to 3.8 of python.
I've followed these steps :
I'm using Python 3.8 and I'm running my terminal not rosetta: (base) user@useros ~ % uname -m
arm64 When I activate my environment I still get: (venv) (base) user@useros ~ % uname -m arm64
If I run file $(which python) I get the following: On base: (base) user@useros ~ % file $(which python) /Users/user/opt/anaconda3/bin/python: Mach-O 64-bit executable x86_64
On venv: (venv) (base) user@useros ~ % file $(which python) /Users/user/venv/bin/python: Mach-O 64-bit executable x86_64
Why do I get 'Mach-O 64-bit executable x86_64' here even though I get 'arm64' before? This confuses me and is probably the reason why my code is not working.