Home > Mobile >  Git push django project error - No such file or directory
Git push django project error - No such file or directory

Time:01-10

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?

CodePudding user response:

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.

CodePudding user response:

First : check your requirements.txt file it should contain only package_name==<version> not path.


Second : your file name should be requirements.txt not requirement.txt because heroku idenifies python app by requirements.txt file name.


Third : check that your requirements.txt file is in root directory (where manage.py exists)

  •  Tags:  
  • Related