在Python 3.6上安装OpenCV:ModuleNotFoundError

时间:2018-06-28 12:06:12

标签: python module pip

使用import cv2时出现以下错误:

ModuleNotFoundError: No module named 'cv2'

我的Python版本是3.6 64位。我已经下载了whl文件以通过pip手动安装它,并且还使用pip install opencv-python进行了安装,但是我仍然得到ModuleNotFoundError

pip输出Requirement already satisfied: opencv-python in c:\...\python36\site-packages

我们将不胜感激。

2 个答案:

答案 0 :(得分:1)

您的下载必须已损坏。这也发生在我身上。只需卸载该软件包并使用

sudo apt-get install python open-cv

答案 1 :(得分:0)

使用public static countrySearch(String countryname){ try { Connection connection = DriverManager.getConnection( "jdbc:mysql://localhost:3306/freeguide", "root", "6235"); PreparedStatement ps = connection.prepareStatement("select id from Country where countryname LIKE (?) "); //Here is where I am stuck ps.setString(1, countryname); ResultSet rs=stmt.executeQuery(); while(rs.next()){ System.out.println(rs.getInt(1)); // Or call rs.getString(1); if your id is string. } } catch (SQLException e) { e.printStackTrace(); } return countryid; }