Autocomplete in PyCharm for Python compiled extensions

后端 未结 9 852
遥遥无期
遥遥无期 2020-12-09 02:46

When writing Python code using compiled extensions (the OpenCV Python bindings, for example), PyCharm doesn\'t seem to be aware of their availability. The imports are marked

9条回答
  •  情歌与酒
    2020-12-09 03:12

    I had to hardlink the binary into the folder lib-dynload of my interpreter.

    $ cd /usr/lib/python3.7/lib-dynload
    $ sudo ln /usr/local/lib/python3.7/dist-packages/cv2/python-3.7/cv2.cpython-37m-x86_64-linux-gnu.so cv2.cpython-37m-x86_64-linux-gnu.so
    

    The paths may vary in your environment. I don't testet it on OSX or Windows, but it may work there too. The lib-dynload folder is here:

提交回复
热议问题