Heroku ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory

Viewed 4974

I'm getting this error when i try git push heroku master and when i click to the link i get this message "Method Not Allowed" What can i do to fix this? The Error start from this line

remote:          Downloading heroku-0.1.4.tar.gz (10 kB)
remote:        Processing /tmp/build/80754af9/idna_1593446292537/work
remote:        ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/tmp/build/80754af9/idna_1593446292537/work'
remote:        
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to bonney.
remote: 
To https://git.heroku.com/bonney.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/bonney.git'

and this is my requirements.txt

asgiref==3.2.10
beautifulsoup4==4.9.1
brotlipy==0.7.0
bs4==0.0.1
certifi==2020.6.20
cffi==1.14.0
chardet==3.0.4
cryptography==2.9.2
dj-database-url==0.5.0
Django==3.0.8
django-heroku==0.3.1
gunicorn==20.0.4
heroku==0.1.4
idna @ file:///tmp/build/80754af9/idna_1593446292537/work
psycopg2 @ file:///tmp/build/80754af9/psycopg2_1594305108220/work
pycparser==2.20
pyOpenSSL==19.1.0
PySocks==1.7.1
python-dateutil==1.5
pytz==2020.1
requests @ file:///tmp/build/80754af9/requests_1592841827918/work
six==1.15.0
soupsieve==2.0.1
sqlparse==0.3.1
urllib3==1.25.9
whitenoise==5.1.0
3 Answers

Follow the below steps:

  1. Check your package --> conda list (I used conda env)
  2. Edit the package in requirements.txt match that I've checked
  3. ex.psycopg2 @ file:///tmp/build/80754af9/psycopg2_1594305108220/work --> psycopg2==2.8.5
  4. Then commit all changes
  5. -push to heroku (I used heroku)

In Your requirements.txt, remove

idna @ file:///tmp/build/80754af9/idna_1593446292537/work psycopg2 @ file:///tmp/build/80754af9/psycopg2_1594305108220/work requests @ file:///tmp/build/80754af9/requests_1592841827918/work

then add requirements via git add and commit

then run push to heroku

I have the same issue when I make use of anaconda and I want to deploy the project on heroku server How i solved it at the root of my project

pip freeze > requirements.txt
# edited the content of the requirements.txt e.g
From
Jinja2 @ file:///tmp/build/80754af9/jinja2_1624781299557/work
To
Jinja2==3.0.1  
# you can have access to the packages version with command
pip freeze

Once you are through substituting the url to the version number of each package found in the requirement.txt file then proceed with

git add .
git commit -m "comment"
heroku login
git push heroku master
Related