Search code examples
djangoherokuheroku-cli

Git push django project error - No such file or directory


I typed git push heroku master in the command (Terminal) then this error occurs

remote: ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/home/ktietz/src/ci/alabaster_1611921544520/work'

How can I fix this?


Solution

  • It seems there is a problem with your requirements.txt file which contains all of your needed libraries and packages to be installed on remote.

    Do You have your requirement.txt file in your project root folder(where manage.py file resides) ???

    if not then you need to first activate your virtual environment and then create requirement.txt file by:

    pip freeze > requirements.txt
    

    you can see details on how to create and activate virtual environment here: official documentation https://docs.python.org/3/library/venv.html#creating-virtual-environments

    after you have your requirements.txt file ready then run the same git command

    git push heroku master
    

    if already have requirements.txt file in your project root folder then there is an isssue in your requirements.txt file which contains dependencies that might be incompatible.