'"ERROR: No .egg-info directory found" during deployment to heroku - django

Hello I'm deploying my first project on the heroku and I got an error:
ERROR: No .egg-info directory found in /tmp/pip-pip-egg-info-wgaqr45r
I have tried to update setuptools but it's not a case. Any Idea what could go wrong?
My git bash commands:
gg#DESKTOP-PNHHOHJ MINGW64 /c/projekty/tabele/tabenv (master)
$ git push heroku master
Enumerating objects: 9199, done.
Counting objects: 100% (9199/9199), done.
Delta compression using up to 4 threads
Compressing objects: 100% (5826/5826), done.
Writing objects: 100% (9199/9199), 17.71 MiB | 4.97 MiB/s, done.
Total 9199 (delta 2302), reused 9182 (delta 2296), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Python app detected
remote: cp: cannot stat '/tmp/build_8554d289/requirements.txt': No such file or directory
remote: -----> Installing python-3.8.8
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Obtaining file:///tmp/build_8554d289 (from -r /tmp/build_8554d289/requirements.txt (line 1))
remote: ERROR: No .egg-info directory found in /tmp/pip-pip-egg-info-wgaqr45r
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 830c4b88b9a54ed95a860492a144d53bf95172c0
remote: !
remote: ! We have detected that you have triggered a build from source code with version 830c4b88b9a54ed95a860492a144d53bf95172c0
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to thawing-falls-31558.
remote:
To https://git.heroku.com/thawing-falls-31558.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/thawing-falls-31558.git'
(tabenv)
gg#DESKTOP-PNHHOHJ MINGW64 /c/projekty/tabele/tabenv (master)
$ python.exe -m pip install --upgrade setuptools pip
Requirement already satisfied: setuptools in c:\projekty\tabele\tabenv\lib\site-packages (54.0.0)
Requirement already satisfied: pip in c:\projekty\tabele\tabenv\lib\site-packages (21.0.1)
(tabenv)

Related

No module named 'requests' - Django deployment onto Heroku

Deployed some new code into an app on Heroku and now showing the following message: No module named 'requests' . The app was working fine before, so this has to be something I changed.
Before I show the code there is 2 things that I noticed: my Procfile & requirements files are not visible from Visual Studio (can be seen from Sublime Text Editor). Recently started using VS and only noticed it now. Not sure if this is of importance here.
I am not sure where the error is coming from so I left below traceback, Procfile and requirements.txt files.
Let me know if I need to add something else.
Traceback
$ git push heroku master
Enumerating objects: 111, done.
Counting objects: 100% (111/111), done.
Delta compression using up to 4 threads
Compressing objects: 100% (80/80), done.
Writing objects: 100% (81/81), 129.38 KiB | 2.59 MiB/s, done.
Total 81 (delta 23), reused 1 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/python
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the same version as the last build: python-3.10.5
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: !
remote: ! A Python security update is available! Upgrade as soon as possible to: python-3.10.7
remote: ! See: https://devcenter.heroku.com/articles/python-runtimes
remote: !
remote: -----> No change in requirements detected, installing from cache
remote: -----> Using cached install of python-3.10.5
remote: -----> Installing pip 22.2.2, setuptools 63.4.3 and wheel 0.37.1
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: -----> $ python manage.py collectstatic --noinput
remote: Found another file with the destination path 'Logo.png'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote: 139 static files copied to '/tmp/build_42cf0f4b/staticfiles', 5 unmodified, 378 post-processed.
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 92.2M
remote: -----> Launching...
remote: Released v53
remote: App deployed to Heroku
Procfile
web: gunicorn mysite.wsgi
Requirements.txt
asgiref==3.5.2
click==8.1.3
colorama==0.4.5
defusedxml==0.7.1
diff-match-patch==20200713
dj-database-url==0.5.0
Django==4.0.6
django-crispy-forms==1.14.0
django-heroku==0.3.1
django-import-export==2.8.0
et-xmlfile==1.1.0
Flask==2.1.3
gunicorn==20.1.0
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupPy==1.14
MarkupSafe==2.1.1
numpy==1.23.1
odfpy==1.4.1
openpyxl==3.0.10
pandas==1.4.3
Pillow==9.2.0
psycopg2==2.9.3
pymongo==4.1.1
python-dateutil==2.8.2
python-decouple==3.6
pytz==2022.1
PyYAML==6.0
six==1.16.0
sqlparse==0.4.2
tablib==3.2.1
tzdata==2022.1
Werkzeug==2.1.2
whitenoise==6.2.0
xlrd==2.0.1
xlwt==1.3.0
You have to add requests in Requirements.txt like this :
requests==2.28.1
Install request by running the below command
pip install requests
Then update your Requirements.txt just run
pip freeze > Requirements.txt
This will add all libraries that you have used in the project including the newly installed.

error: failed to push some refs to 'https://git.heroku.com/xxxxxxxxx.git'

I got an error,error: failed to push some refs to 'https://git.heroku.com/xxxxxxxxx.git'.I want to upload my application which be made Django to heroku.I run heroku create xxxxxxxxx. And I run git push heroku ,so
Counting objects: 6951, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5952/5952), done.
Writing objects: 100% (6951/6951), 11.21 MiB | 891.00 KiB/s, done.
Total 6951 (delta 2087), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using python-3.6.4, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6.4
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: Collecting alabaster==0.7.10 (from -r /tmp/build_6adefb27873345001cb4512d3fd963e3/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.9 (from -r /tmp/build_6adefb27873345001cb4512d3fd963e3/requirements.txt (line 2))
remote: Could not find a version that satisfies the requirement anaconda-client==1.6.9 (from -r /tmp/build_6adefb27873345001cb4512d3fd963e3/requirements.txt (line 2)) (from versions: 1.1.1, 1.2.2)
remote: No matching distribution found for anaconda-client==1.6.9 (from -r /tmp/build_6adefb27873345001cb4512d3fd963e3/requirements.txt (line 2))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to xxxxxxxxx.
remote:
To https://git.heroku.com/xxxxxxxxx.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/xxxxxxxxx.git'
I searched this error,maybe conda install pip command should be installed.So I run it and heroku create command run again, but same error happens.What is wrong?How should I fix this?
The error is telling you that it cannot install anaconda-client, because it can't find version 1.6.9 which you specified in the requirements.txt. The latest version of that library on PyPi is version 1.2.2. However, it appears to be abandoned - why have you specified it at all? What are you using it for?

Outdated Pipfile.lock

I'm trying to deploy a large django project to heroku. I installed Heroku CLI, logged in, created an app and ran:
git push heroku master
I have a Pipfile and requirements.txt already set up. I added a runtime.txt to specify that I need python 2.7. This is also in the Pipfile. This is what I get from pushing to heroku:
Counting objects: 12159, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4853/4853), done.
Writing objects: 100% (12159/12159), 20.94 MiB | 1.82 MiB/s, done.
Total 12159 (delta 6859), reused 12036 (delta 6751)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.4
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 11.8.2…
remote: Your Pipfile.lock (3b2ba9) is out of date. Expected: (83a5b4).
remote: Aborting deploy.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy....
remote:
remote: ! Push rejected to camp-infinity.
remote:
To https://git.heroku.com/camp-infinity.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/camp-infinity.git'
I'm not sure why it tries to install python 3, and it also doesn't like my Pipfile.lock file. I've tried deleting it and generating it again with pipenv install but that didn't change anything.
Make sure you have initialised your environment in Python 2.X with pipenv --two, then - given your code runs locally and all dependencies are specified in your Pipfile - run pipenv install and commit all changes including the Pipfile.lock to your local git repo (git add * && git commit -m "your message"). Finally push to heroku. Hope it now builds correctly.

Push rejected to herokuapp

I am trying to host my dango rest app on heroku. When i run
git push heroku master
I get the error log
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.4 (you
are using python-3.6.3, which is unsupported).
remote: ! We recommend upgrading by specifying the latest
version (python-3.6.4).
remote: Learn More:
https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing requirements with pip
remote: Collecting pkg-resources==0.0.0 (from -r
/tmp/build_76cc8692e5f28e80c394427df6e4d58b/requirements.txt (line
9))
remote: Could not find a version that satisfies the
requirement pkg-resources==0.0.0 (from -r /
tmp/build_76cc8692e5f28e80c394427df6e4d58b/requirements.txt (line 9))
(from versions: )
remote: No matching distribution found for pkg-
resources==0.0.0 (from -r
/tmp/build_76cc8692e5f28e80c394427df6e4d58b/requirements.txt (line
9))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to myapp.
remote:
To https://git.heroku.com/myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
'https://git.heroku.com/myapp.git'
The requirements.txt file is
dj-database-url==0.4.2
Django==1.11.2
django-rest-auth==0.9.2
djangorestframework==3.6.4
djangorestframework-jwt==1.11.0
gunicorn==19.7.1
olefile==0.44
Pillow==4.2.0
psycopg2==2.7.3
PyJWT==1.5.3
pytz==2017.2
six==1.11.0
whitenoise==3.3.1
push is rejected by heroku. please help.
Does your local requirements.txt match requirements.txt from master branch?
I had the same problem and finaly I realized that my master branch had that pkg-resources line in requirements.txt while my local copy hadn't. I deleted that line from requirements.txt, did git commit, git push and next time I tried to push my app to heroku I succeed.

Deploying Python bottle app with pymssql on heroku

I'm having issues with deploying my website with pymssql onto heroku. I'm using the following build pack and still am having errors:
heroku config:add BUILDPACK_URL=https://github.com/amanjain/heroku-buildpack-python-freetds-pymssql.git
This is the error that I keep getting:
remote: warning: no files found matching 'pymssql_version.py'
remote: warning: no files found matching 'win32/freetds.zip'
remote: warning: no previously-included files matching '*' found under directory 'docs/_build'
remote: Successfully installed pymssql
remote: Cleaning up...
remote: -----> Installing dependencies with pip
remote: Downloading/unpacking bottle==0.12.9 (from -r requirements.txt (line 1))
remote: Running setup.py (path:/tmp/pip_build_u13919/bottle/setup.py) egg_info for package bottle
remote:
remote: Downloading/unpacking DateTime==4.0.1 (from -r requirements.txt (line 2))
remote: Running setup.py (path:/tmp/pip_build_u13919/DateTime/setup.py) egg_info for package DateTime
remote:
remote: Downloading/unpacking functools32==3.2.3.post2 (from -r requirements.txt (line 3))
remote: Could not find a version that satisfies the requirement functools32==3.2.3.post2 (from -r requirements.txt (line 3)) (from versions: 3.2.3-1, 3.2.3-1, 3.2.3-2, 3.2.3-2)
remote: Cleaning up...
remote: No distributions matching the version for functools32==3.2.3.post2 (from -r requirements.txt (line 3))
remote: Storing debug log for failure in /app/.pip/pip.log
remote:
remote: ! Push rejected, failed to compile Python + FreeTDS + pymssql app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to shelf2xerotest1.
remote:
To https://git.heroku.com/shelf2xerotest1.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
'https://git.heroku.com/shelf2xerotest1.git'
Has anyone else run into this issue?
It looks like that buildpack is built for Linux systems, and it appears you're trying to install it on Windows.
In the trace log, it appears to be looking for a FreeTDS build in a win32 directory:
warning: no files found matching 'win32/freetds.zip'
It also appears to be install Python 2.7. If you're just getting started, I'd strongly recommend using Python 3. Good luck.