Skip to content

TypeError: 'type' object is not subscriptable when loading plugins #18

@Cassius0924

Description

@Cassius0924

I'm encountering an issue when trying to run :UpdateRemotePlugins with LunarVim. Here's the error message I'm getting:

Encountered TypeError loading plugin at /root/.local/share/lunarvim/site/pack/lazy/opt/CopilotChat.nvim/rplugin/python3/copilot.py: 'type' object is not subscriptable
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pynvim/plugin/host.py", line 193, in _load
    module = _handle_import(directory, name)
  File "/usr/local/lib/python3.8/dist-packages/pynvim/plugin/host.py", line 40, in _handle_import
    return importlib.import_module(name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
TypeError: 'type' object is not subscriptable

Encountered TypeError loading plugin at /root/.local/share/lunarvim/site/pack/lazy/opt/CopilotChat.nvim/rplugin/python3/plugin.py: 'type' object is not subscriptable
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pynvim/plugin/host.py", line 193, in _load
    module = _handle_import(directory, name)
  File "/usr/local/lib/python3.8/dist-packages/pynvim/plugin/host.py", line 40, in _handle_import
    return importlib.import_module(name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
TypeError: 'type' object is not subscriptable

Encountered TypeError loading plugin at /root/.local/share/lunarvim/site/pack/lazy/opt/CopilotChat.nvim/rplugin/python3/utilities.py: 'type' object is not subscriptable
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pynvim/plugin/host.py", line 193, in _load
    module = _handle_import(directory, name)
  File "/usr/local/lib/python3.8/dist-packages/pynvim/plugin/host.py", line 40, in _handle_import
    return importlib.import_module(name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
TypeError: 'type' object is not subscriptable

remote/host: python3 host registered plugins []
remote/host: generated rplugin manifest: /root/.local/share/lvim/rplugin.vim

It seems like the error is happening when the plugin host tries to import the modules, but I'm not sure why. This error occurs for copilot.py, plugin.py, and utilities.py.

Here are the versions of my dependencies:

➜  ~ pip show python-dotenv requests pynvim prompt-toolkit
Name: python-dotenv
Version: 1.0.1
Summary: Read key-value pairs from a .env file and set them as environment variables
Home-page: https://github.com/theskumar/python-dotenv
Author: Saurabh Kumar
Author-email: me+github@saurabh-kumar.com
License: BSD-3-Clause
Location: /usr/local/lib/python3.8/dist-packages
Requires:
Required-by:
---
Name: requests
Version: 2.31.0
Summary: Python HTTP for Humans.
Home-page: https://requests.readthedocs.io
Author: Kenneth Reitz
Author-email: me@kennethreitz.org
License: Apache 2.0
Location: /usr/local/lib/python3.8/dist-packages
Requires: urllib3, certifi, idna, charset-normalizer
Required-by: undetected-chromedriver, g4f, cloud-init
---
Name: pynvim
Version: 0.5.0
Summary: Python client for Neovim
Home-page: http://github.com/neovim/pynvim
Author: Neovim Authors
Author-email: None
License: Apache
Location: /usr/local/lib/python3.8/dist-packages
Requires: msgpack, greenlet
Required-by:
---
Name: prompt-toolkit
Version: 3.0.43
Summary: Library for building powerful interactive command lines in Python
Home-page: https://github.com/prompt-toolkit/python-prompt-toolkit
Author: Jonathan Slenders
Author-email: None
License: None
Location: /usr/local/lib/python3.8/dist-packages
Requires: wcwidth
Required-by:

Any help in resolving this issue would be greatly appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions