Python Forum
Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ?
#1
First I create a osmocom-sink signal-source and Xmlrpc-server. I want to use rcp commands to change cent_frequency. İt give to me this error

****Executing: /usr/bin/python3 -u /root/Downloads/xmlsiz.py
Traceback (most recent call last):
File "/root/Downloads/xmlsiz.py", line 20, in <module>
import SimpleXMLRPCServer
ModuleNotFoundError: No module named 'SimpleXMLRPCServer'
>>> Done (return code 1)****
I Fixed it. I changed library name to

import SimpleXMLRPCServer

from xmlrpc.server import SimpleXMLRPCServer

But İt is giving to me this error again !

root@kali:~/Downloads# python3 '/root/Downloads/xmlsiz.py'
Traceback (most recent call last):
File "/root/Downloads/xmlsiz.py", line 157, in <module>
main()
File "/root/Downloads/xmlsiz.py", line 135, in main
tb = top_block_cls()
File "/root/Downloads/xmlsiz.py", line 81, in __init__
self.xmlrpc_server_0 = SimpleXMLRPCServer.SimpleXMLRPCServer(('localhost', 8080), allow_none=True)
AttributeError: type object 'SimpleXMLRPCServer' has no attribute 'SimpleXMLRPCServer'


How Can I Fix This ? Gnuradio 3.8.0 python3 version is not compatible Python3 Xmlrpc Library.
I need to use xmlrpc library
Reply
#2
In Python 2.7 the class is: SimpleXMLRPCServer.SimpleXMLRPCServer
This has been changed in Python 3. It's here: xmlrpc.server.SimpleXMLRPCServer

The code imports SimpleXMLRPCServer and expects the module with this name.
I think a solution could be this:

try:
   import SimpleXMLRPCServer
except ModuleNotFoundError:
   import xmlrpc.server as SimpleXMLRPCServer

# print(SimpleXMLRPCServer.SimpleXMLRPCServer)
I guess after this small fix/workaround you'll get new tracebacks.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#3
Dye Eye I write this only and fixed first problem

import xmlrpc.server as SimpleXMLRPCServer

But İt give me another errors like this :

root@kali:~/Downloads# python3 '/root/Downloads/xmlsiz.py'
Traceback (most recent call last):
File "/root/Downloads/xmlsiz.py", line 157, in <module>
main()
File "/root/Downloads/xmlsiz.py", line 135, in main
tb = top_block_cls()
File "/root/Downloads/xmlsiz.py", line 81, in __init__
self.xmlrpc_server_0 = SimpleXMLRPCServer.SimpleXMLRPCServer(('localhost', 8080), allow_none=True)
AttributeError: type object 'SimpleXMLRPCServer' has no attribute 'SimpleXMLRPCServer'

GnuRadio 3.8 Python3 is not compatible with python3 What can we do this case ?
It probably they changed block form and I am taking this errors .
I tried to change python codes Gnuradio dont accept I go to /usr/libs/python2.7 and changed it 3.7 .But gnuradio dont accept this trick . Python3 is having problem what can we do ?
Reply
#4
GNU Radio should support Python 3.
It depends how it was built. Maybe the package itself does compile against Python 2.7.
If you build GNU Radio, you can set the Python path, executable etc.

You're running your own script located in Downloads, which were made for Python 2.7.
Without code, it's a guessing game. In addition, how is the script started?
Manually from terminal or from GNU Radion itself?

Post the code of the script, maybe we can help.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python3 string slicing Luchano55 4 605 Feb-17-2024, 09:40 AM
Last Post: Pedroski55
  Kivy App - Python3 script to Android app (opencv) jttolleson 7 3,492 Oct-19-2023, 01:11 PM
Last Post: MasCain
Sad Migrating of python2 script to python3 zuri 7 973 Oct-05-2023, 02:40 PM
Last Post: snippsat
  Migration of Python2 and Python3 using Modernize and Future Rakshan 5 2,510 Oct-05-2023, 08:55 AM
Last Post: zuri
  How can prepare the modules when compiling python3.11? luofeiyu 1 570 Sep-28-2023, 03:50 PM
Last Post: deanhystad
  Understanding and debugging memory error crashes with python3.10.10 Arkaik 5 2,080 Apr-18-2023, 03:22 AM
Last Post: Larz60+
  How should I run pip-date in python3? newbieAuggie2019 5 1,853 Mar-31-2023, 03:21 PM
Last Post: snippsat
  How to use xmlrpc from flrig? mamoman 3 1,110 Feb-10-2023, 06:25 PM
Last Post: Larz60+
  How to run together python3.10 and python3.7 ilknurg 2 770 Nov-14-2022, 10:11 AM
Last Post: Gribouillis
  hypothesis 6.46.2 requires python3.7 or later Anldra12 6 1,623 Jun-22-2022, 11:05 AM
Last Post: Anldra12

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020