Apologies Chris, you said to run the 2to3 command on all the scripts that get called from mun_downlink_proxy.py.
Please can you tell me all the scripts that I have to run the command or how to do to know Which one are? Thanks for your collaboration and understanding 73’s de Enzo IK8OZV EasyLog 5 BetaTester EasyLog PDA BetaTester WinBollet BetaTester D.C.I. CheckPoint Regione Campania Skype: ik8ozv8520 ********************************* ****** GSM +39 328 7110193 ****** ***** SMS +39 328 7110193 ***** ********************************* Da: Chris Gorman <chrisjohgor...@gmail.com> Inviato: domenica 6 settembre 2020 20:58 A: Vincenzo Mone <vim...@alice.it> Oggetto: Re: R: Cannot run a command On Sun, Sep 6, 2020 at 2:13 PM Vincenzo Mone <vim...@alice.it <mailto:vim...@alice.it> > wrote: Thank s Chris for your help. As I said before I am not so clever on the Linux so you have to drive me by hand Like a little child when he goes to the school for the first time Lol. No problem, we all have to learn somewhere. :) BTW I have tried as you said with the command: 2to3 -w /home/enzo/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/mun_downlink_proxy.py But as I do I not had the program I got: Command "2to3" not found, but can be installed with: sudo apt install 2to3 so I have installed it with the above suggested command and ran again the 2to3 command and got: Command "2to3" not found, but can be installed with: sudo apt install 2to3 RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Refactored /home/enzo/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/mun_downlink_proxy.py --- /home/enzo/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/mun_downlink_proxy.py (original) +++ /home/enzo/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/mun_downlink_proxy.py (refactored) @@ -26,7 +26,7 @@ import datetime import xml.dom.minidom as minidom import pickle -import urllib2 +import urllib.request, urllib.error, urllib.parse from PyQt5 import QtGui, QtCore, Qt, QtWidgets # import ui confige @@ -296,7 +296,7 @@ f.close() self.reload() except Exception as error: - print("[File] Configured file read failed. Error: " + str(error)) + print(("[File] Configured file read failed. Error: " + str(error))) def reload(self): ''' @@ -593,7 +593,7 @@ Exception: an error occured accessing tle file or grc_param.py """ try: - f = urllib2.urlopen(str(self.ui.tle_url_text.text())) + f = urllib.request.urlopen(str(self.ui.tle_url_text.text())) tle = f.read() tle = tle.split("\n") @@ -641,13 +641,13 @@ log += "%02X" % ord(i) + " " count += 1 self.log_dict[index].write("Data: " + log + "\n\n") - print( + print(( "[Data] Received time is " + datetime.datetime.utcfromtimestamp( float(data['proxy_receive_time']/1000)).strftime( - '%Y-%m-%d %H:%M:%S')) - print( - "Data is: " + log + "\n" + "Data Length is: " + str(count)) + '%Y-%m-%d %H:%M:%S'))) + print(( + "Data is: " + log + "\n" + "Data Length is: " + str(count))) self.log_dict[index].flush() def normal_output_written(self, text): RefactoringTool: Files that were modified: RefactoringTool: /home/enzo/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/mun_downlink_proxy.py Then I have tried to run again my command: python2 ~/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/mun_downlink_proxy.py and got: Traceback (most recent call last): File "/home/enzo/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/mun_downlink_proxy.py", line 29, in <module> import urllib.request, urllib.error, urllib.parse ImportError: No module named request This is correct for we are converting your scripts to use python3. I recommend this as I don't think PyQt5 exists for python2. (You apparently can build it yourself, but it's not very easy to accomplish.) If I run python3…………… Instead of python2……. I get: Traceback (most recent call last): File "/home/enzo/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/mun_downlink_proxy.py", line 38, in <module> from core.data import server_data File "/home/enzo/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/core/data.py", line 2, in <module> import Queue ModuleNotFoundError: No module named 'Queue' You will have to run 2to3 on all the scripts that get called from mun_downlink_proxy.py. So run ... 2to3 -w /home/enzo/gr-lilacsat-pyqt5/examples/BY70-2/DSLWP-Downlink-Proxy/core/data.py This will change Queue to queue which will load under python3. 2to3 -w other_script_that_gets_called_from_mun_downlink_proxy.py Your original scripts will be saved with a .bak extension. Just rename them if you don't like 2to3's changes. eg. mv mun_downlink_proxy.py.bak mun_downlink_proxy.py Thanks No problem. Take care and let me know where you get to next. Chris 73’s de Enzo IK8OZV EasyLog 5 BetaTester EasyLog PDA BetaTester WinBollet BetaTester D.C.I. CheckPoint Regione Campania Skype: ik8ozv8520 ********************************* ****** GSM +39 328 7110193 ****** ***** SMS +39 328 7110193 ***** *********************************