我一直在本地开发Python应用程序,现在想将它部署到Amazon Elastic Beanstalk,但是我遇到了以下错误:
Downloading/unpacking opencv-python==2.4.8.1 (from -r
/opt/python/ondeck/app/requirements.txt (line 12))
Could not find any downloads that satisfy the requirement opencv-python==2.4.8.1
(from -r /opt/python/ondeck/app/requirements.txt (line 12))
Some externally hosted files were ignored (use --allow-external opencv-python to allow).
Cleaning up... No distributions at all found for opencv-python==2.4.8.1
(from -r /opt/python/ondeck/app/requirements.txt (line 12))
如果我用SSH连接并输入sudo pip install opencv-python
它会说“下载/解压缩opencv-python”一分钟左右,那么:
Could not find any downloads that satisfy the requirement opencv-python
Cleaning up...
No distributions at all found for opencv-python
Storing debug log for failure in /root/.pip/pip.log
我也尝试在我的requirements.txt中添加“http://rpmfind.net/linux/fedora/linux/development/rawhide/x86_64/os/Packages/o/opencv-python-2.4.9-3.fc22.x86_64.rpm”,但失败如下:
Downloading/unpacking http://rpmfind.net/linux/fedora/linux/development/rawhide/x86_64/os/Packages/o/opencv-python-2.4.9-3.fc22.x86_64.rpm (from -r /opt/python/ondeck/app/requirements.txt (line 14))
Cannot unpack file /tmp/pip-ONBFer-unpack/opencv-python-2.4.9-3.fc22.x86_64.rpm (downloaded from /tmp/pip-SUUfnS-build, content-type: application/x-rpm); cannot detect archive format
Cleaning up...
Cannot determine archive format of /tmp/pip-SUUfnS-build
Storing debug log for failure in /root/.pip/pip.log
我也试过“sudo yum install opencv-python”,但失败如下:
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/2014.09 | 2.1 kB 00:00
amzn-updates/2014.09 | 2.3 kB 00:00
No package opencv-python available.
Error: Nothing to do
对于我的开发系统,我从http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv获得了安装程序。我怎么能把它安装在EB上呢?
如果没有办法安装这个确切的包裹,请问最好的选择是什么?
答案 0 :(得分:1)
如果您能够考虑解决方法,可以使用以下选项。
使用AWS Elastic Beanstalk
AWS EB支持Windows Server 2012和2008
由于您的安装程序似乎是Windows可执行文件,因此您可以考虑在Windows上进行部署。 https://aws.amazon.com/net/
使用Docker打包Fedora平台,以便在EB的AMI Linux主机上运行。
Elastic Beanstalk支持Docker http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.html
以下是python上opencv的Docker构建文件的示例。 https://registry.hub.docker.com/u/ibotdotout/python-opencv/
没有AWS Elastic Beanstalk
其他Linux发行版
如果您不完全需要Elastic Beanstalk,那么运行Fedora会怎么样? 这些安装说明很简单。
http://docs.opencv.org/trunk/doc/py_tutorials/py_setup/py_setup_in_fedora/py_setup_in_fedora.html (基本上是yum install numpy opencv *)
您可以在没有Elastic Beanstalk的情况下使用EC2。
答案 1 :(得分:1)
目前简单的解决方法是安装pip 1.2.1,它不需要SSL:
curl -O https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz
tar xvfz pip-1.2.1.tar.gz
cd pip-1.2.1
python setup.py install
也许这可以帮到你
答案 2 :(得分:0)
我在Amazon EC2上运行OpenCV,在Ubuntu 14.04的专用实例上运行Python。我必须从源代码安装和编译才能获得可靠的python堆栈。