I'm having issues building wheel for psycopg2 thru pip install -r requirements.txt. I'm on ubuntu 20.04 + python 3.8.5 + venv.
This is my requirements.txt:
amqp==2.6.1
anyjson==0.3.3
asgiref==3.2.10
billiard==3.6.3.0
brotlipy==0.7.0
celery==4.4.7
celery-progress==0.0.12
certifi==2020.6.20
cffi==1.14.2
chardet==3.0.4
cryptography==3.1
Django==3.0.3
dj-database-url==0.5.0
django-celery-results==1.2.1
django-cors-headers==3.5.0
django-crispy-forms==1.9.2
django-heroku==0.3.1
django-rest-framework==0.1.0
django-templated-mail==1.1.1
djangorestframework==3.11.1
djoser==2.0.5
fake-useragent==0.1.11
future==0.18.2
gunicorn==20.0.4
httpie==2.2.0
idna==2.10
kombu==4.6.11
lxml==4.5.2
pika==1.1.0
psycopg2==2.8.5
pycparser==2.20
Pygments==2.7.0
pyOpenSSL==19.1.0
PySocks==1.7.1
python-dateutil==2.8.1
python-decouple==3.3
pytz==2020.1
requests==2.24.0
six==1.15.0
SQLAlchemy==1.3.19
sqlparse==0.3.1
urllib3==1.25.10
vine==1.3.0
whitenoise==5.2.0
This is the output when I pip install -r requirements.txt:
[...]
Collecting urllib3==1.25.10
Using cached urllib3-1.25.10-py2.py3-none-any.whl (127 kB)
Collecting vine==1.3.0
Using cached vine-1.3.0-py2.py3-none-any.whl (14 kB)
Collecting whitenoise==5.2.0
Using cached whitenoise-5.2.0-py2.py3-none-any.whl (19 kB)
Requirement already satisfied: setuptools>=3.0 in ./venv/lib/python3.8/site-packages (from gunicorn==20.0.4->-r requirements.txt (line 24)) (44.0.0)
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/pierre/Workspace/campground_scavanger/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1xr9yjk0/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1xr9yjk0/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-b8g9assp
cwd: /tmp/pip-install-1xr9yjk0/psycopg2/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: vine, amqp, anyjson, asgiref, billiard, pycparser, cffi, brotlipy, kombu, pytz, celery, celery-progress, certifi, chardet, six, cryptography, sqlparse, Django, dj-database-url, django-celery-results, django-cors-headers, django-crispy-forms, whitenoise, psycopg2, django-heroku, djangorestframework, django-rest-framework, django-templated-mail, djoser, fake-useragent, future, gunicorn, idna, urllib3, requests, Pygments, httpie, lxml, pika, pyOpenSSL, PySocks, python-dateutil, python-decouple, SQLAlchemy
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /home/pierre/Workspace/campground_scavanger/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1xr9yjk0/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1xr9yjk0/psycopg2/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-record-8dtfz_uf/install-record.txt --single-version-externally-managed --compile --install-headers /home/pierre/Workspace/campground_scavanger/venv/include/site/python3.8/psycopg2
cwd: /tmp/pip-install-1xr9yjk0/psycopg2/
Complete output (40 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.5 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120005 -DHAVE_LO64=1 -I/home/pierre/Workspace/campground_scavanger/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.h>
| ^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/pierre/Workspace/campground_scavanger/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1xr9yjk0/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1xr9yjk0/psycopg2/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-record-8dtfz_uf/install-record.txt --single-version-externally-managed --compile --install-headers /home/pierre/Workspace/campground_scavanger/venv/include/site/python3.8/psycopg2 Check the logs for full command output.
Googling the first error error: invalid command 'bdist_wheel' led me to run pip install wheel in my venv. Successfully installed wheel-0.36.2. Not sure if this is related whatsoever with my psycopg2 issue hereafter but I'm showing all the steps I'm doing.
I then reran pip install -r requirements.txt and now only the psycopg2 issue shows up:
[...]
Requirement already satisfied: vine==1.3.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 43)) (1.3.0)
Requirement already satisfied: whitenoise==5.2.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 44)) (5.2.0)
Requirement already satisfied: setuptools>=3.0 in ./venv/lib/python3.8/site-packages (from gunicorn==20.0.4->-r requirements.txt (line 24)) (44.0.0)
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/pierre/Workspace/campground_scavanger/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zxwqo979/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zxwqo979/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-fknnvsn3
cwd: /tmp/pip-install-zxwqo979/psycopg2/
Complete output (40 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.5 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120005 -DHAVE_LO64=1 -I/home/pierre/Workspace/campground_scavanger/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.h>
| ^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2, django-heroku, djangorestframework, django-rest-framework, django-templated-mail, djoser, fake-useragent, future, gunicorn, urllib3, idna, requests, Pygments, httpie, lxml, pika, pyOpenSSL, PySocks, python-dateutil, python-decouple, SQLAlchemy
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /home/pierre/Workspace/campground_scavanger/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zxwqo979/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zxwqo979/psycopg2/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-record-r4aij71q/install-record.txt --single-version-externally-managed --compile --install-headers /home/pierre/Workspace/campground_scavanger/venv/include/site/python3.8/psycopg2
cwd: /tmp/pip-install-zxwqo979/psycopg2/
Complete output (40 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.5 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120005 -DHAVE_LO64=1 -I/home/pierre/Workspace/campground_scavanger/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.h>
| ^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/pierre/Workspace/campground_scavanger/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zxwqo979/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zxwqo979/psycopg2/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-record-r4aij71q/install-record.txt --single-version-externally-managed --compile --install-headers /home/pierre/Workspace/campground_scavanger/venv/include/site/python3.8/psycopg2 Check the logs for full command output.
I replaced psycopg2==2.8.5 by psycopg2-binary==2.8.5 as per some other stackoverflow threads but the same issue remains during the pip install -r requirements.txt .
If I install manually psycopg2-binary in my venv it works fine:
(venv) pierre#thinkpad:~/Workspace/campground_scavanger$ pip install psycopg2-binary
Collecting psycopg2-binary
Using cached psycopg2_binary-2.8.6-cp38-cp38-manylinux1_x86_64.whl (3.0 MB)
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.6
But then again if I comment out psycopg2==2.8.5 (or psycopg2-binary==2.8.5 and rerun pip install -r requirements.txt, I keep getting the same error message.
I'm not quite sure why there is a Building wheels for collected packages: psycopg2 even if psycopg2 is commented out in my requirements.txt. Dependency with another package?
Instead pip command use:
sudo apt-get install libpq-dev
then use:
pip install psycopg2
On Ubuntu, do you can install psycopg2-binary
pip install psycopg2-binary
Looks like you need to install libpq-dev according to this Problems compiling and installing psycopg2.
pip install libpq-dev should work or perhaps a specific version may be required. About psycopg2 being commented yet it being attempted to install by pip it may be a requirement of one of your other dependencies.
After installing the right psycopg2==2.8.5 version, also check if your database is spatial and the right setting is there in your settings.py file for example if you are using postgres, set your database engine connection to;
'ENGINE': 'django.db.backends.postgresql_psycopg2',
Related
I am trying to install a new Django project from git, I created a new virtual envt using
python3(version: 3.8.5). When I try to install the required libraries in the requirements.txt, I get the following errors for cffi==1.11.5 package.
Building wheels for collected packages: cffi
Building wheel for cffi (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/jessica/Documents/FreelanceProjects/crowdbuy/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"'; __file__='"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-1y2in5qm
cwd: /tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/
Complete output (49 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/model.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/cparser.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/verifier.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/__init__.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/commontypes.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/lock.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/api.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/recompiler.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/error.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.8/cffi
copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.8/cffi
copying cffi/_embedding.h -> build/lib.linux-x86_64-3.8/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.8/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/c
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/jessica/Documents/FreelanceProjects/crowdbuy/env/include -I/usr/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
c/_cffi_backend.c: In function ‘b_do_dlopen’:
c/_cffi_backend.c:4197:31: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
4197 | *p_printable_filename = PyText_AsUTF8(s);
| ^
c/_cffi_backend.c: In function ‘b_callback’:
c/_cffi_backend.c:5911:5: warning: ‘ffi_prep_closure’ is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
5911 | if (ffi_prep_closure(closure, &cif_descr->cif,
| ^~
In file included from c/_cffi_backend.c:15:
/usr/include/x86_64-linux-gnu/ffi.h:334:1: note: declared here
334 | ffi_prep_closure (ffi_closure*,
| ^~~~~~~~~~~~~~~~
In file included from c/cffi1_module.c:20,
from c/_cffi_backend.c:7370:
c/call_python.c: In function ‘_get_interpstate_dict’:
c/call_python.c:20:30: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
20 | builtins = tstate->interp->builtins;
| ^~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for cffi
Running setup.py clean for cffi
Failed to build cffi
Installing collected packages: pycparser, urllib3, six, pytz, jdcal, idna, et-xmlfile, chardet, cffi, certifi, asn1crypto, xlwt, xlrd, unicodecsv, text-unidecode, requests, PyYAML, python-dateutil, openpyxl, odfpy, oauthlib, Django, defusedxml, cryptography, tablib, sqlparse, requests-oauthlib, python3-openid, pyOpenSSL, Pillow, phonenumberslite, pbr, Faker, django-ranged-response, django-js-asset, diff-match-patch, Babel, Unidecode, sorl-thumbnail, PyMySQL, purl, paypalrestsdk, mock, future, factory-boy, django-widget-tweaks, django-treebeard, django-tables2, django-simple-captcha, django-phonenumber-field, django-paypal, django-mptt, django-modeltranslation, django-import-export, django-haystack, django-filter, django-extra-views, django-debug-toolbar, django-crontab, django-countries, django-anymail, django-allauth, django-admin-honeypot
Running setup.py install for cffi ... error
ERROR: Command errored out with exit status 1:
command: /home/jessica/Documents/FreelanceProjects/crowdbuy/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"'; __file__='"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yjyoqxw6/install-record.txt --single-version-externally-managed --compile --install-headers /home/jessica/Documents/FreelanceProjects/crowdbuy/env/include/site/python3.8/cffi
cwd: /tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/
Complete output (49 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/model.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/cparser.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/verifier.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/__init__.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/commontypes.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/lock.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/api.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/recompiler.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/error.py -> build/lib.linux-x86_64-3.8/cffi
copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.8/cffi
copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.8/cffi
copying cffi/_embedding.h -> build/lib.linux-x86_64-3.8/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.8/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/c
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/jessica/Documents/FreelanceProjects/crowdbuy/env/include -I/usr/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
c/_cffi_backend.c: In function ‘b_do_dlopen’:
c/_cffi_backend.c:4197:31: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
4197 | *p_printable_filename = PyText_AsUTF8(s);
| ^
c/_cffi_backend.c: In function ‘b_callback’:
c/_cffi_backend.c:5911:5: warning: ‘ffi_prep_closure’ is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
5911 | if (ffi_prep_closure(closure, &cif_descr->cif,
| ^~
In file included from c/_cffi_backend.c:15:
/usr/include/x86_64-linux-gnu/ffi.h:334:1: note: declared here
334 | ffi_prep_closure (ffi_closure*,
| ^~~~~~~~~~~~~~~~
In file included from c/cffi1_module.c:20,
from c/_cffi_backend.c:7370:
c/call_python.c: In function ‘_get_interpstate_dict’:
c/call_python.c:20:30: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
20 | builtins = tstate->interp->builtins;
| ^~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/jessica/Documents/FreelanceProjects/crowdbuy/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"'; __file__='"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yjyoqxw6/install-record.txt --single-version-externally-managed --compile --install-headers /home/jessica/Documents/FreelanceProjects/crowdbuy/env/include/site/python3.8/cffi Check the logs for full command output.
I will also add my requirements.txt file.
asn1crypto==0.24.0
Babel==2.5.3
certifi==2018.1.18
cffi==1.11.5
chardet==3.0.4
cryptography==2.2.2
defusedxml==0.5.0
diff-match-patch==20121119
Django==2.0.4
django-admin-honeypot==1.1.0
django-allauth==0.35.0
django-anymail==2.0
django-countries==5.3
django-debug-toolbar==1.9.1
django-extra-views==0.6.4
django-filter==1.1.0
django-haystack==2.8.1
django-import-export==1.0.1
django-js-asset==1.0.0
django-modeltranslation==0.12.2
django-mptt==0.9.0
django-paypal==0.5.0
django-phonenumber-field==1.3.0
django-ranged-response==0.2.0
django-simple-captcha==0.5.6
django-tables2==1.16.0
django-treebeard==4.3
django-widget-tweaks==1.4.2
et-xmlfile==1.0.1
factory-boy==2.10.0
Faker==0.8.13
future==0.16.0
idna==2.6
jdcal==1.4
mock==2.0.0
oauthlib==2.0.7
odfpy==1.3.6
openpyxl==2.5.4
paypalrestsdk==1.13.1
pbr==4.0.2
phonenumberslite==8.9.3
Pillow==5.1.0
purl==1.4
pycparser==2.18
PyMySQL==0.8.0
pyOpenSSL==17.5.0
python-dateutil==2.7.2
python3-openid==3.1.0
pytz==2018.4
PyYAML==3.12
requests==2.18.4
requests-oauthlib==0.8.0
six==1.11.0
sorl-thumbnail==12.4.1
sqlparse==0.2.4
tablib==0.12.1
text-unidecode==1.2
unicodecsv==0.14.1
Unidecode==0.4.21
urllib3==1.22
xlrd==1.1.0
xlwt==1.3.0
django-crontab
I have already followed some suggestions on stackoverflow but that doesn't seem to work.
The things that I have tried already.
Failed to install Python Cryptography package with PIP and setup.py
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
I am using Ubuntu. Please let me know what I am doing wrong.
i had this problem and i solved by following:
i used sudo apt install --fix-broken for installing broken packages in my debian machine after that i used this command for installing essential packages
:
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
and after that the problem solved.
I just had the same issue. I was trying to install djoser and the same thing happened. To fix it I just simply downgrade my python from 3.10 to 3.9
For anyone who experiences this in the future while building a docker image. After a lot of trial and error this is what finally worked:-
RUN python -m venv /py && \
/py/bin/pip install --upgrade pip && \
apk add --update alpine-sdk && \
apk add --update --no-cache postgresql-client && \
apk add --update --no-cache --virtual .tmp-build-deps \
build-base gcc python3-dev postgresql-dev musl-dev libffi-dev openssl-dev cargo && \
/py/bin/pip install -r /tmp/requirements.txt && \
if [ $DEV = "true" ]; \
then /py/bin/pip install -r /tmp/requirements.dev.txt ; \
fi && \
rm -rf /tmp && \
apk del .tmp-build-deps && \
adduser \
--disabled-password \
--no-create-home \
django-user
When trying to import 'pyheif' in a python 3 program, I get this crash dump below.
Can anyone explain how to successfully import this package? I have tried multiple versions, made sure "wheel" was installed, etc., searched Stack and done other searches but have not found out how to resolve.
Thanks in advance!
Collecting pyheif
Using cached pyheif-0.5.1.tar.gz (17 kB)
Requirement already satisfied: cffi>=1.0.0 in /Users/user/venv/HEICToJPG/lib/python3.8/site-packages (from pyheif) (1.14.4)
Requirement already satisfied: pycparser in /Users/user/venv/HEICToJPG/lib/python3.8/site-packages (from cffi>=1.0.0->pyheif) (2.20)
Building wheels for collected packages: pyheif
Building wheel for pyheif (setup.py): started
Building wheel for pyheif (setup.py): finished with status 'error'
Running setup.py clean for pyheif
Failed to build pyheif
Installing collected packages: pyheif
Running setup.py install for pyheif: started
Running setup.py install for pyheif: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Users/user/venv/HEICToJPG/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-wheel-8kzdauau
cwd: /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/
Complete output (27 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/error.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/constants.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/reader.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/writer.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
creating build/lib.macosx-10.9-x86_64-3.8/pyheif/data
copying pyheif/data/version.txt -> build/lib.macosx-10.9-x86_64-3.8/pyheif/data
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
generating cffi module 'build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c'
creating build/temp.macosx-10.9-x86_64-3.8
building '_libheif_cffi' extension
creating build/temp.macosx-10.9-x86_64-3.8/build
creating build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/usr/local/include -I/usr/include -I/Users/user/venv/HEICToJPG/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c -o build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.o
build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c:570:15: fatal error: 'libheif/heif.h' file not found
#include "libheif/heif.h"
^~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyheif
ERROR: Command errored out with exit status 1:
command: /Users/user/venv/HEICToJPG/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-record-phe46c7r/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/venv/HEICToJPG/include/site/python3.8/pyheif
cwd: /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/
Complete output (27 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/error.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/constants.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/reader.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/writer.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
creating build/lib.macosx-10.9-x86_64-3.8/pyheif/data
copying pyheif/data/version.txt -> build/lib.macosx-10.9-x86_64-3.8/pyheif/data
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
generating cffi module 'build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c'
creating build/temp.macosx-10.9-x86_64-3.8
building '_libheif_cffi' extension
creating build/temp.macosx-10.9-x86_64-3.8/build
creating build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/usr/local/include -I/usr/include -I/Users/user/venv/HEICToJPG/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c -o build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.o
build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c:570:15: fatal error: 'libheif/heif.h' file not found
#include "libheif/heif.h"
^~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/user/venv/HEICToJPG/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-record-phe46c7r/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/venv/HEICToJPG/include/site/python3.8/pyheif Check the logs for full command output.
We need to know a bit more about your environment, like what type of machine do you have, are you using docker, if yes what type of docker image are you using, etc.
I will try to give you a generic answer and maybe we can discuss in detail your problem once you will be back.
Try to follow the commands as described in repo https://github.com/carsales/pyheif
brew install libffi libheif
In case that you are using docker then add the following packages into a RUN command
RUN apt-get install -y libffi-dev libheif-dev libde265-dev
This question already has answers here:
How to install libpq-fe.h?
(4 answers)
Closed 2 years ago.
I get the following error when trying to install psycopg2:
(venv) root#scw-determined-panini:/app# pip install psycopg2
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/a8/8f/1c5690eebf148d1d1554fc00ccf9101e134636553dbb75bdfef4f85d7647/psycopg2-2.8.5.tar.gz
Building wheels for collected packages: psycopg2
Running setup.py bdist_wheel for psycopg2 ... error
Complete output from command /app/venv/bin/python3.8 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-psll6xe_/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp52or8xexpip-wheel- --python-tag cp38:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.5 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/app/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:0:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
#include <libpq-fe.h>
^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
Complete output from command /app/venv/bin/python3.8 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-psll6xe_/psycopg2/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-x62dcj9d-record/install-record.txt --single-version-externally-managed --compile --install-headers /app/venv/include/site/python3.8/psycopg2:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.5 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/app/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:0:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
#include <libpq-fe.h>
^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/app/venv/bin/python3.8 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-psll6xe_/psycopg2/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-x62dcj9d-record/install-record.txt --single-version-externally-managed --compile --install-headers /app/venv/include/site/python3.8/psycopg2" failed with error code 1 in /tmp/pip-build-psll6xe_/psycopg2/
(venv) root#scw-determined-panini:/app# psycopg2-binary
psycopg2-binary: command not found
(venv) root#scw-determined-panini:/app# pip install psycopg2-binary
Requirement already satisfied: psycopg2-binary in ./venv/lib/python3.8/site-packages
For Ubuntu use
sudo apt install libpq-dev
thanks
Note: yes, there are many, many posts regarding the issues of installing mysql for python, specifically for python3 (e.g. Troubles installing mysqlclient with pip3). Most solutions are done in a non-dockerized manner. I have also read the mysqlclient install guide. I am still struggling to get it to work
A repo to clone and test for convenience.
Here I am trying to install it to my docker image.
Dockerfile.ai
FROM tensorflow/tensorflow:1.15.0-gpu-py3-jupyter
# --- Install any needed packages specified in requirements.apt
# from SO answer
# RUN apt-get update && apt-get install -y mysql-client && rm -rf /var/lib/apt
COPY requirements.apt .
RUN apt-get update && xargs apt-get install -y < requirements.apt
# --- Install any needed packages specified in requirements.pip
COPY requirements.pip .
RUN pip install --trusted-host pypi.python.org -r requirements.pip
# activate jupyter extensions
RUN jupyter contrib nbextension install \
&& jupyter nbextension enable codefolding/main \
&& jupyter nbextension enable collapsible_headings/main
docker-compose.yml
version: '3'
services:
tf:
volumes:
- ./notebooks:/tf/notebooks
- ./data:/tf/data
- ./experiments:/tf/experiments
- ./models:/tf/models
ports:
- '8888:8888'
build:
context: .
dockerfile: Dockerfile.ai
volumes:
notebooks:
data:
experiments:
models:
requirements.apt
git
python-pip
mysql-server
python3-dev # from https://pypi.org/project/mysqlclient/
build-essential # from SO solution
default-libmysqlclient-dev # from another SO solution
libmysqlclient-dev
requirements.pip
# This file is used for multiple docker images which may have different bases.
# data related
pymongo
sqlalchemy
# MySQLdb
mysqlclient
# deep learning related
tensorflow-gpu==1.15.0
seaborn
numpy
sacred
requests
pandas
scipy
sklearn
# jupyter
ipykernel
jupyter_contrib_nbextensions
Errors
Requirement already satisfied: more-itertools in /usr/local/lib/python3.6/dist-packages (from zipp>=0.5->importlib-metadata->jsonschema!=2.5.0,>=2.4->nbformat>=4.4->nbconvert>=4.2->jupyter_contrib_nbexten
sions->-r requirements.pip (line 26)) (7.2.0)
Building wheels for collected packages: sqlalchemy, mysqlclient, sacred, sklearn, docopt, py-cpuinfo, jupyter-nbextensions-configurator, pyyaml, jupyter-latex-envs
Building wheel for sqlalchemy (setup.py): started
Building wheel for sqlalchemy (setup.py): finished with status 'done'
Created wheel for sqlalchemy: filename=SQLAlchemy-1.3.12-cp36-cp36m-linux_x86_64.whl size=1216988 sha256=a18ffb30eefe7a430b978e9ae54506ed6fff1197cd8f06f18fc89ab34ffebde1
Stored in directory: /root/.cache/pip/wheels/ee/33/44/0788a6e806866ae2e246d5cd841d07498a46bcb3f3c42ea5a4
Building wheel for mysqlclient (setup.py): started
Building wheel for mysqlclient (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o51hii7f/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o51hii7f/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-fhcie_47 --python-tag cp36
cwd: /tmp/pip-install-o51hii7f/mysqlclient/
Complete output (31 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb
creating build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/MySQLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/include/mysql -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -o build/lib.linux-x86_64-3.6/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Building wheel for sacred (setup.py): started
Building wheel for sacred (setup.py): finished with status 'done'
Created wheel for sacred: filename=sacred-0.8.1-py2.py3-none-any.whl size=109604 sha256=9ae1f0e699ca8ffd5bc83691ac8e40682b045d2277da4bddc9d1c639a031c917
Stored in directory: /root/.cache/pip/wheels/11/a8/f6/1d5f073245cb0a221962713adf81e56c1c9608083f85ecac9b
Building wheel for sklearn (setup.py): started
Building wheel for sklearn (setup.py): finished with status 'done'
Created wheel for sklearn: filename=sklearn-0.0-py2.py3-none-any.whl size=2397 sha256=9b45378895d96c16201b032e0c190415cb91c02dca496e404b4fd3b337c49730
Stored in directory: /root/.cache/pip/wheels/76/03/bb/589d421d27431bcd2c6da284d5f2286c8e3b2ea3cf1594c074
Building wheel for docopt (setup.py): started
Building wheel for docopt (setup.py): finished with status 'done'
Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=19852 sha256=a8da8458c371b8bb8ec40f3e18a974e505593b9f913f1960578a8e8e90f76101
Stored in directory: /root/.cache/pip/wheels/9b/04/dd/7daf4150b6d9b12949298737de9431a324d4b797ffd63f526e
Building wheel for py-cpuinfo (setup.py): started
Building wheel for py-cpuinfo (setup.py): finished with status 'done'
Created wheel for py-cpuinfo: filename=py_cpuinfo-5.0.0-cp36-none-any.whl size=18912 sha256=cf72494546ffaf64bb66b6c08785c37627a31145d48e03b1a270da64b72c9a55
Stored in directory: /root/.cache/pip/wheels/01/7e/a9/b982d0fea22b7e4ae5619de949570cde5ad55420cec16e86a5
Building wheel for jupyter-nbextensions-configurator (setup.py): started
Building wheel for jupyter-nbextensions-configurator (setup.py): finished with status 'done'
Created wheel for jupyter-nbextensions-configurator: filename=jupyter_nbextensions_configurator-0.4.1-py2.py3-none-any.whl size=466146 sha256=c5ac621237f2bc3174b0ad762dbea00be7688ab71fc72c2eb2d6013c6a759963
Stored in directory: /root/.cache/pip/wheels/15/df/fe/2a74fe34709e7fdc5ae153a768675d9fda93cc7d5133ed1fb0
Building wheel for pyyaml (setup.py): started
Building wheel for pyyaml (setup.py): finished with status 'done'
Created wheel for pyyaml: filename=PyYAML-5.3-cp36-cp36m-linux_x86_64.whl size=45519 sha256=f73f83291978cafd58f9bb245844cd4c4fa44da66839312ebcf777e35e865880
Stored in directory: /root/.cache/pip/wheels/e4/76/4d/a95b8dd7b452b69e8ed4f68b69e1b55e12c9c9624dd962b191
Building wheel for jupyter-latex-envs (setup.py): started
Building wheel for jupyter-latex-envs (setup.py): finished with status 'done'
Created wheel for jupyter-latex-envs: filename=jupyter_latex_envs-1.4.6-py2.py3-none-any.whl size=966916 sha256=84f81480b78b2d1d6db05ce6e6dce61da11482360c3658124c08f9c5f942f791
Stored in directory: /root/.cache/pip/wheels/0d/71/2a/164491997299b9f2479a251e254323fe35d946779e18f27956
Successfully built sqlalchemy sacred sklearn docopt py-cpuinfo jupyter-nbextensions-configurator pyyaml jupyter-latex-envs
Failed to build mysqlclient
Installing collected packages: mag, sil, parpar, pymongo, sqlalchemy, mysqlclient, pytz, pandas, scipy, seaborn, docopt, jsonpickle, munch, py-cpuinfo, colorama, packaging, smmap2, gitdb2, GitPython, sacred, urllib3, chardet, certifi, requests, joblib, scikit-learn, sklearn, jupyter-contrib-core, pyyaml, jupyter-nbextensions-configurator, jupyter-latex-envs, lxml, jupyter-highlight-selected-word, jupyter-contrib-nbextensions
Running setup.py install for mysqlclient: started
Running setup.py install for mysqlclient: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o51hii7f/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o51hii7f/mysqlclient/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-record-x870urz9/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-o51hii7f/mysqlclient/
Complete output (31 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb
creating build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/MySQLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/include/mysql -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -o build/lib.linux-x86_64-3.6/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o51hii7f/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o51hii7f/mysqlclient/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-record-x870urz9/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
ERROR: Service 'tf' failed to build: The command '/bin/bash -c pip install --trusted-host pypi.python.org -r requirements.pip' returned a non-zero code: 1
updates
Found this: https://github.com/postlight/headless-wp-starter/issues/115
and tried adding
# Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start.
RUN sed -i "s/^exit 101$/exit 0/" /usr/sbin/policy-rc.d
This changed the errors, but fails nonetheless
From "cannot find -lssl; cannot find -lcrypto" when installing mysql-python? it seems you need to install the libssl-dev package through apt
This question already has answers here:
TA-Lib Install Error
(3 answers)
Closed 4 years ago.
I've tried some alternatives but I can't install ta-lib or use make on my ubuntu ,when I send
pip install ta-Lib
Collecting ta-Lib
Using cached https://files.pythonhosted.org/packages/90/05/d4c6a778d7a7de0be366bc4a850b4ffaeac2abad927f95fa8ba6f355a082/TA-Lib-0.4.17.tar.gz
Requirement already satisfied: numpy in ./miniconda3/lib/python3.6/site-packages (from ta-Lib) (1.15.0)
Building wheels for collected packages: ta-Lib
Running setup.py bdist_wheel for ta-Lib ... error
Complete output from command /home/user/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugk06wz4/ta-Lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-v2gctt6z --python-tag cp36:
/tmp/pip-install-ugk06wz4/ta-Lib/setup.py:79: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/talib
copying talib/stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/deprecated.py -> build/lib.linux-x86_64-3.6/talib
copying talib/abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_data.py -> build/lib.linux-x86_64-3.6/talib
copying talib/__init__.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_pandas.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_func.py -> build/lib.linux-x86_64-3.6/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/talib
gcc -pthread -B /home/user/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/user/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/home/user/miniconda3/include/python3.6m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.6/talib/_ta_lib.o
talib/_ta_lib.c:526:10: fatal error: ta-lib/ta_defs.h: No such file or directory
#include "ta-lib/ta_defs.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for ta-Lib
Running setup.py clean for ta-Lib
Failed to build ta-Lib
Installing collected packages: ta-Lib
Running setup.py install for ta-Lib ... error
Complete output from command /home/user/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugk06wz4/ta-Lib/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-record-kipfzx36/install-record.txt --single-version-externally-managed --compile:
/tmp/pip-install-ugk06wz4/ta-Lib/setup.py:79: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/talib
copying talib/stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/deprecated.py -> build/lib.linux-x86_64-3.6/talib
copying talib/abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_data.py -> build/lib.linux-x86_64-3.6/talib
copying talib/__init__.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_pandas.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_func.py -> build/lib.linux-x86_64-3.6/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/talib
gcc -pthread -B /home/user/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/user/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/home/user/miniconda3/include/python3.6m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.6/talib/_ta_lib.o
talib/_ta_lib.c:526:10: fatal error: ta-lib/ta_defs.h: No such file or directory
#include "ta-lib/ta_defs.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
and this in red at the end
Command
/home/user/miniconda3/bin/python -u -c "import setuptools,
tokenize;file='/tmp/pip-install-ugk06wz4/ta-Lib/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-record-kipfzx36/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ugk06wz4/ta-Lib/
when I type
make
or
sudo make install
I get this:
make: *** No rule to make target 'install'. Stop.
what am I doing wrong ?
Thanks in advance and thank you for your kindness
sudo pip install -U setuptools
Or if it doesn't work to quote his comment:
Try this 'sudo -H pip install TA-Lib'