我想构建一个具有scikit-learn,opencv和numpy的python docker容器。不幸的是,我找不到包含所有这些内容的预制容器,但是我确实找到了下面包含numpy和scikit-learn的容器。
https://hub.docker.com/r/frolvlad/alpine-python-machinelearning/
我仍然需要安装opencv,因此在我的docker文件中包含一个RUN pip install opencv-python。但是,我继续收到以下错误:
Could not find a version that satisfies the requirement opencv-python (from version: )
No matching distribution found for opencv-python
我在网上阅读的每件事都说a pip install opencv-python会起作用,但是由于某种原因它对我不起作用。python包可能有问题吗?
任何帮助表示赞赏
另外,我将在下面包括完整的Dockerfile,我的目标是使用openFaas,这是一个无服务器的框架,因此我的Dockerfile可能看起来很奇怪:
FROM frolvlad/alpine-python-machinelearning
RUN apk update
RUN apk upgrade
# Alternatively use ADD https:// (which will not be cached by Docker builder)
RUN apk --no-cache add curl \
&& echo "Pulling watchdog binary from Github." \
&& curl -sSL
https://github.com/openfaas/faas/releases/download/0.8.0/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x …Run Code Online (Sandbox Code Playgroud) 我一直试图解决这个问题几个小时,我非常沮丧,所以我来找你们一些指导.
我试图保存并检索我创建的用户对象.我想这样做,以便我可以从我的应用程序中的任何意图保存和检索此User对象,所以我决定使用FileInput和Output流.我在下面列出了我的代码.
这是我的输出数据方法:
public static void serializeDataOut(User ish) {
try {
String path = Environment.getExternalStorageDirectory().getAbsolutePath();
File newFile = new File(path + "myFile.ser");
FileOutputStream fos = new FileOutputStream(newFile);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(ish);
oos.flush();
oos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的输入数据方法:
public static User serializeDataIn(){
try{
String path = Environment.getExternalStorageDirectory().getAbsolutePath();
FileInputStream fin = new FileInputStream(path + "myFile.ser");
ObjectInputStream ois = new ObjectInputStream(fin);
User iUser = (User) ois.readObject();
ois.close();
return iUser;
} catch (IOException | ClassNotFoundException e) { …Run Code Online (Sandbox Code Playgroud)