[英]cv2 module not found python3 odroid
我有一個使用 OpenCV 的 python 3 腳本,它不能在我的 Odroid 上運行。 我得到的Import error: No module named 'cv2'
是Import error: No module named 'cv2'
。 但是當我在 python 2 中運行程序時,它似乎工作正常。 問題是,當我嘗試使用pip3
安裝 opencv-python 時,出現此錯誤Could not find a version that satisfies the requirement opencv-python
。 我不確定這是否相關,但我檢查了 python 3 的dist-packages
,它只包含virtualenv
文件,不包含site-packages
目錄。 當我導航到python2.7
有一個site-packages
和一個dist-packages
目錄,但它們都不包含opencv-python
文件。 我也嘗試從源代碼構建,但沒有用。 我什至檢查了是否由於某種奇怪的原因我的 IP 被 pypi.com 阻止,所以我運行curl https://pypi.python.com
並且運行良好。 我還嘗試使用代理進行 pip install,但這也導致超時錯誤等。 我很困惑,不確定是 pip 是問題還是其他東西被 Odroid 破壞了。 我也收到一個錯誤,說使用sudo
,
The direcotry '/home/odroid/.cache/pip/http' or its parent direcoty is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/odroid/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. Check the permissions and owned of that directory. If executing pip with sudo, you may sudo's -H flag.
所以我使用他們指定的標志運行並且我得到相同但錯誤但是然后這個, You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
當我運行pip3 -V
和pip -V
它說版本是 9.0.1,我運行升級命令它說它是最新的。
幫助將不勝感激。 如果我遺漏了您認為應該放在這里的任何內容,請告訴我!
編輯:忘了提到我已經嘗試卸載並重新安裝 pip。
sudo -H
標志設置$HOME
環境變量在 sudo 會話期間應該是什么,因此當您使用它時,它會設置$HOME=/root
,而不是$HOME=/home/odroid
我會運行sudo -H pip3 -V
看看它會給你什么,因為根文件夾中的緩存輪可能是舊的。
如果是這種情況,請嘗試sudo -H pip3 --upgrade pip && sudo -H pip3 install wheel
,然后再次sudo -H pip3 opencv-python
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.