After following the Heroku Getting Started on Heroku with Python guide, I decide to have a go at deploying my own project, however I have run into the following problems.
I am using Pycharm and Anaconda. Post creating a simple application using pandas
I do the following in the root of the project:
pip freeze --local > requirements.txt
I then commit requirements.txt
and attempt deploying the app.
git push heroku master
Error
remote: -----> Installing requirements with pip
remote: Collecting alabaster==0.7.10 (from -r /tmp/build_ee6cf004d0fea807fae99f551ec45276/requirements.txt (line 1))
remote: Downloading https://files.pythonhosted.org/packages/2e/c3/9b7dcd8548cf2c00531763ba154e524af575e8f36701bacfe5bcadc67440/alabaster-0.7.10-py2.py3-none-any.whl
remote: Collecting anaconda-client==1.6.14 (from -r /tmp/build_ee6cf004d0fea807fae99f551ec45276/requirements.txt (line 2))
remote: Could not find a version that satisfies the requirement anaconda-client==1.6.14 (from -r /tmp/build_ee6cf004d0fea807fae99f551ec45276/requirements.txt (line 2)) (from versions: 1.1.1, 1.2.2)
remote: No matching distribution found for anaconda-client==1.6.14 (from -r /tmp/build_ee6cf004d0fea807fae99f551ec45276/requirements.txt (line 2))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to fish-finger-23765.
remote:
To https://git.heroku.com/fish-finger-23765.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/fish-finger-23765.git'
After reading this it seem the work around is to manually create requirements.txt
, which in my case entails adding pandas==0.23.0
, however this seems like a hack - how do you successfully create a requirements.txt
which you can successfully deploy to Heroku?