Chrome Pointer

2021年9月25日 星期六

cv2.cpython-35m-x86_64-linux-gnu.so missing找不到在哪裡~解決方法

 • And assuming that OpenCV compiled without error, you can now install it on your Ubuntu system:

$ sudo make install

$ sudo ldconfig

在你執行$ sudo make install 之後,會跳出以下畫面


所以你就可以知道你的cv2.cpython-35m-x86_64-linux-gnu.so檔案路徑在哪裡了~

-- Set runtime path of "/usr/local/lib/python3.5/site-packages/cv2/python-3.5/cv2.cpython-35m-x86_64-linux-gnu.so" to "/usr/local/lib"

-- Installing: /usr/local/lib/python3.5/site-packages/cv2/config-3.5.py


• At this point, your Python 3 bindings for OpenCV should reside in the following folder:

$ ls /usr/local/python/cv2/python-3.6  cv2.cpython-36m-x86_64-linux-gnu.so

正確位置>> 

$ ls /usr/local/lib/python3.5/site-packages/cv2/python-3.5 cv2.cpython-35m-x86_64-linux-gnu.so

#記得檔案名字不是36m是35m, 不然會找不到檔案唷!!!


• Let’s rename them to simply cv2.so :

$ cd /usr/local/python/cv2/python-3.6

正確位置>>  

$ cd /usr/local/lib/python3.5/site-packages/cv2/python-3.5


$ sudo mv cv2.cpython-36m-x86_64-linux-gnu.so cv2.so

正確位置>>  

$ sudo mv cv2.cpython-35m-x86_64-linux-gnu.so cv2.so

#mv 是改名字的意思


 • Our last sub-step is to sym-link our OpenCV cv2.so bindings into our cv virtual environment:

$ cd ~/.virtualenvs/gurus/lib/python3.5/site-packages/  #請隨著你的版本修改

$ ln -s /usr/local/python/cv2/python-3.6/cv2.so cv2.so  

$ ln -s /usr/local/lib/python3.5/site-packages/cv2/python-3.5/cv2.so cv2.so

$ cd ~


沒有留言:

張貼留言

喜歡我的文章嗎? 喜歡的話可以留言回應我喔! ^^