[英]How do I install a Python script on Amazon's Elastic Beanstalk?
[英]How to install opencv-python on Amazon Elastic Beanstalk
我一直在本地開發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
我也嘗試在我的要求中添加“ http://rpmfind.net/linux/fedora/linux/development/rawhide/x86_64/os/Packages/o/opencv-python-2.4.9-3.fc22.x86_64.rpm ” .txt但失敗如下:
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上安裝它?
如果沒有辦法安裝這個確切的包裝,請問最好的選擇是什么?
如果您能夠考慮變通方法,可以使用以下選項。
使用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。
現在簡單的解決方法是安裝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
也許這可以幫到你
我在Ubuntu 14.04的專用實例上運行OpenCV,在Amazon EC2上支持Python。 我必須從源代碼安裝和編譯才能獲得可靠的python堆棧。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.