Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylint install missing module named 'tomlkit' #1218

Closed
sth0 opened this issue Feb 16, 2025 · 6 comments
Closed

pylint install missing module named 'tomlkit' #1218

sth0 opened this issue Feb 16, 2025 · 6 comments

Comments

@sth0
Copy link
Contributor

sth0 commented Feb 16, 2025

After installing pylint-py310 it fails to run with the error:
ModuleNotFoundError: No module named 'tomlkit'

pylint.info does not have a dependency on toolkit. Will submit PR? Don't know if that dependency is needed for pylint-py-1.9.5.info or pylint-py-2.3.1.info any advice?

pylint does have a dependency on tomli-py. But not tomlkit-py.

I don't see the reason for special version checking for the dependency on typing-extensions-pyXX since it has an item for all allowed versions of python.

@dhomeier
Copy link
Contributor

I cannot reproduce this with the current version 2.14.5, successfully building and importing in Python 3.10.4. The tomlkit dependency seems to have been added sometime after 2.15 in pylint-dev/pylint#7450. How did you try to import or run this?

I don't see the reason for special version checking for the dependency on typing-extensions-pyXX since it has an item for all allowed versions of python.

It's not required with Python >= 3.10 since the functionality is already provided by the core library.

@nieder
Copy link
Member

nieder commented Feb 18, 2025

with tomlkit-py310 NOT installed:

nieder $ python3.10
Python 3.10.4 (main, Feb 18 2023, 04:48:29) [Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylint
>>> print(pylint.__version__)
2.14.5

Can you post your verbatim error?

@sth0
Copy link
Contributor Author

sth0 commented Feb 19, 2025

Well macOS 15.3.1 / Xcode 16.2 / Intel x86_64
If I purge tomlkit-py310 then I get the following missing module message.
If I add it back in, I get the version information as expected.

Password:
Scanning package description files..........
Information about 15356 packages read in 1 seconds.
WARNING: this command will remove the package(s) and remove any
         global configure files, even if you modified them!

Do you want to continue? [Y/n] 
Reading buildlock packages...
	All buildlocks accounted for.
/opt/sw/bin/dpkg-lockwait --purge tomlkit-py310
(Reading database ... 303407 files and directories currently installed.)
Removing tomlkit-py310 (0.13.2-1) ...
Processing triggers for dpkg-base-files (0.4-1) ...
Clearing dependency_libs of .la files in /opt/sw/lib ...

% pylint --version
Traceback (most recent call last):
  File "/opt/sw/bin/pylint", line 33, in <module>
    sys.exit(load_entry_point('pylint==2.14.5', 'console_scripts', 'pylint')())
  File "/opt/sw/lib/python3.10/site-packages/pylint/__init__.py", line 22, in run_pylint
    from pylint.lint import Run as PylintRun
  File "/opt/sw/lib/python3.10/site-packages/pylint/lint/__init__.py", line 19, in <module>
    from pylint.config.exceptions import ArgumentPreprocessingError
  File "/opt/sw/lib/python3.10/site-packages/pylint/config/__init__.py", line 25, in <module>
    from pylint.config.arguments_provider import UnsupportedAction
  File "/opt/sw/lib/python3.10/site-packages/pylint/config/arguments_provider.py", line 15, in <module>
    from pylint.config.arguments_manager import _ArgumentsManager
  File "/opt/sw/lib/python3.10/site-packages/pylint/config/arguments_manager.py", line 23, in <module>
    import tomlkit
ModuleNotFoundError: No module named 'tomlkit'

And then reinstalling tomlkit-py310 and running pylint again:

% fink install tomlkit-py310
Password:
Information about 15356 packages read in 1 seconds.
The package 'tomlkit-py310' will be installed.
Reading dependency for tomlkit-py310-0.13.2-1...
Reading runtime dependency for tomlkit-py310-0.13.2-1...
The following package will be installed or updated:
 tomlkit-py310
Reading buildlock packages...
	All buildlocks accounted for.
/opt/sw/bin/dpkg-lockwait -i /opt/sw/fink/dists/stable/main/binary-darwin-x86_64/libs/pythonmods/tomlkit-py310_0.13.2-1_darwin-x86_64.deb
Selecting previously unselected package tomlkit-py310.
(Reading database ... 303356 files and directories currently installed.)
Preparing to unpack .../tomlkit-py310_0.13.2-1_darwin-x86_64.deb ...
Unpacking tomlkit-py310 (0.13.2-1) ...
Setting up tomlkit-py310 (0.13.2-1) ...
Processing triggers for dpkg-base-files (0.4-1) ...
Clearing dependency_libs of .la files in /opt/sw/lib ...

% pylint --version
pylint 2.14.5
astroid 2.11.7
Python 3.10.4 (main, Nov  1 2024, 14:27:20) [Clang 16.0.0 (clang-1600.0.26.4)]

@nieder
Copy link
Member

nieder commented Feb 19, 2025

Interesting that tests don't catch that but the executable definitely seems to need it. Will fix and push. For now can just install tomlkit-py like you did.

@nieder nieder closed this as completed in 4f49ef4 Feb 19, 2025
@sth0
Copy link
Contributor Author

sth0 commented Feb 20, 2025

Actually I just did a local edit to the dot-info file, you want me to submit a PR or do want to just fix it as trivial?

@nieder
Copy link
Member

nieder commented Feb 20, 2025

fixed by 4f49ef4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants