Python Forum

Full Version: Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
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 ?
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.