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
  ASCII-Codec in Python3 [SOLVED] AlphaInc 4 788 Jul-07-2021, 07:05 PM
Last Post: AlphaInc
  interloper help appreciated combining two python3 scripts to add new conditions. Ricktoddfrank 0 446 Jun-22-2021, 10:24 PM
Last Post: Ricktoddfrank
  Different versions of Python3 and Python Led_Zeppelin 2 824 Jun-16-2021, 05:31 AM
Last Post: snippsat
  Installing Python3 on MacOS using brew zazas321 5 1,405 May-28-2021, 06:19 AM
Last Post: perfringo
Question Python3 - serial port reload parovelb 4 1,040 Apr-08-2021, 09:18 AM
Last Post: parovelb
  MacOS BigSur Python3 - dyld: Library not loaded: trillionanswers 1 2,526 Mar-02-2021, 11:00 PM
Last Post: nilamo
  How to understand the byte notation in python3 blackknite 3 849 Feb-23-2021, 04:45 PM
Last Post: bowlofred
  Python3 doesn't populate xlsx file with openpyxl Auldyin75 2 1,061 Feb-16-2021, 12:00 PM
Last Post: Auldyin75
  Help with porting to python3 mason28 3 3,358 Jan-23-2021, 02:48 AM
Last Post: Larz60+
  python2 python3 messed up : How to fix ? hary 15 2,568 Dec-30-2020, 08:26 PM
Last Post: hary

Forum Jump:

User Panel Messages

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