What distribution, what python version, how did you install cdemu?
Is the gobject introspection installed in the same python environment that cdemu is using? Try launching python manually, using the shebang from /usr/local/bin/cdemu (i.e., the first line in the file - for example, "/usr/bin/env python3") and do "import gi" there...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It has been working for about 2 years now.
How? well cdemu cant be installed through apt in debian so it was installed from sourceforge download pages.
Python
Python: version (2.7.13-2). (according top apt)
However: Python3 is also installed and executes on CLI
$ python3
Python 3.6.3 (default, Dec 17 2021, 00:18:20) [GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
Cdemu:
Shebang: #!/usr/bin/env python3
As per your instructions:
$ /usr/bin/env python3
Python 3.6.3 (default, Dec 17 2021, 00:18:20) [GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
import gi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'gi'</module></stdin>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
$apt install python3-gi
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-gi is already the newest version (3.22.0-2).
Last edit: retnev 2022-01-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are using a distribution that has python 3.5.3 as the packaged python version, and so the gi that is packaged in python3-gi is installed for that python (into /usr/lib/python3/dist-packages/gi, as per https://packages.debian.org/stretch/amd64/python3-gi/filelist).
Your system, however, is using python 3.6.3 as its default python, and therefore does not have gi available. So you can either:
a) install gi for your python 3.6.3
b) make python 3.5.3 the default python again
c) change the shebang in /usr/local/bin/cdemu to use python3.5 instead of just python3
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks a lot.
I changed the shebang and now it works.
Regarding Python:
I have only two problems on Linux as syadmin.
They are Python and systemD.
Python must be heaven for a developer but it is truly hell for a user to maintain. I have no idea why gi suddenly moved from python3 to python 3.5 which is clearly what the problem was.
Since this happened without any of my direct doing. No python installs or any cdemu installation. The system is basically hard locked as it is mission critical. The question is why Python seemingly moved the gi association from Version 3 to Version 3.5. ?
This is the problem I have with the snake (Python).
Things in it's coils just changes affiliations. I have this often with Python applications and it is a nightmare.
systemD is another nutcase interfering (nothing to do with this problem) detrimentally with audio servers. Initially, once I removed all of systemD things started working.
If I can get rid of Python and systemD Linux would be bliss. But these have become pervasive taking over everything.
Python should do a better job not breaking application dependencies.
Last edit: retnev 2022-01-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have no idea why gi suddenly moved from python3 to python 3.5 which is clearly what the problem was.
gi didn't move anywhere - it is exactly where it was from the very beginning. Your distribution provides deb packages for python 3.5 it packages, which is also the default python3 for that distribution. So initially, things worked because python3 pointed to system python 3.5 that had gi installed.
Then someone installed python3.6 on that system (placed in /usr/local), and made it the default python3 on the system. Which probably breaks all system-packaged python applications that make use of system-packaged python packages/libraries, because this python3.6 has different library search paths (and in case of binary extensions, the ones for python 3.5 may not be compatible with 3.6 ABI, anyway).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nope the path trick didnt work. I now have several broken applications. Python to me is irresponsible software. No backward compatibility between versions and if no backward compatibility, the user is not informed that that would be the case.
I really dont like the snake. I honestly dont know how the new version got onto my system. as all automatic updates were switched off and I didnt install anything before this problem started happening.
Anyway I know this is off topic, but if you know of an easy way to downgrade I would appreciate it as the online Python solutions are convoluted and inconclusive.
I want to downgrade from 3.6.3 to 3.53.
It seems 3.6.3 executes from /usr/local/bin, which usually means it was installed from source. I am sure I did not do that ..weird.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What distribution, what python version, how did you install cdemu?
Is the gobject introspection installed in the same python environment that cdemu is using? Try launching python manually, using the shebang from /usr/local/bin/cdemu (i.e., the first line in the file - for example, "/usr/bin/env python3") and do "import gi" there...
It has been working for about 2 years now.
How? well cdemu cant be installed through apt in debian so it was installed from sourceforge download pages.
Cdemu
cdemu-daemon-3.2.2.tar.bz2
vhba-module-20190410.tar.bz2
libmirage-3.2.2.tar.bz2
Kernel
$ cat /proc/version
Linux version 5.2.0-17.2-liquorix-amd64 (stevep@mxlinux.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 ZEN SMP PREEMPT liquorix 5.2-26~mx17+1 (2019-09-24)
Distro
$cat /etc/lease
NAME="MX"
VERSION="18 (Continuum)"
ID="mx"
VERSION_ID="18"
PRETTY_NAME="MX 18 (Continuum)"
ANSI_COLOR="0;34"
HOME_URL="https://mxlinux.org"
BUG_REPORT_URL="https://mxlinux.org"
PRETTY_NAME="MX 18.3 Continuum"
DISTRIB_ID=MX
DISTRIB_RELEASE=18.3
DISTRIB_CODENAME=Continuum
DISTRIB_DESCRIPTION="MX 18.3 Continuum"
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Python
Python: version (2.7.13-2). (according top apt)
However: Python3 is also installed and executes on CLI
$ python3
Python 3.6.3 (default, Dec 17 2021, 00:18:20)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
Cdemu:
Shebang: #!/usr/bin/env python3
As per your instructions:
$ /usr/bin/env python3
Python 3.6.3 (default, Dec 17 2021, 00:18:20)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
So as you can see,
gi
is not available in your python 3.6.3, which cdemu is using.When you say
gi
is installed, what exactly is installed? Do you have python3-specific package installed (on regular debian that would bepython3-gi
)?It is installed for Python3
Last edit: retnev 2022-01-14
What is the output of
dpkg -s python3
?And what do you get if you run
python3
, then run:First Question
Second Question
OK, so do you see what your problem is?
You are using a distribution that has python 3.5.3 as the packaged python version, and so the
gi
that is packaged inpython3-gi
is installed for that python (into/usr/lib/python3/dist-packages/gi
, as per https://packages.debian.org/stretch/amd64/python3-gi/filelist).Your system, however, is using python 3.6.3 as its default python, and therefore does not have
gi
available. So you can either:a) install
gi
for your python 3.6.3b) make python 3.5.3 the default python again
c) change the shebang in
/usr/local/bin/cdemu
to usepython3.5
instead of justpython3
Thanks a lot.
I changed the shebang and now it works.
Regarding Python:
I have only two problems on Linux as syadmin.
They are Python and systemD.
Python must be heaven for a developer but it is truly hell for a user to maintain.
I have no idea why gi suddenly moved from python3 to python 3.5 which is clearly what the problem was.
Since this happened without any of my direct doing. No python installs or any cdemu installation. The system is basically hard locked as it is mission critical. The question is why Python seemingly moved the gi association from Version 3 to Version 3.5. ?
This is the problem I have with the snake (Python).
Things in it's coils just changes affiliations. I have this often with Python applications and it is a nightmare.
systemD is another nutcase interfering (nothing to do with this problem) detrimentally with audio servers. Initially, once I removed all of systemD things started working.
If I can get rid of Python and systemD Linux would be bliss. But these have become pervasive taking over everything.
Python should do a better job not breaking application dependencies.
Last edit: retnev 2022-01-17
gi didn't move anywhere - it is exactly where it was from the very beginning. Your distribution provides deb packages for python 3.5 it packages, which is also the default python3 for that distribution. So initially, things worked because python3 pointed to system python 3.5 that had gi installed.
Then someone installed python3.6 on that system (placed in /usr/local), and made it the default python3 on the system. Which probably breaks all system-packaged python applications that make use of system-packaged python packages/libraries, because this python3.6 has different library search paths (and in case of binary extensions, the ones for python 3.5 may not be compatible with 3.6 ABI, anyway).
I managed to get 5.3 the default again by just changing the PATH order of /usr/bin and /usr/local/bin
Dont know if that will work in the end, but it is a quick way to get rid of the dreaded 3.6.
Last edit: retnev 2022-01-19
Nope the path trick didnt work. I now have several broken applications. Python to me is irresponsible software. No backward compatibility between versions and if no backward compatibility, the user is not informed that that would be the case.
I really dont like the snake. I honestly dont know how the new version got onto my system. as all automatic updates were switched off and I didnt install anything before this problem started happening.
Anyway I know this is off topic, but if you know of an easy way to downgrade I would appreciate it as the online Python solutions are convoluted and inconclusive.
I want to downgrade from 3.6.3 to 3.53.
It seems 3.6.3 executes from /usr/local/bin, which usually means it was installed from source. I am sure I did not do that ..weird.
Anyway thanks for all the help.
Cdemu is one of the greatest Linux applications and I appreciate it very much.