← 输入框|github.com|刷新
Skip to content

ModuleNotFoundError: No module named 'tomli._parser' #1179

Open

Description

@eyalk11

I install it using vim-plug with all submodules . Relevant settings:

let g:python3_host_prog='C:\\Users\\ekarni\\.pyenv\\pyenv-win\\versions\\3.9\\python.exe'
let g:python_host_prog='C:\\Users\\ekarni\\.pyenv\\pyenv-win\\versions\\3.9\\python.exe'
let g:pymode=1
let g:pymode_rope = 1
let g:pymode_rope_autoimport =1

When trying PymodeRopeAutoImport I get:

Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'rope' is not defined

If I do py3 import rope

Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'rope' from 'rope' (C:\Users\ekarni\.vim\plugged\python-mode\submodules\rope\rope\__init__.py)

Notice that it is installed. Why it fails using it?

Activity

  1. eyalk11 commented on Jan 5, 2024

    @eyalk11
    Author

    OK, actually, this is the problem:

    "plugged\python-mode\pymode\rope.py" 985 lines --29%--
    Error detected while processing C:\Users\ekarni\.vim\plugged\python-mode\autoload\pymode\rope.vim[7]..function provider#python3#Call:
    line   18:
    Error invoking 'python_execute' on channel 3 (python3-script-host):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\ekarni\.vim\plugged\python-mode\pymode\rope.py", line 8, in <module>
        from rope.base import project, libutils, exceptions, change, worder, pycore, codeanalyze
      File "C:\Users\ekarni\.vim\plugged\python-mode\submodules\rope\rope\base\project.py", line 17, in <module>
        from rope.base.prefs import Prefs, get_config  # type:ignore
      File "C:\Users\ekarni\.vim\plugged\python-mode\submodules\rope\rope\base\prefs.py", line 9, in <module>
        from pytoolconfig import PyToolConfig, UniversalKey, field
      File "C:\Users\ekarni\.vim\plugged\python-mode\submodules\pytoolconfig\pytoolconfig\__init__.py", line 7, in <module>
        from .pytoolconfig import PyToolConfig
      File "C:\Users\ekarni\.vim\plugged\python-mode\submodules\pytoolconfig\pytoolconfig\pytoolconfig.py", line 10, in <module>
        from pytoolconfig.sources import PyProject, PyTool, Source
      File "C:\Users\ekarni\.vim\plugged\python-mode\submodules\pytoolconfig\pytoolconfig\sources\__init__.py", line 4, in <module>
        from .pyproject import PyProject
      File "C:\Users\ekarni\.vim\plugged\python-mode\submodules\pytoolconfig\pytoolconfig\sources\pyproject.py", line 19, in <module>
        import tomli as tomllib
      File "C:\Users\ekarni\.vim\plugged\python-mode\pymode\libs\tomli\__init__.py", line 8, in <module>
        from ._parser import TOMLDecodeError, load, loads
    ModuleNotFoundError: No module named 'tomli._parser'
    
    

    Something with the relative import

  2. changed the title [-]NameError: name 'rope' is not defined[/-] [+]ModuleNotFoundError: No module named 'tomli._parser'[/+] on Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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