condaanaconda3

Anaconda - Cannot create env from yml file


I am running the command conda env create -f virtual_platform_mac.yml and getting these errors ...

this yml file is from a UDEMY course, so I don't understand why it shouldn't work.

Channels:

PackagesNotFoundError: The following packages are not available from current channels:

Current channels:

ALSO THIS - SAME ERROR

import cv2 Traceback (most recent call last): File "", line 1, in File "/opt/anaconda3/lib/python3.11/site-packages/cv2/init.py", line 181, in bootstrap() File "/opt/anaconda3/lib/python3.11/site-packages/cv2/init.py", line 175, in bootstrap if __load_extra_py_code_for_module("cv2", submodule, DEBUG): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.11/site-packages/cv2/init.py", line 28, in __load_extra_py_code_for_module py_module = importlib.import_module(module_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.11/site-packages/cv2/typing/init.py", line 168, in LayerId = cv2.dnn.DictValue ^^^^^^^^^^^^^^^^^ AttributeError: module 'cv2.dnn' has no attribute 'DictValue'

conda update --all pip install opencv-python added conda-forge anaconda login reinstall cv2 pip install opencv-python-headless


Solution

  • fixed:

    downgrade openCV:

    pip install opencv-python==4.5.5.64 for M1 silicon

    the libraries weren't necessary for startup. but ran into another error while trying to run the script they provided in spyder IDE. error: opencv: not authorized to capture video (status 0), requesting...

    the fix for this was to create your python environment and just run it through terminal. it will ask for permission to access camera and the facial recognition worked