got error while download gattlib via pip3 - python-3.x

I use Ubuntu 16.04 64bit OS
when I run
$ sudo pip3 install gattlib
I got this error message
/usr/bin/ld: cannot find -lboost_python-py34
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1
I tried googling how to solve this but nothing works for me
I want to use gatttool at python, so I need to install this
How can I solve this?
PS. I already downloaded libboost-dev

pip3 download gattlib
tar xvzf ./gattlib-0.20150805.tar.gz
cd gattlib-0.20150805/
sed -ie 's/boost_python-py34/boost_python-py35/' setup.py
pip3 install .

And for python 3.7 you should do:
pip3 download gattlib
tar xvzf ./gattlib-0.20150805.tar.gz
cd gattlib-0.20150805/
sed -ie 's/boost_python-py34/boost_python37/' setup.py
pip3 install .

If Benjamin's solution does not work, try changing 35 to 36. i.e. try the code below.
pip3 download gattlib
tar xvzf ./gattlib-0.20150805.tar.gz
cd gattlib-0.20150805/
sed -ie 's/boost_python-py34/boost_python-py36/' setup.py
pip3 install .

I was running in to the following error on RPI-3B:
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src/gattservices.cpp:6:33: fatal error: bluetooth/bluetooth.h: No such file or directory
#include
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
[1] Running the following command helped me to resolve:
sudo apt-get install libbluetooth-dev
[2] Also deleting the folder 'gattlib-0.20150805' and recreating it using 'tar xvzf ...' again, helped cleaning the previous compilation left over files.

This works with Raspberry 2, Rasbian Buster and Python 3. Note that Python 3 libraries seems to have different naming “The bug can be solved easily by replacing boost_python_py34 with boost_python3 when specifying the boost libraries in setup.py.“
sed -ie 's/boost_python-py37/boost_python3/' setup.py
Libraries:
/usr/lib/arm-linux-gnueabihf/libboost_python3.a
/usr/lib/arm-linux-gnueabihf/libboost_python3-py37.a
/usr/lib/arm-linux-gnueabihf/libboost_python3-py37.so
/usr/lib/arm-linux-gnueabihf/libboost_python3.so

Following PyGattlib DEPENDS all dependencies include pkg-config to "manage compile and link flags for libraries". This solved
/usr/bin/ld: cannot find -lboost_python-py36
I updated my package install dependencies and it works !
RUN install_packages \
python3-dev \
libbluetooth-dev \
libboost-python-dev \
libboost-thread-dev \
libglib2.0-dev \
pkg-config
RUN python3 -m pip install pygattlib
Docker Balena.io
Ubuntu "bionic beaver"

Related

error: command 'gcc' failed with exit status 1 while installing GDAL for Python3 on AWS EC2

I'm trying to install GDAL to use with Python 3 on an AWS EC2 Amazon2 machine (RHEL7).
Following the instructions on this page: Install GDAL on Python 2.7 on a Amazon Linux virtual server I managed to get it working for python 2.7 ("import gdal from osgeo" works).
However, I need it to work for python3 installed on my machine. I tried to adjust the instructions accordingly, and got to this set of commands:
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel gdal-devel gdal-python python3-devel
sudo yum -y update
cd /tmp
curl -L http://download.osgeo.org/gdal/2.4.0/gdal-2.4.0.tar.gz | tar zxf -
cd gdal-2.4.0/
./configure --prefix=/usr/local --with-python
sudo make -j4
sudo make install
python3 -m pip install numpy --user
sudo -H pip3 install --upgrade pip
CPLUS_INCLUDE_PATH=/usr/include/gdal
C_INCLUDE_PATH=/usr/include/gdal
sudo python3 -m easy_install GDAL -d /usr/lib/python3.7/site-packages --include-dirs=/usr/include/gdal
when I run the last command, the installation tries to run but fails with:
"error: command 'gcc' failed with exit status 1".
There are many errors before that, such as:
/usr/local/include/cpl_vsi_error.h:58:24: error: ‘CPL_FORMAT_STRING’ has not been declared
CPL_FORMAT_STRING(const char *fmt), ... )
^~~~~~~~~~~~~~~~~
In file included from extensions/gdal_wrap.cpp:3173:0:
From what I gather, the gcc can't find the GDAL headers, but it is specified in the command and I also did the including commands above:
CPLUS_INCLUDE_PATH=/usr/include/gdal
C_INCLUDE_PATH=/usr/include/gdal
Any ideas will be helpful!

Error while installing bedtools via cygwin commands: fatal error: zlib.h: No such file or directory

I'm trying to install the bedtools v2.27.0 via Cygwin. Here are the commands I've tried:
$ wget https://github.com/arq5x/bedtools2/releases/download/v2.27.0/bedtools-2.27.0.tar.gz
$ tar -zxvf bedtools-2.27.0.tar.gz
$ cd bedtools2
$ make
when running the last command, I get the following error:
*fatal error: zlib.h: No such file or directory
*#include <zlib.h>*
^
compilation terminated.
make[1]: *** [Makefile:37: ../../../obj//FileRecordMgr.o] Error 1
make: *** [Makefile:187: src/utils/FileRecordTools] Error 2*
I tried downloading the libz package using the following command:
$ apt-cyg install libz-dev
but it didn't work. I got the following error:
Unable to locate package libz-dev
Note that I'm using Cygwin terminal on windows (64-bit machine). Your help is highly appreciated.
To install packages use cygwin setup, or at least find the right package name before using apt-cyg
To find the package containing zlib.h header:
$ cygcheck -p include/zlib.h
Found 10 matches for include/zlib.h
...
zlib-devel-1.2.11-1 - zlib-devel: gzip de/compression library (development)
..
So you need to install zlib-devel

configure: error: Can't find libvorbis while installing recordmydesktop-0.3.8.1

I'm trying to install recordmydesktop-0.3.8.1 under rhel6.4 x86_64.
while running ./configure I get the following error message:
configure: error: Can't find libvorbis
But I have libvorbisfile.so.X files under my /usr/lib directory. The headers
codec.h, vorbisenc.h and vorbisfile.h also exists in my /usr/include/vorbis directory.
Could you help to resolve this issue please?
I had the same problem while installing recordMyDesktop. I found a simple solution. I installed libvorbis:
sudo apt-get install libvorbis-dev
If it also asks for other packages simply add the package name as following pattern:
sudo apt-get install lib[library-name]-dev
Uninstall existing libvorbis and try below steps to re-install.
cd /opt
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
tar xzvf libvorbis-1.3.4.tar.gz
cd libvorbis-1.3.4
./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
make
make install

Still can't install pygame on ubuntu

I've tried three different ways. The most recent was following instructions here: http://www.pygame.org/wiki/CompileUbuntu
But when I type in the first line
sudo apt-get install mercurial python-dev python-numpy ffmpeg \
I am told that
E: Package 'ffmpeg' has no installation candidate.
I continue on with the instructions and I am later told that some of the dependencies are missing (even though those are the ones I had attempted to install moments ago).
Then when I put in
sudo python3 setup.py install
it tells me
src/_pygame.h:80:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'i686-linux-gnu-gcc' failed with exit status 1
I recently had this problem. Try:
sudo apt-get install python-pygame
If that doesn't work you could try reinstalling python. The following command line will remove all python modules and reinstall python. After that try the command above again. If you have any other downloaded python modules or idles you will need to reinstall them.
sudo apt-get purge python && sudo apt-get install python2.7

"pkg-config script could not be found" on OSX

I am trying to install some software on my mac; however I keep receiving the same error:
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables XMEDCON_GLIB_CFLAGS
and XMEDCON_GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
I am not quite sure how to go about adding the pkg-config to the PATH. I have seen online (see link) that I should add the following:
Link showing how to direct PATH variable
export PATH=$PATH:/opt/local/bin # Fixed typo as mentioned in comment
which is where I have placed pkg-config. I still keep getting the error though every time I try to configure the files using ./configure. Any help would be super appreciated!
For Ubuntu/Debian OS,
apt-get install -y pkg-config
For Redhat/Yum OS,
yum install -y pkgconfig
For Archlinux OS,
pacman -S pkgconf
for me, (OSX) the problem was solved doing this:
brew install pkg-config
Answer to my question (after several Google searches) revealed the following:
$ curl https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.tar.gz -o pkgconfig.tgz
$ tar -zxf pkgconfig.tgz && cd pkg-config-0.29
$ ./configure && make install
from the following link: Link showing above
Thanks to everyone for their comments, and sorry for my linux/OSX ignorance!
Doing this fixed my issues as mentioned above.
if you have this error :
configure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure to use the bundled copy.
Instead of do this command :
$ ./configure && make install
Do that :
./configure --with-internal-glib && make install
Try
which pkg-config
if it is empty then fire
brew install pkg-config
OR : ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
MacOS users
Unfortunately, pkg-config does not come with OS X by default. Here are some notes on how to compile from source. It assumes that you have Xcode installed.
Download and extract
curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar xfz pkg-config-0.28.tar.gz
Configure and Install
cd pkg-config-0.28
setenv CC /usr/bin/cc (for tcsh)
export CC=/usr/bin/cc (for bash)
2a) If you have super-user powers
./configure --prefix=/usr/local CC=$CC --with-internal-glib
make
sudo make install
2b) if not
./configure --prefix=$HOME/someplace/in/my/path CC=$CC --with-internal-glib
make
make install
Source: https://opensource.ncsa.illinois.edu/confluence/display/DESDM/Installing+pkg-config+from+source+for+OSX

Resources