[Solved]-Fail to push to Heroku: /app/.heroku/python/bin/pip:No such file or directory

14πŸ‘

I ran into this issue recently and was able to adjust it by changing the python version in the runtime.txt.

Changing to

python-3.5.2

But based off your requirements that you have listed, it seems like you are never getting to the requirements_base.txt.

In your requirements_server.txt file, change it so that:

-r requirements_base.txt 

is listed there.

6πŸ‘

I simply had two typos in my runtime.txt

Make sure it says python-3.6.1 and not Python-3.6.1 or python 3.6.1

The error message is pretty bad. May this post save someone 30 minutes.

2πŸ‘

Looks like Heroku now supports only 3.6.1 and 2.7.13 Python versions.

https://devcenter.heroku.com/articles/python-runtimes#supported-python-runtimes

0πŸ‘

If you are using the default heroku buildpack I would guess that the requirements.txt file in your project folder is missing.

πŸ‘€t_io

0πŸ‘

I had the same problem on Ubuntu 16.04 and after manually installing Heroku CLI, using

wget https://cli-assets.heroku.com/branches/stable/heroku-REPLACE_ME_OS-REPLACE_ME_ARCH.tar.gz -O heroku.tar.gz

mkdir -p /usr/local/lib

tar -xvzf heroku.tar.gz -C /usr/local/lib

/usr/local/lib/heroku/install

it worked like a charm.

In the folder I have 4 files. One is python script, second is procfile (no extension) with content web: gunicorn skripta1:app. Third is requirements.txt with:

appdirs==1.4.3
bokeh==0.12.5
click==6.7
Flask==0.12.2
gunicorn==19.7.1
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
numpy==1.12.1
packaging==16.8
pandas==0.20.1
pandas-datareader==0.4.0
pyparsing==2.2.0
python-dateutil==2.6.0
pytz==2017.2
PyYAML==3.12
requests==2.14.2
requests-file==1.4.2
requests-ftp==0.3.1
six==1.10.0
tornado==4.5.1
Werkzeug==0.12.2 

And fourth is runtime.txt with python-3.5.2

πŸ‘€Dalibor

0πŸ‘

According to Heroku documentation, the only two officially supported python runtimes are 2.7.13, and 3.6.1.
I recently had the same issue with oTree deployment in heroku, but as soon as I changed runtime.txt to python-3.6.1 everything went smoothly.

0πŸ‘

Oh dear – I removed a blank line in my requirements/production.txt in order to try and change the line number and everything started working (or rather on to my next completely different error)

πŸ‘€hum3

0πŸ‘

I ran into this same problem on Windows trying to deploy a Python app to Heroku. Turns out it was a file encoding problem. Depending on how you create Procfile, requirements.txt and runtime.txt your encoding may vary.

Assuming you’re running Windows, use PowerShell. Get the following PowerShell Function and paste it in to your PowerShell console. Using this, you can check your file encoding:

get-fileencoding requirements.txt

If it comes back anything besides ascii that’s probably the issue. In my case, my three files were all unicode. I just did this to force them to ASCII:

'python-3.6.1' | out-file -en ascii runtime.txt

You can also use an editor and then save the file using ASCII encoding.

Once I made this change to my Procfile, requirements.txt and runtime.txt I was able to successfully deploy to Heroku.

πŸ‘€James S.

0πŸ‘

I was switching from app engine to heroku and had a setup.cfg file in the root directory with following content:

[install]
prefix= 

It caused this issues while deployment. After removing everything went well.

πŸ‘€devza

Leave a comment