×

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
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 week 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.
7 years 1 week 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?
7 years 1 week 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
7 years 1 week 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: 7 years 1 week ago by Sébastien.
7 years 1 week 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.
7 years 1 week 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
7 years 1 week 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.
7 years 1 week 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
7 years 1 week 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).
7 years 1 week 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
7 years 1 week ago #15380

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

  • Posts: 226
  • Thank you received: 88
I don't think making a fresh install is necessary. If you download the pyindi-client package, untar it, modify the line in setup.cfg
libraries= z nova cfitsio
and run python setup.py install --user, that should work if you don't have already installed the package.If setup finds it is already there it may not reinstall anything. In this case you should run python setup.py build --force and python setup.py install --user.
Give me the output of these setup build and install commands and what displays the PyIndi import.
Normally with the --user flag, the resulting package is installed in ~/.local/ so a good thing would be to test it with
ls -l ~/.local/lib/python3.5/site-packages/pyindi_client-0.1.0a1-py3.5-linux-x86_64.egg/
ldd -v ~/.local/lib/python3.5/site-packages/pyindi_client-0.1.0a1-py3.5-linux-x86_64.egg/_PyIndi.cpython-35m-x86_64-linux-gnu.so
Replace the python version with the one you use, and also the architecture name.
And the good idea is not to refresh the tutorial page, but modify the setup scripts for the new libindi version (and pip which tells you to use version numbers, but now consider that 0.1.0a1 is not enough a version number).
The following user(s) said Thank You: Jasem Mutlaq
7 years 1 week ago #15382

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

Time to create page: 0.906 seconds