I have been trying to install TensorFlow 2.6.0 in a conda environment. Here's the command:
python -m pip install tensorflow-macos==2.6.0
But it gives me this error:
TypeError: str expected, not int
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[notice] A new release of pip available: 22.1.2 -> 22.2.1
[notice] To update, run: python3.8 -m pip install --upgrade pip
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
[notice] A new release of pip available: 22.1.2 -> 22.2.1
[notice] To update, run: python3.8 -m pip install --upgrade pip
The full output is too large to fit in here. So I put the output here - https://docs.google.com/document/d/1eKL5UbeK8y0nNbp3mnWPBUutrTOTiWHALjZliQtB7jw/edit?usp=sharing Go check it out.
Please help me to successfully install Tensorflow in my M1 MacBook Pro.
OS: macOS Big Sur v11.6;
Environment python: Python 3.8.13;
Environment pip: Pip v22.1.2
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello there,
I have installed tensorflow in my M1 Macbook Pro using these commands in a conda environment:
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal
python -m pip install tensorflow-datasets
conda install jupyter pandas numpy matplotlib scikit-learn
I did it following this instruction - https://github.com/mrdbourke/m1-machine-learning-test
But when I import the packages I installed it gives me an error message.
Here:
import numpy as np
import pandas as pd
import sklearn
import tensorflow as tf
import matplotlib.pyplot as plt
# Check for TensorFlow GPU access
print(f"TensorFlow has access to the following devices:\n{tf.config.list_physical_devices()}")
# See TensorFlow version
print(f"TensorFlow version: {tf.__version__}")
Error:
---------------------------------------------------------------------------
NotFoundError Traceback (most recent call last)
Input In [1], in <cell line: 4>()
2 import pandas as pd
3 import sklearn
----> 4 import tensorflow as tf
5 import matplotlib.pyplot as plt
7 # Check for TensorFlow GPU access
File ~/miniforge3/lib/python3.9/site-packages/tensorflow/__init__.py:443, in <module>
441 _plugin_dir = _os.path.join(_s, 'tensorflow-plugins')
442 if _os.path.exists(_plugin_dir):
--> 443 _ll.load_library(_plugin_dir)
444 # Load Pluggable Device Library
445 _ll.load_pluggable_device_library(_plugin_dir)
File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/framework/load_library.py:151, in load_library(library_location)
148 kernel_libraries = [library_location]
150 for lib in kernel_libraries:
--> 151 py_tf.TF_LoadLibrary(lib)
153 else:
154 raise OSError(
155 errno.ENOENT,
156 'The file or folder to load kernel libraries from does not exist.',
157 library_location)
NotFoundError: dlopen(/Users/arannya/miniforge3/lib/python3.9/site-packages/tensorflow-plugins/libmetal_plugin.dylib, 6): Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
Referenced from: /Users/arannya/miniforge3/lib/python3.9/site-packages/tensorflow-plugins/libmetal_plugin.dylib (which was built for Mac OS X 12.3)
Expected in: /usr/lib/libc++.1.dylib
Please help me solve this issue. I have to make a robot for a competition. So I gotta run TensorFlow.