ctypes error: libdc1394 error: Failed to initialize libdc1394

后端 未结 7 1576
攒了一身酷
攒了一身酷 2020-12-02 06:12

I\'m trying to compile my program to a shared library that I can use from within Python code using ctypes.

The library compiles fine using this command:



        
相关标签:
7条回答
  • 2020-12-02 06:15

    Another workaround in using a docker image is to mount a volume

    docker run -v /dev/null:/dev/raw1394

    0 讨论(0)
  • 2020-12-02 06:15

    I had the same problem. solved by running tsu first and then debian.

    problem:

    ./start-debian.sh
    root@localhost:~# python3 -c "import cv2; print(cv2.__version__)"
    libdc1394 error: Failed to create juju: opendir: Permission denied
    libdc1394 error: Failed to initialize libdc1394
    3.2.0
    root@localhost:~#
    
    tsu
    ./start-debian.sh
    root@localhost:~# python3 -c "import cv2; print(cv2.__version__)"
    3.2.0
    root@localhost:~# 
    
    0 讨论(0)
  • 2020-12-02 06:17

    I had similar issue with an Ubuntu precise running under VirtualBox. First I installed OpenCV following these instructions: https://help.ubuntu.com/community/OpenCV This fixed several issues I had trying other methods but the problem with libdc1394 was still there.

    libdc1394 error: Failed to initialize libdc1394
    

    I finally saw goran comment on the previous answer

    So I enabled the USB controller in virtualbox.... et voila! everything works perfectly!

    Thanks goran!

    0 讨论(0)
  • 2020-12-02 06:19

    Very frustrating that nobody actually shows a concrete solution. I had this issue after installing OpenCV. For me the easiest solution to remove this warning was actually to disable this driver:

    sudo ln /dev/null /dev/raw1394
    
    0 讨论(0)
  • 2020-12-02 06:19

    For folks who compiled their own opencv and encounter this error, and have no need for the firewire video capture support, you can always re-compile with -D WITH_1394=OFF option, like below:

    cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_1394=OFF ./
    

    If you turn off this option you can even loose the libdc1394-22-dev dependency (ubuntu). Though I've not personally tested this.

    0 讨论(0)
  • 2020-12-02 06:37

    Okay. I spent a entire day on it.

    Basically, the link between /dev/raw1394 and /dev/null is not permanent. You can bash into your VM, call ln /dev/null /dev/raw1394, but it will last only until you re-start your container.

    What I had to do, that seemed to be the simplest, but not the perfect approach, is to place the linking during the startup of the Container.

    I thought in Running it as a service, but seemed too much for a simple job.

    The way I finally came to work, (it's not pretty, but works), is by changing the CMD of the Dockerfile:

    CMD sh -c 'ln -s /dev/null /dev/raw1394'; <your-script-here>

    0 讨论(0)
提交回复
热议问题