×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Problems with installing Python wrappers for INDI

  • Posts: 112
  • Thank you received: 12
Hi

I am trying to install Python wrappers for INDI in Raspberry pi 3 with Raspian Lite, but keep getting the same error message after the command “make” .

I follow all the tutorial and this one year old post :

I change the FindiINDI.cmake with the last one for version 1.4

But, no way to finish the make command without error.
[ 16%] Swig source
Language subdirectory: python
Search paths:
   ./
   /usr/include/python2.7/
   /usr/include/libindi/
   /usr/include/
   /home/pi/swig-indi-python/
   ./swig_lib/python/
   /usr/share/swig2.0/python/
   ./swig_lib/
   /usr/share/swig2.0/
Preprocessing...
/home/pi/swig-indi-python/indiserverpython.i:52: Error: Unable to find 'libindiserver.h'
CMakeFiles/_PyIndiServer.dir/build.make:61: recipe for target 'indiserverpythonPYTHON_wrap.c' failed
make[2]: *** [indiserverpythonPYTHON_wrap.c] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/_PyIndiServer.dir/all' failed
make[1]: *** [CMakeFiles/_PyIndiServer.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

and after moving the libindiserver.h file
[ 16%] Swig source
Language subdirectory: python
Search paths:
   ./
   /usr/include/python2.7/
   /usr/include/libindi/
   /usr/include/
   /home/pi/swig-indi-python/
   ./swig_lib/python/
   /usr/share/swig2.0/python/
   ./swig_lib/
   /usr/share/swig2.0/
Preprocessing...
Starting language-specific parse...
Processing types...
C++ analysis...
Generating wrappers...
/home/pi/swig-indi-python/libindiserver.h:47: Warning 451: Setting a const char * variable may leak memory.
/home/pi/swig-indi-python/libindiserver.h:64: Warning 454: Setting a pointer/reference variable may leak memory.
Scanning dependencies of target _PyIndiServer
[ 33%] Building C object CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o
In file included from /home/pi/libindipython/indiserverpythonPYTHON_wrap.c:2958:0:
/home/pi/swig-indi-python/libindiserver.h:4:16: fatal error: fq.h: Aucun fichier ou dossier de ce type
 #include "fq.h"
                ^
compilation terminated.
CMakeFiles/_PyIndiServer.dir/build.make:70: recipe for target 'CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o' failed
make[2]: *** [CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/_PyIndiServer.dir/all' failed
make[1]: *** [CMakeFiles/_PyIndiServer.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Please tell me what I'm doing wrong.

Sébastien.
Linux Mint 19 Cinnamon using PPA for latest KStars-bleeding and INDI
Raspberry Pi 3 B+ with StellarMate
Atik 314E - ASI120M - CG5 with Celestron C9.25
7 years 1 day ago #15313

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 12
Successful setup.

You have to install dependency :
sudo apt-get install python-setuptools python-dev libindi-dev swig subversion

to download the last code from svn repository
svn checkout https://svn.code.sf.net/p/pyindi-client/code/trunk ~/pyindi-client-code

change directory
~/pyindi-client-code/pip/pyindi-client

modifiy setup.cfg with this part
libraries = indidriver

run setup.py with root access
sudo python setup.py install

The setup finish with this
Finished processing dependencies for pyindi-client==0.1.0a1

launch indiserver
indiserver -vvv indi_simulator_ccd indi_simulator_telescope

then this python command
python test-indiclient.py

But when I'm trying the first example code,
Traceback (most recent call last):
  File "/home/pi/pyindi-client-code/swig-indi/swig-indi-python/test-indiclient.py", line 13, in <module>
    import PyIndi
  File "/usr/local/lib/python2.7/dist-packages/pyindi_client-0.1.0a1-py2.7-linux-armv7l.egg/PyIndi.py", line 28, in <module>
    _PyIndi = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/pyindi_client-0.1.0a1-py2.7-linux-armv7l.egg/PyIndi.py", line 24, in swig_import_helper
    _mod = imp.load_module('_PyIndi', fp, pathname, description)
ImportError: /usr/lib/arm-linux-gnueabihf/libindidriver.so.1: undefined symbol: ISSnoopDevice

Any idea ?
Linux Mint 19 Cinnamon using PPA for latest KStars-bleeding and INDI
Raspberry Pi 3 B+ with StellarMate
Atik 314E - ASI120M - CG5 with Celestron C9.25
7 years 1 day ago #15319

Please Log in or Create an account to join the conversation.

  • Posts: 226
  • Thank you received: 88
Hi,
I've just tested on a Fedora with the pip method and this is still working.
You do not have to change the libraries config item with indidriver, pyindi-client is a client, not an indi driver.
Now the libindi.so seems to have disappeared in version 1.4.1, but it seems the pkg-config libindi.pc still reports it as a link flag to use.
Maybe you could try with
libraries = 

Jean-Luc.
6 years 11 months ago #15354

Please Log in or Create an account to join the conversation.

I just updated libindi.pc, do not use the "Libs" if you're a client, since you just need to link to the static INDI client library. I read about libs.private, is this used for static linking?
6 years 11 months ago #15356

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 12
On my raspbian when I'm using pip command, I get this return :
Downloading/unpacking pyindi-client
  Could not find a version that satisfies the requirement pyindi-client (from versions: 0.1.0a1)
Cleaning up...
No distributions matching the version for pyindi-client
Storing debug log for failure in /home/pi/.pip/pip.log

This is why I'm using the second way to install it, but if I'm using a
python setup.py install
with the default setup.cfg file, I get :
running install
running build_ext
building '_PyIndi' extension
swigging indiclientpython.i to indiclientpython_wrap.cpp
swig -python -v -Wall -c++ -threads -I/usr/include -I/usr/include/libindi -o indiclientpython_wrap.cpp indiclientpython.i
Language subdirectory: python
Search paths:
   ./
   /usr/include/
   /usr/include/libindi/
   ./swig_lib/python/
   /usr/share/swig2.0/python/
   ./swig_lib/
   /usr/share/swig2.0/
Preprocessing...
Starting language-specific parse...
/usr/include/libindi/baseclient.h:32: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
/usr/include/libindi/basedevice.h:32: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
Processing types...
C++ analysis...
/usr/include/libindi/baseclient.h:56: Warning 403: Class 'INDI::BaseClient' might be abstract, no constructors generated,
/usr/include/libindi/indibase.h:81: Warning 403: Method INDI::BaseMediator::newDevice(INDI::BaseDevice *) might not be implemented.
Generating wrappers...
creating build
creating build/temp.linux-armv7l-2.7
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include -I/usr/include/libindi -I/usr/include/python2.7 -c indiclientpython_wrap.cpp -o build/temp.linux-armv7l-2.7/indiclientpython_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
creating build/lib.linux-armv7l-2.7
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/indiclientpython_wrap.o /usr/lib/arm-linux-gnueabihf/libindiclient.a -lindi -o build/lib.linux-armv7l-2.7/_PyIndi.so
/usr/bin/ld: ne peut trouver -lindi
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1
Linux Mint 19 Cinnamon using PPA for latest KStars-bleeding and INDI
Raspberry Pi 3 B+ with StellarMate
Atik 314E - ASI120M - CG5 with Celestron C9.25
6 years 11 months ago #15358

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 12
After log checking, the python install procedure fail because this is a pre-release.
version 0.1.0a1 is a pre-release (use --pre to allow)

This resolve the pip error but after using
pip install --pre pyindi-client

I have this error again about library localization :
/usr/bin/ld: ne peut trouver -lindi
Linux Mint 19 Cinnamon using PPA for latest KStars-bleeding and INDI
Raspberry Pi 3 B+ with StellarMate
Atik 314E - ASI120M - CG5 with Celestron C9.25
Last edit: 6 years 11 months ago by Sébastien.
6 years 11 months ago #15360

Please Log in or Create an account to join the conversation.

  • Posts: 226
  • Thank you received: 88
Concerning the pip issue, is the pyindi-client already installed ? It seems it found the 0.1.0a1 version but does not care. Maybe there has been some changes in pip itself. Which version of pip do you use ? Anyway just to be sure everything is rebuilt when upgrading libindi, you should run:
pip install --upgrade --user --force-reinstall pyindi-client # for python 2.7 if this is the default
python3 -m pip install --upgrade --user --force-reinstall pyindi-client # for python3 as my pip3 disappeared when I jump to pip 9.0.1
When you run setup manually, you should now change the libraries line in the setup.cfg file as stated above:
libraries =
This is why the compilation aborts. I will have to change that on pypi. But I wonder if this was not required in preceding releases of libindi due to some dependencies.

@Jasem: yes, you're right, Libs.private and Required.private may be useful as libz, libnova and libcfistio are required for libindiclient.a. And I may also use the --static flag when using pkg-config. I would have to rebuild a proper installation for testing all that, my current installs are full of existng thing.
6 years 11 months ago #15361

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 12
From bug to bug :(

So, I keep trying with your advice. I compile it again with
libraries=

It works but when I try an import in python
I get this error
>>> import PyIndi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pyindi_client-0.1.0a1-py2.7-linux-armv7l.egg/PyIndi.py", line 28, in <module>
    _PyIndi = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/pyindi_client-0.1.0a1-py2.7-linux-armv7l.egg/PyIndi.py", line 24, in swig_import_helper
    _mod = imp.load_module('_PyIndi', fp, pathname, description)
ImportError: /usr/local/lib/python2.7/dist-packages/pyindi_client-0.1.0a1-py2.7-linux-armv7l.egg/_PyIndi.so: undefined symbol: ln_get_julian_from_sys
Linux Mint 19 Cinnamon using PPA for latest KStars-bleeding and INDI
Raspberry Pi 3 B+ with StellarMate
Atik 314E - ASI120M - CG5 with Celestron C9.25
6 years 11 months ago #15368

Please Log in or Create an account to join the conversation.

  • Posts: 226
  • Thank you received: 88
I've tried on a old indi version, when I suppress lindi from libraries, the Python import lacks the crackDN function, which was lying in libindi.so.
So I think that for version prior to 1.4.1 of libindi, we should leave libraries = lindi.
Starting at version 1.4.1, we should use the dependencies of libindiclient.a, which should be libz, libnnova and libcfitsio. So I suggest to use
libraries= z nova cfitsio
in the setup.cfg file. I don't have time to test yet but I 'll try to confirm that point this evening.
6 years 11 months ago #15372

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 12
Nope, it's not working. Same python error.

Thank for testing this. I'm building an allsky camera and everything needs to be ok because the camera will take picture from Chili.

So if I setup a 1.3 indi version, you think it will work ?
Linux Mint 19 Cinnamon using PPA for latest KStars-bleeding and INDI
Raspberry Pi 3 B+ with StellarMate
Atik 314E - ASI120M - CG5 with Celestron C9.25
6 years 11 months ago #15377

Please Log in or Create an account to join the conversation.

  • Posts: 226
  • Thank you received: 88
It seems that it worked for me. Did you force rebuild and reinstall ?
python setup.py build --force
python setup.py install --user
It should recompile all the swig/c++ stuff. Anyway the libindi dependency is no more there in libindi 1.4.1, which is a good thing.
If you use libindi 1.3 the libindi dependency is still there, so the initial libraries=indi should be used (it loads libz, libnova and libcfitsio by the way of this dependency).
6 years 11 months ago #15378

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 12
This is really weird. I'm completly lost.
Whatever I'm trying like you wrote, setup is ending well but in python, I can't import PyIndi library without error :

Can you write the full procedure to build it from start (ie pyindi-client download) with indi1.4.1 and Raspbian Jessie ?

I will start with a fresh raspbian and a fresh indi 1.4.1.

Maybe it's a good idea to refresh this webpage indilib.org/support/tutorials/166-instal...on-raspberry-pi.html to work with raspbian and latest version of indi
Linux Mint 19 Cinnamon using PPA for latest KStars-bleeding and INDI
Raspberry Pi 3 B+ with StellarMate
Atik 314E - ASI120M - CG5 with Celestron C9.25
6 years 11 months ago #15380

Please Log in or Create an account to join the conversation.

Time to create page: 0.659 seconds