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 !

[email protected]:~/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 :

[email protected]:~/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
  How should I run pip-date in python3? newbieAuggie2019 5 189 Yesterday, 03:21 PM
Last Post: snippsat
  How to use xmlrpc from flrig? mamoman 3 315 Feb-10-2023, 06:25 PM
Last Post: Larz60+
  How to run together python3.10 and python3.7 ilknurg 2 261 Nov-14-2022, 10:11 AM
Last Post: Gribouillis
  hypothesis 6.46.2 requires python3.7 or later Anldra12 6 767 Jun-22-2022, 11:05 AM
Last Post: Anldra12
  Python3 hashlib ogautier 1 982 Mar-28-2022, 04:42 AM
Last Post: snippsat
  Python3 url parse ogautier 5 1,454 Mar-04-2022, 06:56 PM
Last Post: snippsat
  Python3 List in requests ogautier 1 806 Mar-04-2022, 12:09 PM
Last Post: DeaD_EyE
  For Lopop Python3 ogautier 2 736 Mar-02-2022, 03:15 AM
Last Post: tomtom
  Python3 for loop over a dict ogautier 3 841 Feb-25-2022, 10:17 AM
Last Post: Larz60+
  Migration of Python2 and Python3 using Modernize and Future Rakshan 4 1,355 Feb-21-2022, 08:26 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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