Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    dsf-python: type object is not subscriptable?

    Scheduled Pinned Locked Moved Solved
    Plugins for DWC and DSF
    4
    6
    421
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • aleohlundefined
      aleohl
      last edited by aleohl

      Hello,

      I'm trying to run the example custom_m_codes.py found in the github repo for dsf-python.
      However I'm running into this issue so the example is obviously not up to date.
      Any idea how to fix it?

      Traceback (most recent call last):
        File "custom_m_codes.py", line 11, in <module>
          from dsf.connections import InterceptConnection, InterceptionMode
        File "/usr/local/lib/python3.7/dist-packages/dsf/__init__.py", line 10, in <module>
          from . import commands, connections, http, object_model
        File "/usr/local/lib/python3.7/dist-packages/dsf/connections/__init__.py", line 47, in <module>
          from .base_command_connection import BaseCommandConnection
        File "/usr/local/lib/python3.7/dist-packages/dsf/connections/base_command_connection.py", line 3, in <module>
          from .base_connection import BaseConnection
        File "/usr/local/lib/python3.7/dist-packages/dsf/connections/base_connection.py", line 6, in <module>
          from .init_messages import client_init_messages, server_init_message
        File "/usr/local/lib/python3.7/dist-packages/dsf/connections/init_messages/__init__.py", line 1, in <module>
          from . import client_init_messages, server_init_message
        File "/usr/local/lib/python3.7/dist-packages/dsf/connections/init_messages/client_init_messages.py", line 43, in <module>
          auto_flush: bool = True):
      TypeError: 'type' object is not subscriptable
      

      Edit: This also effects DSF_ExecOnMcode_Plugin. Same error.

      droftartsundefined 1 Reply Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @aleohl
        last edited by

        @aleohl One for @chrishamm to check, I think!

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        chrishammundefined 1 Reply Last reply Reply Quote 0
        • chrishammundefined
          chrishamm administrators @droftarts
          last edited by

          @droftarts Not quite, rather one for @Falcounet.

          Duet software engineer

          1 Reply Last reply Reply Quote 2
          • Falcounetundefined
            Falcounet
            last edited by Falcounet

            The problem is that your are using an old version of Python.
            I know 3.7 is the latest version available on Debian Buster on which the DuetPi image is based on ...
            I will see if I can change the code of dsf-python to stay compatible with the 3.7 version of Python.

            1 Reply Last reply Reply Quote 0
            • Falcounetundefined
              Falcounet
              last edited by Falcounet

              @aleohl I released a new version which fixes that issues so dsf-python still works with Python 3.7
              Please let me know if you run it others problems.

              1 Reply Last reply Reply Quote 2
              • aleohlundefined
                aleohl
                last edited by

                @Falcounet Seems to be working! Thanks for fixing it.

                1 Reply Last reply Reply Quote 1
                • droftartsundefined droftarts marked this topic as a question
                • droftartsundefined droftarts has marked this topic as solved
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA