I'm getting a rejected error when trying to deploy a Django app to Heroku. I looked at possible solutions here:
Heroku push rejected, failed to compile Python/django app (Python 2.7)
Error pushing Django project to Heroku
But neither worked for me.
This is my flow from initiating the push to heroku:
git push heroku master
Initializing repository, done.
Counting objects: 7024, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5915/5915), done.
Writing objects: 100% (7024/7024), 8.77 MiB | 104 KiB/s, done.
Total 7024 (delta 2183), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.6.
-----> Preparing Python runtime (python-2.7.6)
-----> Installing Setuptools (2.1)
-----> Installing Pip (1.5.4)
-----> Installing dependencies using Pip (1.5.4)
Downloading/unpacking Django==1.6.2 (from -r requirements.txt (line 1))
Downloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 2))
argparse an externally hosted file and may be unreliable
Running setup.py (path:/tmp/pip_build_u16439/argparse/setup.py) egg_info for package argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Downloading/unpacking distribute==0.6.24 (from -r requirements.txt (line 3))
Running setup.py (path:/tmp/pip_build_u16439/distribute/setup.py) egg_info for package distribute
warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'
Downloading/unpacking dj-database-url==0.3.0 (from -r requirements.txt (line 4))
Downloading dj_database_url-0.3.0-py2.py3-none-any.whl
Downloading/unpacking dj-static==0.0.5 (from -r requirements.txt (line 5))
Downloading dj-static-0.0.5.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/dj-static/setup.py) egg_info for package dj-static
Downloading/unpacking django-toolbelt==0.0.1 (from -r requirements.txt (line 6))
Downloading django-toolbelt-0.0.1.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/django-toolbelt/setup.py) egg_info for package django-toolbelt
Downloading/unpacking gunicorn==18.0 (from -r requirements.txt (line 7))
Running setup.py (path:/tmp/pip_build_u16439/gunicorn/setup.py) egg_info for package gunicorn
Downloading/unpacking psycopg2==2.5.2 (from -r requirements.txt (line 8))
Running setup.py (path:/tmp/pip_build_u16439/psycopg2/setup.py) egg_info for package psycopg2
Downloading/unpacking pystache==0.5.3 (from -r requirements.txt (line 9))
Running setup.py (path:/tmp/pip_build_u16439/pystache/setup.py) egg_info for package pystache
pystache: using: version '2.1' of <module 'setuptools' from '/app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg/setuptools/__init__.pyc'>
Downloading/unpacking static==1.0.2 (from -r requirements.txt (line 10))
Downloading static-1.0.2.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/static/setup.py) egg_info for package static
Installing collected packages: Django, argparse, distribute, dj-database-url, dj-static, django-toolbelt, gunicorn, psycopg2, pystache, static
Running setup.py install for argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Running setup.py install for distribute
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
Egg installation
Patching...
Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32
Patched done.
Relaunching...
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'install' is not defined
Complete output from command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile:
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
Egg installation
Patching...
Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32
Patched done.
Relaunching...
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'install' is not defined
----------------------------------------
Cleaning up...
Command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_u16439/distribute
Storing debug log for failure in /app/.pip/pip.log
! Push rejected, failed to compile Python app
My requirements.txt
Django==1.6.2
argparse==1.2.1
distribute==0.6.24
dj-database-url==0.3.0
dj-static==0.0.5
django-toolbelt==0.0.1
gunicorn==18.0
psycopg2==2.5.2
pystache==0.5.3
static==1.0.2
wsgiref==0.1.2
Procfile
web: gunicorn app.wsgi
I've followed the instructions from the Heroku website. Any idea what I'm missing?
This is apparently a bug in the distribute package, which doesn't seem likely to get fixed:
Distribute is now considered deprecated and replaced by setuptools. I suggest replacing 'distribute==0.6.28' in requirements.txt with 'setuptools==1.0' or similar. The latest versions of pip (>=1.4) and setuptools (>=0.7) have better support for the unified code and upgrades and seek to obviate issues like the one encountered here.
This is a problem with the deprecated distribute package. See Bug #91 on Bitbucket.
Replacing distribute==0.6.24 with setuptools==0.7.3 in your requirements.txt file should remedy your problem.
In runtime.txt file, any of these versions can be included:
python-3.10.6 on all supported stacks (recommended)
python-3.9.13 on all supported stacks
python-3.8.13 on Heroku-18 and Heroku-20 only
python-3.7.13 on Heroku-18 and Heroku-20 only
This will resolve your error.
I had this error until I upgraded the Heroku stack from cedar-14 (old and deprecated) to Heroku-18 (new). Then everything worked.
From the message we can cleary see "No runtime.txt provided; assuming python-2.7.6." Create the runtime.txt file and add a python version from the ones supported by heroku (https://devcenter.heroku.com/articles/python-support#recognizing-a-python-app)
one of the packages in the requirements.txt is clashing with your python version
Related
This question already has answers here:
Error trying to install Postgres for python (psycopg2)
(12 answers)
pg_config executable not found
(54 answers)
Closed 1 year ago.
When I'm trying to install the requirements for a project with pip install -r requirements.txt
It keeps failing with the following output.
[sarthak#envy cyc1eon]$ pip install -r requirements.txt
Defaulting to user installation because normal site-packages is not writeable
Collecting asgiref==3.2.10
Downloading asgiref-3.2.10-py3-none-any.whl (19 kB)
Collecting dj-database-url==0.5.0
Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB)
Collecting Django==3.0.8
Downloading Django-3.0.8-py3-none-any.whl (7.5 MB)
|████████████████████████████████| 7.5 MB 2.6 MB/s
Collecting django-heroku==0.3.1
Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
Collecting gunicorn==20.0.4
Downloading gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
|████████████████████████████████| 77 kB 5.5 MB/s
Requirement already satisfied: setuptools>=3.0 in /usr/lib/python3.9/site-packages (from gunicorn==20.0.4->-r requirements.txt (line 5)) (54.2.0)
Collecting psycopg2==2.8.5
Downloading psycopg2-2.8.5.tar.gz (380 kB)
|████████████████████████████████| 380 kB 9.7 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lc8h8hyn/psycopg2_4a4c96a147204fd489df1a2f7201063a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lc8h8hyn/psycopg2_4a4c96a147204fd489df1a2f7201063a/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-ztzh9r6w
cwd: /tmp/pip-install-lc8h8hyn/psycopg2_4a4c96a147204fd489df1a2f7201063a/
Complete output (23 lines):
running egg_info
creating /tmp/pip-pip-egg-info-ztzh9r6w/psycopg2.egg-info
writing /tmp/pip-pip-egg-info-ztzh9r6w/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-ztzh9r6w/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-pip-egg-info-ztzh9r6w/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-ztzh9r6w/psycopg2.egg-info/SOURCES.txt'
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the 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
<https://www.psycopg.org/docs/install.html>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The requirements for the project are
asgiref==3.2.10
dj-database-url==0.5.0
Django==3.0.8
django-heroku==0.3.1
gunicorn==20.0.4
psycopg2==2.8.5
psycopg2-binary==2.8.5
python-decouple==3.3
pytz==2020.1
sqlparse==0.3.1
whitenoise==5.1.0
The error message is clear - missing pg-config and thus unable to build from source. Alternative to building from source is to use psycorg2-binary - already present in the requirements.txt and suggested in the error message itself:
If you prefer to avoid building psycopg2 from source, please install
the PyPI 'psycopg2-binary' package instead
Just remove psycopg2==2.8.5 from requirements.txt.
Alternatively check pg_config executable not found
try replacing:
asgiref==3.2.10
dj-database-url==0.5.0
Django==3.0.8
django-heroku==0.3.1
gunicorn==20.0.4
psycopg2==2.8.5
psycopg2-binary==2.8.5
python-decouple==3.3
pytz==2020.1
sqlparse==0.3.1
whitenoise==5.1.0
in requirements.txt by:
asgiref
dj-database-url
Django
django-heroku
gunicorn
psycopg2
psycopg2-binary
python-decouple
pytz
sqlparse
whitenoise
I'm getting a rejected error when trying to deploy a Django app to Heroku. I looked at possible solutions here:
Heroku push rejected, failed to compile Python/django app (Python 2.7)
Error pushing Django project to Heroku
But neither worked for me.
This is my flow from initiating the push to heroku:
git push heroku master
Initializing repository, done.
Counting objects: 7024, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5915/5915), done.
Writing objects: 100% (7024/7024), 8.77 MiB | 104 KiB/s, done.
Total 7024 (delta 2183), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.6.
-----> Preparing Python runtime (python-2.7.6)
-----> Installing Setuptools (2.1)
-----> Installing Pip (1.5.4)
-----> Installing dependencies using Pip (1.5.4)
Downloading/unpacking Django==1.6.2 (from -r requirements.txt (line 1))
Downloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 2))
argparse an externally hosted file and may be unreliable
Running setup.py (path:/tmp/pip_build_u16439/argparse/setup.py) egg_info for package argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Downloading/unpacking distribute==0.6.24 (from -r requirements.txt (line 3))
Running setup.py (path:/tmp/pip_build_u16439/distribute/setup.py) egg_info for package distribute
warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'
Downloading/unpacking dj-database-url==0.3.0 (from -r requirements.txt (line 4))
Downloading dj_database_url-0.3.0-py2.py3-none-any.whl
Downloading/unpacking dj-static==0.0.5 (from -r requirements.txt (line 5))
Downloading dj-static-0.0.5.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/dj-static/setup.py) egg_info for package dj-static
Downloading/unpacking django-toolbelt==0.0.1 (from -r requirements.txt (line 6))
Downloading django-toolbelt-0.0.1.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/django-toolbelt/setup.py) egg_info for package django-toolbelt
Downloading/unpacking gunicorn==18.0 (from -r requirements.txt (line 7))
Running setup.py (path:/tmp/pip_build_u16439/gunicorn/setup.py) egg_info for package gunicorn
Downloading/unpacking psycopg2==2.5.2 (from -r requirements.txt (line 8))
Running setup.py (path:/tmp/pip_build_u16439/psycopg2/setup.py) egg_info for package psycopg2
Downloading/unpacking pystache==0.5.3 (from -r requirements.txt (line 9))
Running setup.py (path:/tmp/pip_build_u16439/pystache/setup.py) egg_info for package pystache
pystache: using: version '2.1' of <module 'setuptools' from '/app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg/setuptools/__init__.pyc'>
Downloading/unpacking static==1.0.2 (from -r requirements.txt (line 10))
Downloading static-1.0.2.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/static/setup.py) egg_info for package static
Installing collected packages: Django, argparse, distribute, dj-database-url, dj-static, django-toolbelt, gunicorn, psycopg2, pystache, static
Running setup.py install for argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Running setup.py install for distribute
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
Egg installation
Patching...
Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32
Patched done.
Relaunching...
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'install' is not defined
Complete output from command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile:
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
Egg installation
Patching...
Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32
Patched done.
Relaunching...
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'install' is not defined
----------------------------------------
Cleaning up...
Command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_u16439/distribute
Storing debug log for failure in /app/.pip/pip.log
! Push rejected, failed to compile Python app
My requirements.txt
Django==1.6.2
argparse==1.2.1
distribute==0.6.24
dj-database-url==0.3.0
dj-static==0.0.5
django-toolbelt==0.0.1
gunicorn==18.0
psycopg2==2.5.2
pystache==0.5.3
static==1.0.2
wsgiref==0.1.2
Procfile
web: gunicorn app.wsgi
I've followed the instructions from the Heroku website. Any idea what I'm missing?
This is apparently a bug in the distribute package, which doesn't seem likely to get fixed:
Distribute is now considered deprecated and replaced by setuptools. I suggest replacing 'distribute==0.6.28' in requirements.txt with 'setuptools==1.0' or similar. The latest versions of pip (>=1.4) and setuptools (>=0.7) have better support for the unified code and upgrades and seek to obviate issues like the one encountered here.
This is a problem with the deprecated distribute package. See Bug #91 on Bitbucket.
Replacing distribute==0.6.24 with setuptools==0.7.3 in your requirements.txt file should remedy your problem.
In runtime.txt file, any of these versions can be included:
python-3.10.6 on all supported stacks (recommended)
python-3.9.13 on all supported stacks
python-3.8.13 on Heroku-18 and Heroku-20 only
python-3.7.13 on Heroku-18 and Heroku-20 only
This will resolve your error.
I had this error until I upgraded the Heroku stack from cedar-14 (old and deprecated) to Heroku-18 (new). Then everything worked.
From the message we can cleary see "No runtime.txt provided; assuming python-2.7.6." Create the runtime.txt file and add a python version from the ones supported by heroku (https://devcenter.heroku.com/articles/python-support#recognizing-a-python-app)
one of the packages in the requirements.txt is clashing with your python version
this is the error i am getting while uploading my project to heroku.
remote: running build_ext
remote: Package gobject-introspection-1.0 was not found in the pkg-config search path.
remote: Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
remote: to the PKG_CONFIG_PATH environment variable
remote: No package 'gobject-introspection-1.0' found
remote: Command '('pkg-config', '--print-errors', '--exists', 'gobject-introspection-1.0 >= 1.46.0')' returned non-zero exit status 1.
remote:
remote: Try installing it with: 'sudo apt install libgirepository1.0-dev'
remote:
remote: ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tqn048tg/PyGObject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-6agyazal-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-tqn048tg/PyGObject/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
i am already installed libgirepository1.0.
packages in requirements.txt are succesfully installed.
First I'd try to install the developer package of libgirepository1.0. That's Linux distribution dependent how you'd achieve that and what is the exact name of the developer package:
Fedora, CentOS, RHEL, etc.: gobject-introspection-devel
Debian, Ubuntu, Mint, etc.: libgirepository1.0-dev
Arch: gobject-introspection
If that doesn't help then you may be missing some packages from your requirements.txt, as an example see: No package 'gobject-introspection-1.0' found while deploying to Heroku
To know what you are missing we'd need to know more about your configuration.
Hi I've been trying to install cryptography into my venv, but my venv doesn't find 'bdist_wheel'. (Python3)
I installed wheel like so pip install --user wheel and tried to install cryptography pip install --user cryptography I get back this error error: invalid command 'bdist_wheel' during the setup.py script. I've also tried pip install --upgrade setuptools
What am I missing? I've seen similar QAs in here but didn't seem to occur inside a venv.
pip install --user cryptography
Collecting cryptography
Using cached https://files.pythonhosted.org/packages/ec/b2/faa78c1ab928d2b2c634c8b41ff1181f0abdd9adf9193211bd606ffa57e2/cryptography-2.2.2.tar.gz
Collecting idna>=2.1 (from cryptography)
Using cached https://files.pythonhosted.org/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography)
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting six>=1.4.1 (from cryptography)
Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting cffi>=1.7 (from cryptography)
Using cached https://files.pythonhosted.org/packages/59/cc/0e1635b4951021ef35f5c92b32c865ae605fac2a19d724fb6ff99d745c81/cffi-1.11.5-cp35-cp35m-manylinux1_x86_64.whl
Collecting pycparser (from cffi>=1.7->cryptography)
Building wheels for collected packages: cryptography
Running setup.py bdist_wheel for cryptography ... error
Complete output from command /usr/local/virtualenvs/profiles_api/profiles_api3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2sa4x5ab/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmplvmgp_y8pip-wheel- --python-tag cp35:
Installed /tmp/pip-build-2sa4x5ab/cryptography/.eggs/cffi-1.11.5-py3.5-linux-x86_64.egg
Searching for pycparser
Reading https://pypi.python.org/simple/pycparser/
Best match: pycparser 2.18
Downloading https://files.pythonhosted.org/packages/8c/2d/aad7f16146f4197a11f8e91fb81df177adcc2073d36a17b1491fd09df6ed/pycparser-2.18.tar.gz#sha256=99a8ca03e29851d96616ad0404b4aad7d9ee16f25c9f9708a11faf2810f7b226
Processing pycparser-2.18.tar.gz
Writing /tmp/easy_install-_vc_2z13/pycparser-2.18/setup.cfg
Running pycparser-2.18/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_vc_2z13/pycparser-2.18/egg-dist-tmp-omz1wtad
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
pycparser.ply.__pycache__.lex.cpython-35: module references __file__
pycparser.ply.__pycache__.lex.cpython-35: module MAY be using inspect.getsourcefile
pycparser.ply.__pycache__.ygen.cpython-35: module references __file__
pycparser.ply.__pycache__.yacc.cpython-35: module references __file__
pycparser.ply.__pycache__.yacc.cpython-35: module MAY be using inspect.getsourcefile
pycparser.ply.__pycache__.yacc.cpython-35: module MAY be using inspect.stack
creating /tmp/pip-build-2sa4x5ab/cryptography/.eggs/pycparser-2.18-py3.5.egg
Extracting pycparser-2.18-py3.5.egg to /tmp/pip-build-2sa4x5ab/cryptography/.eggs
Installed /tmp/pip-build-2sa4x5ab/cryptography/.eggs/pycparser-2.18-py3.5.egg
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for cryptography
Running setup.py clean for cryptography
Failed to build cryptography
Installing collected packages: idna, asn1crypto, six, pycparser, cffi, cryptography
Running setup.py install for cryptography ... done
Successfully installed asn1crypto cffi cryptography idna pycparser six
I followed the installation steps in
https://gist.github.com/azvoleff/f8f06d22a8a4d89401e09d6607a5ecc4
to install cartoDB to Ubuntu 16.04.
everything is fine and installed correctly (although i used RVM instead of getting ruby's source code and compile it myself as suggested from the steps).
but when running:
pip install --no-use-wheel -r python_requirements.txt
there is an error, says about gdal, but it's different with the error mentioned in the steps.
DEPRECATION: --no-use-wheel is deprecated and will be removed in the future. Please use --no-binary :all: instead.
Requirement already satisfied: chardet==2.3.0 in /usr/local/lib/python2.7/dist-packages (from -r python_requirements.txt (line 1))
Requirement already satisfied: argparse==1.2.1 in /usr/lib/python2.7 (from -r python_requirements.txt (line 2))
Requirement already satisfied: brewery==0.6 in /usr/local/lib/python2.7/dist-packages (from -r python_requirements.txt (line 3))
Requirement already satisfied: redis==2.4.9 in /usr/local/lib/python2.7/dist-packages (from -r python_requirements.txt (line 4))
Requirement already satisfied: python-varnish==0.1.2 in /usr/local/lib/python2.7/dist-packages (from -r python_requirements.txt (line 5))
Collecting gdal==1.10.0 (from -r python_requirements.txt (line 6))
Using cached GDAL-1.10.0.tar.gz
Collecting csvkit==0.9.0 (from -r python_requirements.txt (line 7))
Using cached csvkit-0.9.0.tar.gz
Collecting openpyxl==2.1.3 (from -r python_requirements.txt (line 8))
Using cached openpyxl-2.1.3.tar.gz
Collecting xlrd>=0.7.1 (from csvkit==0.9.0->-r python_requirements.txt (line 7))
Using cached xlrd-1.1.0.tar.gz
Collecting sqlalchemy>=0.6.6 (from csvkit==0.9.0->-r python_requirements.txt (line 7))
Using cached SQLAlchemy-1.2.0.tar.gz
Collecting six>=1.6.1 (from csvkit==0.9.0->-r python_requirements.txt (line 7))
Using cached six-1.11.0.tar.gz
Collecting python-dateutil==2.2 (from csvkit==0.9.0->-r python_requirements.txt (line 7))
Using cached python-dateutil-2.2.tar.gz
Collecting dbf==0.94.003 (from csvkit==0.9.0->-r python_requirements.txt (line 7))
Using cached dbf-0.94.003.tar.gz
Collecting jdcal (from openpyxl==2.1.3->-r python_requirements.txt (line 8))
Using cached jdcal-1.3.tar.gz
Skipping bdist_wheel for gdal, due to binaries being disabled for it.
Skipping bdist_wheel for csvkit, due to binaries being disabled for it.
Skipping bdist_wheel for openpyxl, due to binaries being disabled for it.
Skipping bdist_wheel for xlrd, due to binaries being disabled for it.
Skipping bdist_wheel for sqlalchemy, due to binaries being disabled for it.
Skipping bdist_wheel for six, due to binaries being disabled for it.
Skipping bdist_wheel for python-dateutil, due to binaries being disabled for it.
Skipping bdist_wheel for dbf, due to binaries being disabled for it.
Skipping bdist_wheel for jdcal, due to binaries being disabled for it.
Installing collected packages: gdal, xlrd, sqlalchemy, jdcal, openpyxl, six, python-dateutil, dbf, csvkit
Found existing installation: GDAL 2.2.0
Uninstalling GDAL-2.2.0:
Successfully uninstalled GDAL-2.2.0
Running setup.py install for gdal ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-U2YlBY/gdal/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-UB4Lg0-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying gdal.py -> build/lib.linux-x86_64-2.7
copying ogr.py -> build/lib.linux-x86_64-2.7
copying osr.py -> build/lib.linux-x86_64-2.7
copying gdalconst.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/osgeo
copying osgeo/gdalconst.py -> build/lib.linux-x86_64-2.7/osgeo
copying osgeo/gdal_array.py -> build/lib.linux-x86_64-2.7/osgeo
copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-2.7/osgeo
copying osgeo/osr.py -> build/lib.linux-x86_64-2.7/osgeo
copying osgeo/__init__.py -> build/lib.linux-x86_64-2.7/osgeo
copying osgeo/ogr.py -> build/lib.linux-x86_64-2.7/osgeo
copying osgeo/gdal.py -> build/lib.linux-x86_64-2.7/osgeo
running build_ext
building 'osgeo._gdal' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/extensions
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/usr/include/python2.7 -I. -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
extensions/gdal_wrap.cpp:2853:22: fatal error: cpl_port.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Rolling back uninstall of GDAL
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-U2YlBY/gdal/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-UB4Lg0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-U2YlBY/gdal/
i'm new in ubuntu, previously i tried to set this up on centos (because i'm more familiar with centos), but it was worse than using ubuntu because many dependencies are missing / out of date.
do anyone have any suggestion on how to successfully setup cartoDB in ubuntu / any other linux based machine? (or what should i do with this compile error?)
i guess i should get gdal version 1.10.0 ? but how to do that in ubuntu...
[UPDATE-1]
Maybe it's because cpl_port.h not found from this error
extensions/gdal_wrap.cpp:2853:22: fatal error: cpl_port.h: No such file or directory
so, i did install libgdal-dev per Oz123 suggests.
apt-get install libgdal-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgdal-dev is already the newest version (2.2.2+dfsg-1~xenial1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
and my GDAL version is
gdalinfo --version
GDAL 2.2.2, released 2017/09/15
and sadly, error is still the same.
i'm still trying to find out how to compile / change installed GDAL version to 1.10.0 because i assume the requirement is GDAL 1.10.0 and what i have is 2.2.2, that's why it tries to compile again, am i correct with this?
...
Collecting gdal==1.10.0 (from -r python_requirements.txt (line 6))
Using cached GDAL-1.10.0.tar.gz
...
Installing collected packages: gdal, xlrd, sqlalchemy, jdcal, openpyxl, six, python-dateutil, dbf, csvkit
Found existing installation: GDAL 2.2.0
Uninstalling GDAL-2.2.0:
Successfully uninstalled GDAL-2.2.0
Running setup.py install for gdal ... error
...
[UPDATE-2-ANSWER FOR THIS SPECIFIC PROBLEM]
thx to Oz123, I execute:
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
and retry the compile, and it fix this cpl_port.h problem. but the installation still failed at the same installation step (GDAL compile), but i think i should ask this in different thread to keep this stack clean.
This is probably because you are missing libgdal-dev (found through ubuntu package content search).
When ever you install a package with hard coded C dependecies you should make sure you have the build-dependencies.
I guess I should get gdal version 1.10.0 ? but how to do that in
ubuntu...
If you followed this step:
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
You will get a later version of GDAL.
Never the less, you should install the build dependency, libgdal-dev with sudo apt-get install libgdal-dev, the repeat pip install --no-use-wheel -r python_requirements.txt, if you get more errors, look for the missing header file in the ubuntu packages content search pages, install the package and repeat until complete.
You should also pass the paths to pip:
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
pip install --no-use-wheel -r python_requirements.txt