Building pywt on ubuntu - python

I have problems building pywt from source on Ubuntu.
When I run python setup.py build, I get the following error:
running build
running build_py
running build_ext
Cython is not installed. Using compiled file: src/_pywt.pyx
building 'pywt._pywt' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPY_EXTENSION -Isrc -I/usr/local/include/python2.7 -c src/_pywt.c -o build/temp.linux-x86_64-2.7/src/_pywt.o
gcc: error: src/_pywt.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
error: command 'gcc' failed with exit status 4
When I run cython --version I get the following output:
Cython version 0.21.1

pywt can be installed as an Ubuntu package using apt-get:
sudo apt-get install python-pywt

Related

trouble install mysqlclient on ubuntu18.04

I am trying to install mysqlclient on ubuntu 18.04 for a Django project but having problem installing mysql. Here is the information from the terminal:
pip install mysqlclient
Collecting mysqlclient
----------------------------------------
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
2.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/MySQLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -
Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-PPrPZj/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/opt/lampp/include/mysql -I/opt/lampp/include/mysql/mysql -I/usr/include/python2.7 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o
MySQLdb/_mysql.c:29:10: fatal error: mysql.h: No such file or directory`enter code here`
#include "mysql.h"
^~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
You'll have to install the MySQL headers.
sudo apt install libmysqlclient-dev
(and stop using Python 2.7, it's out of support in a month)

Installing Kivy 1.10.1 on Raspbian Buster

I found errors when installing kivy 1.10.1.dev0 on my new Raspberry Pi 4.
The source of error comes from the instruction:
sudo pip3 install git+https://github.com/kivy/kivy.git#master
after following the guide https://kivy.readthedocs.io/en/master/installation/installation-rpi.html#.
It gives the error:
building 'kivy.lib.vidcore_lite.egl' extension
creating build/temp.linux-armv7l-3.7/tmp/pip-req-build-bsrs6yn7/kivy/lib/vidcore_lite
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/pip-req-build-bsrs6yn7/kivy/include -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/usr/include/python3.7m -c /tmp/pip-req-build-bsrs6yn7/kivy/lib/vidcore_lite/egl.c -o build/temp.linux-armv7l-3.7/tmp/pip-req-build-bsrs6yn7/kivy/lib/vidcore_lite/egl.o
/tmp/pip-req-build-bsrs6yn7/kivy/lib/vidcore_lite/egl.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^~~~~
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for Kivy
Running setup.py clean for Kivy
Failed to build Kivy
Installing collected packages: Kivy

Python API: C Extension install error

I'm using Mac, and I am trying to write my own c code to use it from Python. I'm new to this, and trying out a sample example from http://www.tutorialspoint.com/python/python_further_extensions.htm.
But, when I run the setup.py file to install my c file, it gives me an error, and I'm not sure what to do. Below is the resulting error message. Thanks a lot!
$ sudo python3 setup.py install
Password:
running install
running build
running build_ext
building 'sample' extension
clang -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/sqlite/include -DFOO=1 -UBAR -I/some/dir -I/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c pysample.c -o build/temp.macosx-10.10-x86_64-3.4/pysample.o
clang -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.10-x86_64-3.4/pysample.o -L/usr/local/lib -lsample -o build/lib.macosx-10.10-x86_64-3.4/sample.so
ld: library not found for -lsample
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

Failed to build the bsdiff module

Good afternoon all,
I am having trouble using the bsdiff module with Python. While I can use shell scripts I would prefer to have a cross-platform solution.
I have downloaded bsdiff4-1.1.4 and attempt to run setup.py as follows:
Files list:
bsdiff4 build CHANGELOG.txt do.sh examples Makefile README.rst setup.py
I run:
python3 setup.py build
And I get this error:
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'entry_points'
warnings.warn(msg)
running build
running build_py
running build_ext
building 'bsdiff4.core' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c bsdiff4/core.c -o build/temp.linux-x86_64-3.4/bsdiff4/core.o
bsdiff4/core.c:8:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I want to be able to use python to apply patches to binary files.
Any help appreciated.
José
You need to install apt-get install python3-dev.
ubuntu python3-dev
header files and a static library for Python
If it is your system python you will need sudo

Installing rdiff on docker containers

I am trying to make a backup solution off docker containers using rdiff. I have python install and the python-dev packages but when I run the install command:
python ./setup.py install
I get the following error
running install
running build
running build_py
running build_ext
building 'rdiff_backup._librsync' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c _librsyncmodule.c -o build/temp.linux-x86_64-2.7/_librsyncmodule.o
_librsyncmodule.c:25:22: fatal error: librsync.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Your container needs the librsync-dev package.

Categories

Resources