Error Launching IPSC_Bridge.py


Hayden - KK7HXF
 
Edited

Hey Everyone,

Newbie here trying to setup an IPSC_Bridge. I began by cloning the IPSC_Bridge tree from https://gitlab.hacknix.net/hacknix/DMRlink.git

When I try to launch IPSC_Bridge.py I receive the following:

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ python3 ./IPSC_Bridge.py

Traceback (most recent call last):

  File "/opt/DMRlink/./IPSC_Bridge.py", line 35, in <module>

    from dmrlink import IPSC, systems, config_reports, reportFactory 

  File "/opt/DMRlink/dmrlink.py", line 491

    def send_packet(self, _packet, (_host, _port)):

                                   ^

SyntaxError: invalid syntax

Additionally, if I try to run dmrlink.py, I run into the same issue:

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ python3 ./dmrlink.py

  File "/opt/DMRlink/./dmrlink.py", line 491

    def send_packet(self, _packet, (_host, _port)):

                                   ^

SyntaxError: invalid syntax


As you can see this is being ran as python3. I am unsure of how to proceed from here. Ultimately I am trying to connect a cBridge into HBLink so I can allow a hotspot to connect. If there is better documentation or a guide I should follow, please let me know. 


Doug - W4DBG
 

If I am not mistaken this needs to be ran with Python not Python3. 

Doug
W4DBG




On Tue, Sep 13, 2022 at 4:49 PM Hayden - KK7HXF <hwhitfield2@...> wrote:

[Edited Message Follows]

Hey Everyone,

Newbie here trying to setup an IPSC_Bridge. I began by cloning the IPSC_Bridge tree from https://gitlab.hacknix.net/hacknix/DMRlink.git

When I try to launch IPSC_Bridge.py I receive the following:

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ python3 ./IPSC_Bridge.py

Traceback (most recent call last):

  File "/opt/DMRlink/./IPSC_Bridge.py", line 35, in <module>

    from dmrlink import IPSC, systems, config_reports, reportFactory 

  File "/opt/DMRlink/dmrlink.py", line 491

    def send_packet(self, _packet, (_host, _port)):

                                   ^

SyntaxError: invalid syntax

Additionally, if I try to run dmrlink.py, I run into the same issue:

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ python3 ./dmrlink.py

  File "/opt/DMRlink/./dmrlink.py", line 491

    def send_packet(self, _packet, (_host, _port)):

                                   ^

SyntaxError: invalid syntax


As you can see this is being ran as python3. I am unsure of how to proceed from here. Ultimately I am trying to connect a cBridge into HBLink so I can allow a hotspot to connect. If there is better documentation or a guide I should follow, please let me know. 

--
Doug Gooden
troytrojan@...


Hayden - KK7HXF
 

Hey Doug,

I thought so too, so I reran it. Below are the results for dmrlink:

 

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ python ./dmrlink.py

Traceback (most recent call last):

  File "./dmrlink.py", line 42, in <module>

    from twisted.internet.protocol import DatagramProtocol, Factory, Protocol

  File "/usr/lib/python2.7/twisted/internet/protocol.py", line 33

    protocol: "Optional[Callable[[], Protocol]]" = None

            ^

SyntaxError: invalid syntax

Below are the results for IPSC_Bridge:

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ ./IPSC_Bridge.py

Traceback (most recent call last):

  File "./IPSC_Bridge.py", line 28, in <module>

    from twisted.internet import reactor

  File "/usr/lib/python2.7/twisted/internet/reactor.py", line 38, in <module>

    from twisted.internet import default

  File "/usr/lib/python2.7/twisted/internet/default.py", line 15, in <module>

    from twisted.python.runtime import platform

  File "/usr/lib/python2.7/twisted/python/__init__.py", line 9, in <module>

    from .deprecate import deprecatedModuleAttribute

  File "/usr/lib/python2.7/twisted/python/deprecate.py", line 126

    return f"{moduleName}.{name}"

                                ^

 

SyntaxError: invalid syntax


Doug - W4DBG
 

To run this simply go to directory (usually opt) and do the following:


python IPSC_Bridge.py




On Tue, Sep 13, 2022 at 4:57 PM Hayden - KK7HXF <hwhitfield2@...> wrote:

Hey Doug,

I thought so too, so I reran it. Below are the results for dmrlink:

 

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ python ./dmrlink.py

Traceback (most recent call last):

  File "./dmrlink.py", line 42, in <module>

    from twisted.internet.protocol import DatagramProtocol, Factory, Protocol

  File "/usr/lib/python2.7/twisted/internet/protocol.py", line 33

    protocol: "Optional[Callable[[], Protocol]]" = None

            ^

SyntaxError: invalid syntax

Below are the results for IPSC_Bridge:

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ ./IPSC_Bridge.py

Traceback (most recent call last):

  File "./IPSC_Bridge.py", line 28, in <module>

    from twisted.internet import reactor

  File "/usr/lib/python2.7/twisted/internet/reactor.py", line 38, in <module>

    from twisted.internet import default

  File "/usr/lib/python2.7/twisted/internet/default.py", line 15, in <module>

    from twisted.python.runtime import platform

  File "/usr/lib/python2.7/twisted/python/__init__.py", line 9, in <module>

    from .deprecate import deprecatedModuleAttribute

  File "/usr/lib/python2.7/twisted/python/deprecate.py", line 126

    return f"{moduleName}.{name}"

                                ^

 

SyntaxError: invalid syntax

--
Doug Gooden
troytrojan@...


Hayden - KK7HXF
 

Hey Doug,

Still returns the same results. My python path calls Python2.7

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ python IPSC_Bridge.py

Traceback (most recent call last):

  File "IPSC_Bridge.py", line 28, in <module>

    from twisted.internet import reactor

  File "/usr/lib/python2.7/twisted/internet/reactor.py", line 38, in <module>

    from twisted.internet import default

  File "/usr/lib/python2.7/twisted/internet/default.py", line 15, in <module>

    from twisted.python.runtime import platform

  File "/usr/lib/python2.7/twisted/python/__init__.py", line 9, in <module>

    from .deprecate import deprecatedModuleAttribute

  File "/usr/lib/python2.7/twisted/python/deprecate.py", line 126

    return f"{moduleName}.{name}"

                                ^

SyntaxError: invalid syntax


Doug - W4DBG
 

You do have twisted installed?

pip install Twisted



On Tue, Sep 13, 2022 at 6:54 PM Hayden - KK7HXF <hwhitfield2@...> wrote:
Hey Doug,

Still returns the same results. My python path calls Python2.7

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ python IPSC_Bridge.py

Traceback (most recent call last):

  File "IPSC_Bridge.py", line 28, in <module>

    from twisted.internet import reactor

  File "/usr/lib/python2.7/twisted/internet/reactor.py", line 38, in <module>

    from twisted.internet import default

  File "/usr/lib/python2.7/twisted/internet/default.py", line 15, in <module>

    from twisted.python.runtime import platform

  File "/usr/lib/python2.7/twisted/python/__init__.py", line 9, in <module>

    from .deprecate import deprecatedModuleAttribute

  File "/usr/lib/python2.7/twisted/python/deprecate.py", line 126

    return f"{moduleName}.{name}"

                                ^

SyntaxError: invalid syntax

--
Doug Gooden
troytrojan@...


Hayden - KK7HXF
 

I do.

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ pip install Twisted

Requirement already satisfied: Twisted in /usr/lib/python3.9 (22.8.0)

Requirement already satisfied: typing-extensions>=3.6.5 in /usr/lib/python3.9 (from Twisted) (4.3.0)

Requirement already satisfied: Automat>=0.8.0 in /usr/lib/python3.9 (from Twisted) (20.2.0)

Requirement already satisfied: hyperlink>=17.1.1 in /usr/lib/python3.9 (from Twisted) (21.0.0)

Requirement already satisfied: incremental>=21.3.0 in /usr/lib/python3.9 (from Twisted) (21.3.0)

Requirement already satisfied: attrs>=19.2.0 in /usr/lib/python3/dist-packages (from Twisted) (20.3.0)

Requirement already satisfied: zope.interface>=4.4.2 in /usr/lib/python3.9 (from Twisted) (5.4.0)

Requirement already satisfied: constantly>=15.1 in /usr/lib/python3.9 (from Twisted) (15.1.0)

Requirement already satisfied: six in /usr/lib/python3/dist-packages (from Automat>=0.8.0->Twisted) (1.16.0)

Requirement already satisfied: idna>=2.5 in /usr/lib/python3/dist-packages (from hyperlink>=17.1.1->Twisted) (2.10)

Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from zope.interface>=4.4.2->Twisted) (52.0.0)


Doug - W4DBG
 

The ^ is pointing to the problem. Due to email formatting I can’t accurately tell you exactly the issue. 

On Tue, Sep 13, 2022 at 6:56 PM Hayden - KK7HXF <hwhitfield2@...> wrote:
I do.

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ pip install Twisted

Requirement already satisfied: Twisted in /usr/lib/python3.9 (22.8.0)

Requirement already satisfied: typing-extensions>=3.6.5 in /usr/lib/python3.9 (from Twisted) (4.3.0)

Requirement already satisfied: Automat>=0.8.0 in /usr/lib/python3.9 (from Twisted) (20.2.0)

Requirement already satisfied: hyperlink>=17.1.1 in /usr/lib/python3.9 (from Twisted) (21.0.0)

Requirement already satisfied: incremental>=21.3.0 in /usr/lib/python3.9 (from Twisted) (21.3.0)

Requirement already satisfied: attrs>=19.2.0 in /usr/lib/python3/dist-packages (from Twisted) (20.3.0)

Requirement already satisfied: zope.interface>=4.4.2 in /usr/lib/python3.9 (from Twisted) (5.4.0)

Requirement already satisfied: constantly>=15.1 in /usr/lib/python3.9 (from Twisted) (15.1.0)

Requirement already satisfied: six in /usr/lib/python3/dist-packages (from Automat>=0.8.0->Twisted) (1.16.0)

Requirement already satisfied: idna>=2.5 in /usr/lib/python3/dist-packages (from hyperlink>=17.1.1->Twisted) (2.10)

Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from zope.interface>=4.4.2->Twisted) (52.0.0)

--
Doug Gooden
troytrojan@...


Hayden - KK7HXF
 


Hopefully this helps.


Chris Whitam
 

Do you have twisted installed for python, or just for python3?  It appears the python program is calling for twisted within python2.7, but your pip install is showing twisted installed in python3.9.  

On Tue, Sep 13, 2022 at 8:00 PM Hayden - KK7HXF <hwhitfield2@...> wrote:

Hopefully this helps.


Hayden - KK7HXF
 

I can’t seem to uninstall twisted to remove it from python3, I am just going to try a Debian9 build to see if I can get it to run correctly...

On Sep 13, 2022, at 7:34 PM, Chris Whitam <cwhitam@...> wrote:

Do you have twisted installed for python, or just for python3?  It appears the python program is calling for twisted within python2.7, but your pip install is showing twisted installed in python3.9.  

On Tue, Sep 13, 2022 at 8:00 PM Hayden - KK7HXF <hwhitfield2@...> wrote:
<dummyfile.0.part>
Hopefully this helps.




Hayden - KK7HXF
 

So I got it fully uninstalled, here is the output when trying to run:

hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ pip install twisted==20.3.0
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting twisted==20.3.0
  Using cached Twisted-20.3.0-cp27-cp27mu-manylinux1_x86_64.whl (3.2 MB)
Requirement already satisfied: Automat>=0.3.0 in /usr/lib/python2.7 (from twisted==20.3.0) (20.2.0)
Requirement already satisfied: hyperlink>=17.1.1 in /usr/lib/python2.7 (from twisted==20.3.0) (21.0.0)
Requirement already satisfied: attrs>=19.2.0 in /home/hayden.whitfield/.local/lib/python2.7/site-packages (from twisted==20.3.0) (21.4.0)
Requirement already satisfied: incremental>=16.10.1 in /usr/lib/python2.7 (from twisted==20.3.0) (21.3.0)
Requirement already satisfied: zope.interface>=4.4.2 in /usr/lib/python2.7 (from twisted==20.3.0) (5.4.0)
Requirement already satisfied: PyHamcrest!=1.10.0,>=1.9.0 in /home/hayden.whitfield/.local/lib/python2.7/site-packages (from twisted==20.3.0) (1.10.1)
Requirement already satisfied: constantly>=15.1 in /usr/lib/python2.7 (from twisted==20.3.0) (15.1.0)
Requirement already satisfied: six in /home/hayden.whitfield/.local/lib/python2.7/site-packages (from Automat>=0.3.0->twisted==20.3.0) (1.16.0)
Requirement already satisfied: typing; python_version < "3.5" in /home/hayden.whitfield/.local/lib/python2.7/site-packages (from hyperlink>=17.1.1->twisted==20.3.0) (3.10.0.0)
Requirement already satisfied: idna>=2.5 in /home/hayden.whitfield/.local/lib/python2.7/site-packages (from hyperlink>=17.1.1->twisted==20.3.0) (2.10)
Requirement already satisfied: setuptools in /home/hayden.whitfield/.local/lib/python2.7/site-packages (from zope.interface>=4.4.2->twisted==20.3.0) (44.1.1)
Installing collected packages: twisted
  WARNING: The scripts cftp, ckeygen, conch, mailmail, pyhtmlizer, tkconch, trial, twist and twistd are installed in '/home/hayden.whitfield/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed twisted-20.3.0


hayden.whitfield@ip-172-31-15-127:/opt/DMRlink$ python ./dmrlink.py
Traceback (most recent call last):
  File "./dmrlink.py", line 42, in <module>
    from twisted.internet.protocol import DatagramProtocol, Factory, Protocol
  File "/usr/lib/python2.7/twisted/internet/protocol.py", line 33
    protocol: "Optional[Callable[[], Protocol]]" = None
            ^
SyntaxError: invalid syntax



On Sep 13, 2022, at 8:07 PM, Hayden <hwhitfield2@...> wrote:

I can’t seem to uninstall twisted to remove it from python3, I am just going to try a Debian9 build to see if I can get it to run correctly...

On Sep 13, 2022, at 7:34 PM, Chris Whitam <cwhitam@...> wrote:

Do you have twisted installed for python, or just for python3?  It appears the python program is calling for twisted within python2.7, but your pip install is showing twisted installed in python3.9.  

On Tue, Sep 13, 2022 at 8:00 PM Hayden - KK7HXF <hwhitfield2@...> wrote:
<dummyfile.0.part>
Hopefully this helps.