Repository navigation
lint.vim could not work... #1166
Description
[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
Activity
genuiner commentedon Mar 27, 2023
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Mar 3 2023 17:34:51)
Included patches: 1-1341
Compiled by lya@lya.sf-express.com
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 commentedon 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 commentedon 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 commentedon May 7, 2023
I have the same question
trysten commentedon May 16, 2023
I think problem is with your python distribution. Get an up to date distribution and try again.
diraol commentedon 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 commentedon Aug 7, 2023
I'm getting similar errors:
I've been running Ubuntu 23.04 for months now but just started hitting this error today. Looks like the
pkg_resourcesis missing. Python 3.11 is default on 23.04.moorepants commentedon Aug 7, 2023
This runs with no error:
$ /usr/bin/python3 -c "import pkg_resources", so maybe vim is using a different Python.moorepants commentedon 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 commentedon Sep 6, 2023
Same here. I'm on a mac m2, with python and vim managed by homebrew. python is python@3.11 (v 3.11.5) and vim is build against same python.
Any ideas?!
DNSGeek commentedon Oct 13, 2023
"pip3 install setuptools" fixed the issue for me.
patroqueeet commentedon Dec 13, 2023
for me vim came with py3.12 compiled and 3.11 installed in parallel.
PIP_BREAK_SYSTEM_PACKAGES=1 pip3.12 install setuptoolswas the solution for me although 3.11 was configured as pymode interpreterneilrieck commentedon Apr 4, 2024
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 commentedon May 25, 2024
I fixed this by cloning setuptools into the
submodulesdirectory and then symlinking apkg_resourcesin thelibsdirectory to the one insubmodules/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.neilrieck commentedon 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 commentedon 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.
moorepants commentedon 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 commentedon May 25, 2024
Some more notes for reference. python-mode uses my
/home/<user>/miniconda/bin/python3which is the the python that I have setup for interactive use in my.bashrc(instead of/usr/bin/python3from Ubuntu 24.04). If I open vim (apt installed) and execute:I get:
But if I do:
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 commentedon Jun 9, 2025
Can it be fixed without setuptools? Because setuptools is deprecated and is going away in November
diraol commentedon 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