heroku-python / conda-buildpack

[DEPRECATED] Buildpack for Conda.
MIT License
157 stars 251 forks source link

Failed to install package #33

Open gaborvecsei opened 7 years ago

gaborvecsei commented 7 years ago

I tried to add OpenCV 2.4.11 to the conda-requirements.txt for installing but I just keep getting this after git push heroku master.

remote: -----> Installing dependencies using Conda
remote:        Fetching package metadata .......
remote:        Solving package specifications: .
remote:
remote:
remote: PackageNotFoundError: Package not found: '' Package missing in current linux-64 channels:
remote:   - opencv 2.4.11
remote:
remote: You can search for packages on anaconda.org with
remote:
remote:     anaconda search -t conda opencv
remote:
remote: You may need to install the anaconda-client command line client with
remote:
remote:     conda install anaconda-client
remote:
remote: Note that you have pinned specs in /app/.heroku/miniconda/conda-meta/pinned:
remote:
remote:     ['nomkl']
remote:
remote:
remote:  !     Push rejected, failed to compile Python/Conda app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to sample-cv-flask.
remote:
To https://git.heroku.com/sample-cv-flask.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sample-cv-flask.git'

But after I searched for OpenCV I found it for linux 64.

menpo/opencv              |   2.4.11 | conda           | linux-64, win-32, win-64, linux-32, osx-64
bkreider commented 7 years ago

You would have to specify the channel "-c menpo" to install from that user's account.

icoxfog417 commented 7 years ago

Heroku now supports Docker container push feature and the same time, this buildpack seems to be not maintaned.

So I recommend to use Docker container. You can make Dockerfile for your application easily by inheriting the continuumio/miniconda (or continuumio/miniconda3) Docker file (here is ContinuumIO's official dockerfiles). Here is my Dockerfile.

Dockerfile

FROM continuumio/miniconda3

ENTRYPOINT []
CMD [ "/bin/bash" ]

# Remove (large file sizes) MKL optimizations.
RUN conda install -y nomkl

# install packages by conda
RUN conda install -y numpy scipy scikit-learn cython

# install other dependencies by pip
ADD ./requirements.txt /tmp/requirements.txt
RUN pip install -qr /tmp/requirements.txt

ADD . /opt/ml_in_app
WORKDIR /opt/ml_in_app

CMD python run_application.py
kennethreitz commented 7 years ago

I recommend what @icoxfog417 recommends.