GeezerVison is showing github.com — lint.vim could not work... · Issue #1166 · python-mode/python-mode
lint.vim could not work... #1166Description[Pymode] Activate virtualenv: /home/lya/pythonworks/pyvenv
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
File "", line 1, in
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
File "/home/lya/.vim/plugged/python-mode/pymode/lint.py", line 9, in
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
from pylama.lint.extensions import LINTERS
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
File "/home/lya/.vim/plugged/python-mode/pymode/libs/pylama/lint/extensions.py", line 56, in
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
from pkg_resources import iter_entry_points
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
File "/home/lya/pythonworks/pyvenv/lib/python3.7/site-packages/pkg_resources/init.py", line 26, in
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
import zipfile
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
File "/usr/local/python3.7.16/lib/python3.7/zipfile.py", line 13, in
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
import struct
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
File "/usr/local/python3.7.16/lib/python3.7/struct.py", line 13, in
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
from _struct import *
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/lya/.vim/plugged/python-mode/autoload/pymode/lint.vim:
line 1:
ImportError: /usr/local/python3.7.16/lib/python3.7/lib-dynload/_struct.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyByteArray_Type
Press ENTER or type command to continue Activitygenuiner commented on Mar 27, 2023 VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Mar 3 2023 17:34:51)
Included patches: 1-1341
Compiled by [email protected]
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_urxvt -tag_any_white
+arabic +find_in_path +mouse_xterm -tcl
+autocmd +float +multi_byte +termguicolors
+autochdir +folding +multi_lang +terminal
-autoservername -footer -mzscheme +terminfo
-balloon_eval +fork() +netbeans_intg +termresponse
+balloon_eval_term +gettext +num64 +textobjects
-browse -hangul_input +packages +textprop
++builtin_terms +iconv +path_extra +timers
+byte_offset +insert_expand -perl +title
+channel +ipv6 +persistent_undo -toolbar
+cindent +job +popupwin +user_commands
-clientserver +jumplist +postscript +vartabs
-clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +vim9script
+cmdline_hist +langmap -python +viminfo
+cmdline_info +libcall +python3 +virtualedit
+comments +linebreak +quickfix +visual
+conceal +lispindent +reltime +visualextra
+cryptv +listcmds +rightleft +vreplace
+cscope +localmap -ruby +wildignore
+cursorbind -lua +scrollbind +wildmenu
+cursorshape +menu +signs +windows
+dialog_con +mksession +smartindent +writebackup
+diff +modify_fname -sodium -X11
+digraphs +mouse -sound -xfontset
-dnd -mouseshape +spell -xim
-ebcdic +mouse_dec +startuptime -xpm
+emacs_tags -mouse_gpm +statusline -xsmp
+eval -mouse_jsbterm -sun_workshop -xterm_clipboard
+ex_extra +mouse_netterm +syntax -xterm_save
+extra_search +mouse_sgr +tag_binary
-farsi -mouse_sysmouse -tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/VIM/share/vim"
Compilation: gcc -std=gnu99 -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -std=gnu99 -L/usr/local/lib -Wl,--as-needed -o vim -lm -ltinfo -lrt -ldl -L/usr/local/python3.7.16/lib/python3.7/config-3.7m-x86_64-linux-gnu -lpython3.7m -lcrypt -lpthread -ldl -lutil -lm genuiner commented on Mar 27, 2023 [lya@lya submodules]$ pwd
/home/lya/.vim/plugged/python-mode/submodules
[lya@lya submodules]$ ll
total 36
drwxrwxr-x. 3 lya lya 244 Mar 26 10:30 appdirs
drwxrwxr-x. 6 lya lya 4096 Mar 26 10:31 astroid
drwxrwxr-x. 5 lya lya 4096 Mar 26 10:31 autopep8
drwxrwxr-x. 2 lya lya 194 Mar 26 10:31 mccabe
drwxrwxr-x. 5 lya lya 4096 Mar 26 10:31 pycodestyle
drwxrwxr-x. 6 lya lya 4096 Mar 26 10:31 pydocstyle
drwxrwxr-x. 5 lya lya 209 Mar 26 10:31 pyflakes
drwxrwxr-x. 5 lya lya 4096 Mar 26 10:31 pylama
drwxrwxr-x. 9 lya lya 4096 Mar 26 10:32 pylint
drwxrwxr-x. 6 lya lya 221 Mar 26 10:32 pytoolconfig
drwxrwxr-x. 7 lya lya 4096 Mar 26 10:32 rope
drwxrwxr-x. 4 lya lya 178 Mar 26 10:32 snowball_py
drwxrwxr-x. 5 lya lya 4096 Mar 26 10:33 toml
drwxrwxr-x. 8 lya lya 4096 Mar 26 10:33 tomli
[lya@lya submodules]$ ll pylama/pylama/lint/extensions.py
-rw-rw-r--. 1 lya lya 1360 Mar 26 10:31 pylama/pylama/lint/extensions.py genuiner commented on Mar 27, 2023 79 Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
80 Plug 'junegunn/fzf.vim'
use vim-plug to get all files and modules, but get erros when open any py files.
I try to delete python-mode folder, then git clone --recurse-submodules https://github.com/python-mode/python-mode.git, but there were errors like above, who can help me, thanks. Lee-zifei commented on May 7, 2023 trysten commented on May 16, 2023 diraol commented on Jun 27, 2023 Yeah, this seems to be related to your python setup. Our CI is testing python 3.8 and 3.9, not 3.7, so I can't ensure it will work with pyhton 3.7. moorepants commented on Aug 7, 2023 I'm getting similar errors:
"examples/bicep_curl.py" 94L, 2585B
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/moorepants/.vim/bundle/python-mode/aut
oload/pymode/lint.vim:
line 1:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/moorepants/.vim/bundle/python-mode/aut
oload/pymode/lint.vim:
line 1:
File "<string>", line 1, in <module>
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/moorepants/.vim/bundle/python-mode/aut
oload/pymode/lint.vim:
line 1:
File "/home/moorepants/.vim/bundle/python-mode/pymode/lint.py", line 9, in <module>
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/moorepants/.vim/bundle/python-mode/aut
oload/pymode/lint.vim:
line 1:
from pylama.lint import LINTERS
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/moorepants/.vim/bundle/python-mode/aut
oload/pymode/lint.vim:
line 1:
File "/home/moorepants/.vim/bundle/python-mode/pymode/libs/pylama/lint/__init__.py", line 10, in <module>
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/moorepants/.vim/bundle/python-mode/aut
oload/pymode/lint.vim:
line 1:
from pkg_resources import iter_entry_points
Press ENTER or type command to continue
Error detected while processing CursorMoved Autocommands for "<buffer=1>"..script /home/moorepants/.vim/bundle/python-mode/aut
oload/pymode/lint.vim:
line 1:
ModuleNotFoundError: No module named 'pkg_resources'
I've been running Ubuntu 23.04 for months now but just started hitting this error today. Looks like the pkg_resources is missing. Python 3.11 is default on 23.04. moorepants commented on Aug 7, 2023 This runs with no error: $ /usr/bin/python3 -c "import pkg_resources", so maybe vim is using a different Python. moorepants commented on Aug 7, 2023 I see that python-mode is picking up a python that I have on my bash path install of the system python. Does python-mode (I guess the linter it is calling) not use the Python vim was compiled with? robtaylor commented on Sep 6, 2023 Same here. I'm on a mac m2, with python and vim managed by homebrew. python is [email protected] (v 3.11.5) and vim is build against same python.
Any ideas?! DNSGeek commented on Oct 13, 2023 "pip3 install setuptools" fixed the issue for me. Reacted by Matt Keranen, Thijs, Brace and Matt Mullens patroqueeet commented on Dec 13, 2023
Same here. I'm on a mac m2, with python and vim managed by homebrew. python is [email protected] (v 3.11.5) and vim is build against same python.
Any ideas?!
for me vim came with py3.12 compiled and 3.11 installed in parallel. PIP_BREAK_SYSTEM_PACKAGES=1 pip3.12 install setuptools was the solution for me although 3.11 was configured as pymode interpreter Reacted by sideshowbarker, Gary Pennington, yitsehong and Quan Wang neilrieck commented on Apr 4, 2024
I think problem is with your python distribution. Get an up to date distribution and try again.
Update: I located the vim archive then reinstalled vim-8.2 but python-mode is still broken so my issue must have something to do with recent changes to python-mode. I should mention that I'm running CentOS-7 and python3.6.8 both which are very old. I'll be migrating to AlmaLinux-8 before June-2024 (which is the EOL of of CentOS-7). Moving from EL7 to EL8 means that the built-in based python will change from 2.7.5 to 3.6.8 (even though 3.6 is already past EOL) so I hope that the the good folks at python-mode haven't made changes which exclude 3.6 (so I am doing my own build of 3.9 so I can test further) moorepants commented on May 25, 2024 I fixed this by cloning setuptools into the submodules directory and then symlinking a pkg_resources in the libs directory to the one in submodules/setuptools/pkg_resources. This could probably be fixed by vendoring setuptools as a new submodule. It still isn't quite clear to me what python python-mode uses, as I checked the pythons I have installed on my system and they all have setuptools installed alongside them and pkg_resources imports. Reacted by Maxim Styushin neilrieck commented on May 25, 2024 I was moving from CentOS-7 (base: python2.7 optional: python3.6) to AlmaLinux-8 (base: python3.6 optional: python3.9). Out of frustration, I used rsync to copy my requisite subfolders (.vim/pack) from my old system to my new, and this worked for 36 as well as 39. Now obviously this method cannot be used by a newbie trying to setup python-mode for the first time. I worry that the maintainers of python-mode may be jumping the gun to have it work on newer pythons, like 3.12, which is not even available on slower moving Enterprise Linux platforms. (well, 3.12 is available on EL9 but not EL8. For that you would need to build your own) moorepants commented on May 25, 2024 Vendoring the dependencies in a way that tracks the tip of their git repositories with no mechanism to ensure the transitives dependencies are installed or up-to-date will be prone to breaking. Either you have to vendor all dependencies or use a package manager to ensure the dependencies are in order. Reacted by Trysten and hoshF moorepants commented on May 25, 2024 The other issue is that it seems that maintenance on pylama has stalled, so software rot is beginning on that package already. moorepants commented on May 25, 2024 Some more notes for reference. python-mode uses my /home/<user>/miniconda/bin/python3 which is the the python that I have setup for interactive use in my .bashrc (instead of /usr/bin/python3 from Ubuntu 24.04). If I open vim (apt installed) and execute:
:PymodePython import sys, os; print(sys.executable); import pkg_resources
I get:
/home/<user>/miniconda/bin/python3
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pkg_resources'
But if I do:
$ /home/<user>/miniconda/bin/python3 -c "import pkg_resources; print(pkg_resources.__file__)"
<string>:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
/home/<user>/miniconda/lib/python3.11/site-packages/pkg_resources/__init__.py
pkg_resources imports from setuptools being installed with that Python.
I don't understand why calling the same statement from inside vim would ignore the installed dependencies.
I would also expect python-mode to use my system python, not the one I have enabled in my .bashrc. wileycoyote commented on Jun 9, 2025 Can it be fixed without setuptools? Because setuptools is deprecated and is going away in November diraol commented on Jul 12, 2025 Hey folks, I'm trying to revive the project. But I do need help from the community.
I've opened a new issue for us to discuss next steps.
#1190 Reacted by Jason K. Moore
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|