Search code examples
pythonroboflow

Traceback (most recent call last): File "C:\Users\Diplom\PycharmProjects\Yolo01\Roboflow-4.py", line 4, in <module> import roboflow


Error Traceback (most recent call last): File "C:\Users\Diplom\PycharmProjects\Yolo01\Roboflow-4.py", line 4, in import roboflow File "C:\Users\Diplom\PycharmProjects\Yolo01.venv\Lib\site-packages\kiwisolver_init_.py", line 8, in from ._cext import ( ImportError: DLL load failed while importing _cext: The specified module was not found.

Python 3.11 , PyCharm Community Edition 2023.3.5 , windows 10.

import cv2
import tkinter as tk
from PIL import Image, ImageTk
import roboflow
import numpy as np

class VideoPlayer:
    def __init__(self, video_file, master=None, width=480, height=270):
        self.cap = cv2.VideoCapture(video_file)
        self.master = master
        self.canvas = tk.Canvas(master, height=height, width=width)
        self.delay = int(1000 / self.cap.get(cv2.CAP_PROP_FPS))
        self.photo = None

pip list Package Version


certifi 2023.7.22 chardet 4.0.0 charset-normalizer 3.3.2 colorama 0.4.6 contourpy 1.2.1 cycler 0.10.0 fonttools 4.51.0 idna 2.10 kiwisolver 1.4.5 matplotlib 3.8.4 msvc-runtime 14.34.31931 numpy 1.26.4 opencv-python 4.8.1.78 opencv-python-headless 4.8.0.74 packaging 24.0 pillow 10.3.0 pip 24.0 pyparsing 2.4.7 python-dateutil 2.9.0.post0 python-dotenv 1.0.1 python-magic 0.4.27 PyYAML 6.0.1 requests 2.31.0 requests-toolbelt 1.0.0 roboflow 1.1.27 setuptools 68.2.0 six 1.16.0 tk 0.1.0 tqdm 4.66.2 urllib3 2.2.1 wget 3.2 wheel 0.41.2

The following steps did not help: pip install msvc-runtime pip uninstall roboflow pip installs roboflow pip uninstall kiwisolver pip install kiwisolver python -m pip install roboflow


Solution

  • Seems like importing _cext: comes from the Microsoft Visual C++ Redistributable, try downloading your verison from the link.

    https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170