[python] How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip

I am trying to install django-heroku using pip, but it keeps running into an error.

I have seen suggestions telling me to make sure my Python version in Heroku is up to date. I have already done that. After pushing to Heroku master, I ran the install command, but it gives me the following errors.

pip install django-heroku

Error:

ERROR: Command errored out with exit status 1:
command: /Users/user/Dev/trydjango/new_env/bin/python -c 'import
sys, setuptools, tokenize; sys.argv[0] =
'"'"'/private/var/folders/xl/s533dc515qs8sd3tpg7y5ty80000gp/T/pip-
install-xqsix26g/psycopg2/setup.py'"'"';

egg_info --egg-base pip-egg-info
     cwd:
/private/var/folders/xl/s533dc515qs8sd3tpg7y5ty80000gp/T/pip-
install-xqsix26g/psycopg2/
Complete output (23 lines):
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-
info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-
info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add t .   he directory
containing pg_config to the $PATH or specify the full executable
path with the
option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

If you prefer to avoid building psycopg2 from source, please
install the PyPI
'psycopg2-binary' package instead.

For further information please check the 'doc/src/install.rst' file
(also at
<http://initd.org/psycopg/docs/install.html>).

----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py
egg_info Check the logs for full command output.

This question is related to python django heroku pip

The answer is


You need to add the package containing the executable pg_config.

A prior answer should have details you need: pg_config executable not found


Questions with python tag:

programming a servo thru a barometer Is there a way to view two blocks of code from the same file simultaneously in Sublime Text? python variable NameError Why my regexp for hyphenated words doesn't work? Comparing a variable with a string python not working when redirecting from bash script is it possible to add colors to python output? Get Public URL for File - Google Cloud Storage - App Engine (Python) Real time face detection OpenCV, Python xlrd.biffh.XLRDError: Excel xlsx file; not supported Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation Upgrade to python 3.8 using conda Unable to allocate array with shape and data type How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip How to prevent Google Colab from disconnecting? "UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure." when plotting figure with pyplot on Pycharm How to fix 'Object arrays cannot be loaded when allow_pickle=False' for imdb.load_data() function? "E: Unable to locate package python-pip" on Ubuntu 18.04 Tensorflow 2.0 - AttributeError: module 'tensorflow' has no attribute 'Session' Jupyter Notebook not saving: '_xsrf' argument missing from post How to Install pip for python 3.7 on Ubuntu 18? Python: 'ModuleNotFoundError' when trying to import module from imported package OpenCV TypeError: Expected cv::UMat for argument 'src' - What is this? Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") Error in PyCharm requesting website How to setup virtual environment for Python in VS Code? Pylint "unresolved import" error in Visual Studio Code Pandas Merging 101 Numpy, multiply array with scalar What is the meaning of "Failed building wheel for X" in pip install? Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed Could not install packages due to an EnvironmentError: [Errno 13] OpenCV !_src.empty() in function 'cvtColor' error ConvergenceWarning: Liblinear failed to converge, increase the number of iterations How to downgrade python from 3.7 to 3.6 I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? Iterating over arrays in Python 3 How do I install opencv using pip? How do I install Python packages in Google's Colab? How do I use TensorFlow GPU? How to upgrade Python version to 3.7? How to resolve TypeError: can only concatenate str (not "int") to str How can I install a previous version of Python 3 in macOS using homebrew? Flask at first run: Do not use the development server in a production environment TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array What is the difference between Jupyter Notebook and JupyterLab? Pytesseract : "TesseractNotFound Error: tesseract is not installed or it's not in your path", how do I fix this? Could not install packages due to a "Environment error :[error 13]: permission denied : 'usr/local/bin/f2py'" How do I resolve a TesseractNotFoundError? Trying to merge 2 dataframes but get ValueError Authentication plugin 'caching_sha2_password' is not supported Python Pandas User Warning: Sorting because non-concatenation axis is not aligned

Questions with django tag:

How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip Pylint "unresolved import" error in Visual Studio Code Is it better to use path() or url() in urls.py for django 2.0? Unable to import path from django.urls Error loading MySQLdb Module 'Did you install mysqlclient or MySQL-python?' ImportError: Couldn't import Django Django - Reverse for '' not found. '' is not a valid view function or pattern name Class has no objects member Getting TypeError: __init__() missing 1 required positional argument: 'on_delete' when trying to add parent table after child table with entries How to switch Python versions in Terminal? ImportError: No module named 'django.core.urlresolvers' How to set environment variables in PyCharm? How to get Django and ReactJS to work together? Invalid http_host header Django model "doesn't declare an explicit app_label" "Post Image data using POSTMAN" TypeError: int() argument must be a string, a bytes-like object or a number, not 'list' Django URLs TypeError: view must be a callable or a list/tuple in the case of include() What is a NoReverseMatch error, and how do I fix it? What does on_delete do on Django models? Django values_list vs values Django download a file Uncaught TypeError: $(...).datepicker is not a function(anonymous function) Django - makemigrations - No changes detected How can I enable CORS on Django REST Framework Django - Did you forget to register or load this tag? Django upgrading to 1.9 error "AppRegistryNotReady: Apps aren't loaded yet." Django Rest Framework -- no module named rest_framework How to revert the last migration? What's the difference between select_related and prefetch_related in Django ORM? Django: save() vs update() to update the database? Where does pip install its packages? no module named urllib.parse (How should I install it?) How to set the timezone in Django? You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application Django Model() vs Model.objects.create() NumPy array is not JSON serializable React Error: Target Container is not a DOM Element OperationalError, no such column. Django how to use python2.7 pip instead of default pip The view didn't return an HttpResponse object. It returned None instead You are trying to add a non-nullable field 'new_field' to userprofile without a default ImproperlyConfigured: You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings 'NOT NULL constraint failed' after adding to models.py Django 1.7 - "No migrations to apply" when run migrate after makemigrations How to compare two JSON objects with the same elements in a different order equal? Django: OperationalError No Such Table Embed YouTube video - Refused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN' Django 1.7 throws django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet Mac OS X - EnvironmentError: mysql_config not found

Questions with heroku tag:

How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip Can't push to the heroku ImproperlyConfigured: You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings How to enable CORS in flask Error: Cannot pull with rebase: You have unstaged changes How to solve error "Missing `secret_key_base` for 'production' environment" (Rails 4.1) Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin ('null') 'heroku' does not appear to be a git repository Heroku 'Permission denied (publickey) fatal: Could not read from remote repository' woes How do I set up DNS for an apex domain (no www) pointing to a Heroku app? Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch) npm ERR cb() never called Rails: How to reference images in CSS within Rails 4 How to restart a rails server on Heroku? First Heroku deploy failed `error code=H10` Heroku deployment error H10 (App crashed) Heroku "psql: FATAL: remaining connection slots are reserved for non-replication superuser connections" Should I check in folder "node_modules" to Git when creating a Node.js app on Heroku? Why do people use Heroku when AWS is present? What distinguishes Heroku from AWS? failed to push some refs to [email protected] setting an environment variable in virtualenv How to configure heroku application DNS to Godaddy Domain? How to change a Git remote on Heroku Easy way to prevent Heroku idling? How to link a folder with an existing Heroku app How to empty a Heroku database Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedly Heroku: How to push different local Git branches to Heroku/master How to stop an app on Heroku? heroku - how to see all the logs

Questions with pip tag:

How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? What is the meaning of "Failed building wheel for X" in pip install? Could not install packages due to an EnvironmentError: [Errno 13] How do I install Python packages in Google's Colab? Conda version pip install -r requirements.txt --target ./lib pip: no module named _internal AttributeError: Module Pip has no attribute 'main' Error after upgrading pip: cannot import name 'main' Not able to install Python packages [SSL: TLSV1_ALERT_PROTOCOL_VERSION] 'pip install' fails for every package ("Could not find a version that satisfies the requirement") Could not find a version that satisfies the requirement tensorflow pip install returning invalid syntax How to update/upgrade a package using pip? Pipenv: Command Not Found pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available "Could not find a version that satisfies the requirement opencv-python" How to start Spyder IDE on Windows Python: How to pip install opencv2 with specific version 2.4.9? How to install PIP on Python 3.6? What is the purpose of "pip install --user ..."? How to install pandas from pip on windows cmd? How to install pip for Python 3.6 on Ubuntu 16.10? "SSL certificate verify failed" using pip to install packages ImportError: No module named tensorflow python pip on Windows - command 'cl.exe' failed How to install pip3 on Windows? "pip install json" fails on Ubuntu How to use requirements.txt to install all dependencies in a python project "ssl module in Python is not available" when installing package with pip3 Using Pip to install packages to Anaconda Environment Checking whether the pip is installed? pip or pip3 to install packages for Python 3? pip not working in Python Installation in Windows 10 How to add a custom CA Root certificate to the CA Store used by pip in Windows? TensorFlow not found using pip Conda uninstall one package and one package only How to install Openpyxl with pip python mpl_toolkits installation issue Python PIP Install throws TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' Pip - Fatal error in launcher: Unable to create process using '"' Pip "Could not find a that satisfies the requirement" How do I install a pip package globally instead of locally? installing python packages without internet and using source code as .tar.gz and .whl Install pip in docker pip install - locale.Error: unsupported locale setting "pip install unroll": "python setup.py egg_info" failed with error code 1 pip installs packages successfully, but executables not found from command line Pip install - Python 2.7 - Windows 7