Command errored out with exit status 1: - python

I have problem when i try to push my app on heroku,
so when i write git push heroku master this error is appear
remote: ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-48na90v5/importlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-48na90v5/importlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-dccx97n0
remote: cwd: /tmp/pip-install-48na90v5/importlib/
remote: Complete output (11 lines):
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/__init__.py", line 5, in <module>
remote: import distutils.core
remote: File "/app/.heroku/python/lib/python3.6/distutils/core.py", line 16, in <module>
remote: from distutils.dist import Distribution
remote: File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 19, in <module>
remote: from distutils.util import check_environ, strtobool, rfc822_escape
remote: File "/app/.heroku/python/lib/python3.6/distutils/util.py", line 9, in <module>
remote: import importlib.util
remote: ModuleNotFoundError: No module named 'importlib.util'
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed

Most probably it is the issue with libraries you are trying to install check for the versions as currently heroku uses latest version of python
or just change the python version specific to your project on heroku by using runtime.txt file in your root directory
I had also faced the exact same issue which I fixed by installing latest versions of the dependencies.
Try; definitely it will work.

Related

Problem with youtokentome when i deploy my project to Heroku

I try to deploy my python project to heroku and have this problem:
Collecting youtokentome==1.0.6
remote: Downloading youtokentome-1.0.6.tar.gz (86 kB)
remote: ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k3by6gof/youtokentome/setup.py'"'"'; __file__='"'"'/tmp/pip-install-k3by6gof/youtokentome/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-hayjf3lo
remote: cwd: /tmp/pip-install-k3by6gof/youtokentome/
remote: Complete output (5 lines):
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-install-k3by6gof/youtokentome/setup.py", line 5, in <module>
remote: from Cython.Build import cythonize
remote: ModuleNotFoundError: No module named 'Cython'
remote:
----------------------------------------
But i have: Cython==0.29.24 in my requirements.txt

Why did push of a Flask app to Heroku failed?

I'm simply trying to push my Flask app to Heroku but I encountered the following error:
remote: ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qq0uk569/xlwings/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qq0uk569/xlwings/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-dxixzzkg
remote: cwd: /tmp/pip-install-qq0uk569/xlwings/
remote: Complete output (5 lines):
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-install-qq0uk569/xlwings/setup.py", line 32, in <module>
remote: raise OSError("xlwings requires an installation of Excel and therefore only works on Windows and macOS. To enable the installation on Linux nevertheless, do: export INSTALL_ON_LINUX=1; pip install xlwings")
remote: OSError: xlwings requires an installation of Excel and therefore only works on Windows and macOS. To enable the installation on Linux nevertheless, do: export INSTALL_ON_LINUX=1; pip install xlwings
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to browebgen.
remote:
To https://git.heroku.com/browebgen.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/browebgen.git'
I'm not sure what I need to do to get rid of this error.
The error message says it all:
xlwings requires an installation of Excel and therefore only works on Windows and macOS. To enable the installation on Linux nevertheless, do: export INSTALL_ON_LINUX=1; pip install xlwings
You might be using a package in your app named xlwings which is built to be used on Windows and Mac but the servers on Heroku have linux installed on them so you'll first have to set an environment variable INSTALL_ON_LINUX to 1 then try to deploy the app again.
From the Heroku CLI you can do:
heroku config:set INSTALL_ON_LINUX=1

Windows 10 Error Deploying to Heroku, Command errored out with exit status 1

Beginner here.
Trying to deploy my Python code to heroku when I encounter the error below
My machine runs on Windows 10.
I tried this solution but no progress.
Let me know what other info that you need!
ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9bupgo_6/Rtree/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9bupgo_6/Rtree/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-9bupgo_6/Rtree/pip-egg-info
remote: cwd: /tmp/pip-install-9bupgo_6/Rtree/
remote: Complete output (15 lines):
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-install-9bupgo_6/Rtree/setup.py", line 3, in <module>
remote: import rtree
remote: File "/tmp/pip-install-9bupgo_6/Rtree/rtree/__init__.py", line 1, in <module>
remote: from .index import Rtree
remote: File "/tmp/pip-install-9bupgo_6/Rtree/rtree/index.py", line 6, in <module>
remote: from . import core
remote: File "/tmp/pip-install-9bupgo_6/Rtree/rtree/core.py", line 145, in <module>
remote: rt.Error_GetLastErrorNum.restype = ctypes.c_int
remote: File "/app/.heroku/python/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
remote: func = self.__getitem__(name)
remote: File "/app/.heroku/python/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
remote: func = self._FuncPtr((name_or_ordinal, self))
remote: AttributeError: /app/.heroku/python/bin/python: undefined symbol: Error_GetLastErrorNum
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command o

deploying bot to heroku, can't push bot to heroku

I'm having issues deploying my bot i made using discord.py into discord using heroku. I've followed many guides and looked into mane other sources as well to why it is happening and nothing seems to be working. This is what i get....
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.10
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting git+https://github.com/tony1bally/education-helper (from -r /tmp/build_e8b937d57bb9efdeafd512bb63149ee1/requirements.txt (line 1))
remote: Cloning https://github.com/tony1bally/education-helper to /tmp/pip-req-build-7hfbm1vc
remote: Running command git clone -q https://github.com/tony1bally/education-helper /tmp/pip-req-build-7hfbm1vc
remote: ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-7hfbm1vc/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-7hfbm1vc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-7hfbm1vc/pip-egg-info
remote: cwd: /tmp/pip-req-build-7hfbm1vc/
remote: Complete output (5 lines):
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/app/.heroku/python/lib/python3.6/tokenize.py", line 452, in open
remote: buffer = _builtin_open(filename, 'rb')
remote: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-7hfbm1vc/setup.py'
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to education-helper.
remote:
To https://git.heroku.com/education-helper.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/education-helper.git'
Does anyone know why this is happening?
This is through the command prompt btw!
You've declared https://github.com/tony1bally/education-helper as a dependency in requirements.txt but the repository is empty and cannot be installed with pip as a Python module.
Remove it from requirements.txt, add, commit and push again.

Cant deploy flask app to heroku due to some dependency issue with scipy?

I am trying to deploy a simple "hello world" app in flask to heroku. Here is the code for the app itself (its named hello.py):
import os
from flask import Flask
app = Flask(__name__)
#app.route('/')
def hello():
return 'Hello World!'
if __name__=="__main__":
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port)
Here is the procfile:
web: gunicorn hello:app
When I try to deploy my app with the windows command prompt, it fails. I have extracted the part of the output which I think is relevant
remote: Running setup.py install for Werkzeug
remote:
remote:
remote: Running setup.py install for scipy
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-build-oRWdEw/scipy/setup.py", line 237, in <
module>
remote: setup_package()
remote: File "/tmp/pip-build-oRWdEw/scipy/setup.py", line 225, in s
etup_package
remote: from numpy.distutils.core import setup
remote: ImportError: No module named numpy.distutils.core
remote: Complete output from command /app/.heroku/python/bin/python -
c "import setuptools, tokenize;__file__='/tmp/pip-build-oRWdEw/scipy/setup.py';e
xec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n
'), __file__, 'exec'))" install --record /tmp/pip-_HDaE9-record/install-record.t
xt --single-version-externally-managed --compile:
remote: Traceback (most recent call last):
remote:
remote: File "<string>", line 1, in <module>
remote:
remote: File "/tmp/pip-build-oRWdEw/scipy/setup.py", line 237, in <
module>
remote:
remote: setup_package()
remote:
remote: File "/tmp/pip-build-oRWdEw/scipy/setup.py", line 225, in s
etup_package
remote:
remote: from numpy.distutils.core import setup
remote:
remote: ImportError: No module named numpy.distutils.core
remote:
remote: ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -c "import setuptools
, tokenize;__file__='/tmp/pip-build-oRWdEw/scipy/setup.py';exec(compile(getattr(
tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'
))" install --record /tmp/pip-_HDaE9-record/install-record.txt --single-version-
externally-managed --compile" failed with error code 1 in /tmp/pip-build-oRWdEw/
scipy
remote:
remote: ! Push rejected, failed to compile Python app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to cs242-chaya2-final.
remote:
Warning: Your console font probably doesn't support Unicode. If you experience s
trange characters in the output, consider switching to a TrueType font such as L
ucida Console!
To https://git.heroku.com/cs242-chaya2-final.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/cs242-chaya2-final.gi
t'
(venv) C:\Users\Kamal\Documents\School\Spring2015\CS242\cs242-chaya2-final>
I think the numpy.distutils.core is causing the error, I am not sure how to fix this though, can anyone help me out?
here is my requirements.txt:
beautifulsoup4==4.3.2
elasticsearch==1.4.0
Flask==0.10.1
Flask-Login==0.2.11
itsdangerous==0.24
Jinja2==2.7.3
MarkupSafe==0.23
numpy==1.6.2
scipy==0.14.0
urllib3==1.10.2
virtualenv==12.0.7
Werkzeug==0.10.1

Categories

Resources