-
Notifications
You must be signed in to change notification settings - Fork 309
how to install opencv2 in M1 #67
Comments
I assume you have
|
my virtual environment for Tensorflow_macos is from Conda. |
Apple isn't ready to support tensorflow_macos with Conda yet. For the time being, if you don't mind, turn off Conda. I ran into problems when I got my Conda and TF virtual environment mixed up. For now, I move my ~/.bash_profile aside (because it sets up Conda) and open a new shell for the TensorFlow virtual environment. I assume this will all get straightened out in due time. |
kinda confusing bro mind u can message me in discord ?? I got few issues when I doing this environment thingy coz python 3.9 don't support it right. here is my discord vivek#2200 |
Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors getting this error when trying to install Tensorflow_mac |
Not supposed to be Python 3.9. Apple wants us to use Python 3.8 under Xcode. Don't use Google's installation instructions since you're installing an alpha version of M1 TensorFlow. (If not, then you posted your question in the wrong place.) Did you install TF for M1 by following the steps from Apple here? BTW, you'll want to get Xcode from the App Store if you don't have it yet. After you get Xcode, you'll need to sign a license ( Unfortunately, the software packages are not all ready for developers. You should be able to install cv2 for the M1 TF if you follow the 6 steps I outlined above. |
yeah I installed Tensorflow_mac in Conda environment but from that environment I can't install cv2 |
can u give the steps for Tensorflow_mac from scratch coz I was getting the error when testing the Tensorflow. Traceback (most recent call last): During handling of the above exception, another exception occurred: |
is this for M1 Mac or I installed for intel ?? |
It says x86, so just for Intel and the wrong version. You want to use the one from Xcode. See
Mine came from |
mine is coming from /Users/vivekd/opt/anaconda3/bin/python: Mach-O 64-bit executable x86_64 |
@jjbenes |
i finished the step 6 but when i try to import cv2, |
@Lucife5604 Did cv2 somehow get into |
i checked the |
can we install opencv in Conda environment ? |
I also have this problem. cv2 is somehow in ~/tensorflow_macos_venv/lib/python3.8, not in site packages. |
I got opencv and conda working correctly. I documented my procedure here and will add more in the future. This is what I came up with: cmake -DCMAKE_BUILD_TYPE=Release \
-DBUILD_opencv_python2=OFF \
-DBUILD_opencv_python3=ON \
-DPYTHON3_EXECUTABLE=`which python3` \
-DPYTHON3_INCLUDE_DIR=~/miniforge3/envs/python38/include/python3.8 \
-DPYTHON3_PACKAGES_PATH=~/miniforge3/envs/python38/lib/python3.8 \
-DPYTHON3_NUMPY_INCLUDE_DIR=~/miniforge3/envs/python38/lib/python3.8/site-packages/numpy/core \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-DOPENCV_ENABLE_NONFREE=ON \
../opencv |
I try your method but if show me Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. The output was: Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. The output was: |
You can now install opencv using conda. |
I replaced
Any idea what is happening and how to fix it? |
When I install open-cv with
and a lot of more lines.... Is someone able to do that ? Or how to install it right ? |
I managed to install opencv but I get this error when trying to import cv2:
any idea how to fix it? Thanks |
@kcamachom, did you use |
Yes. I tried first with pip install opencv-python but it didn't work. |
Here are the commands to make OpenCV work with this Tensorflow #153 (comment) |
I set -DCMAKE_INSTALL_PREFIX=~/miniforge3/envs/python38. It works for me |
was getting an error when installing this directly with pip commend
The text was updated successfully, but these errors were encountered: