How to install opencv-python on Amazon Elastic Bea

2019-06-24 01:37发布

I've been developing a Python application locally, and now want to deploy it to Amazon Elastic Beanstalk, but I have hit the following error:

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))

If I connect with SSH and type sudo pip install opencv-python it says "Downloading/unpacking opencv-python" for a minute or so, then:

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

I also tried adding "http://rpmfind.net/linux/fedora/linux/development/rawhide/x86_64/os/Packages/o/opencv-python-2.4.9-3.fc22.x86_64.rpm" to my requirements.txt but that failed as follows:

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

I also tried "sudo yum install opencv-python" but that failed as follows:

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

For my development system I got the installer from http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv. How can I get it installed on EB, please?

If there's no way to install this exact package, what is the best alternative, please?

3条回答
Luminary・发光体
2楼-- · 2019-06-24 02:08

Here are some options if you are able to consider workarounds.

With AWS Elastic Beanstalk

Without AWS Elastic Beanstalk

查看更多
beautiful°
3楼-- · 2019-06-24 02:10

I am running OpenCV with Python support on Amazon EC2 on dedicated instances of Ubuntu 14.04. I had to install and compile from source to get a reliable stack with python.

查看更多
一纸荒年 Trace。
4楼-- · 2019-06-24 02:12

The easy workaround for now, is to install pip 1.2.1, which does not require 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

Maybe that can help you

查看更多
登录 后发表回答