Skip to main content
added 510 characters in body
Source Link

I too struck this issue after updating from Jessie to Stretch.

As noted in another answer, installing vim-nox should resolve this issue (as vim-nox in Stretch is compiled against python2). However, I figured that python3 is the way of the future. So I decided to fix it another way. 

If you need Python2 support, thisinstalling vim-nox is probably the best method. Note that if you needstill have vim installed, that will continue to completely remove allbe the default "vim" on your system. If you wish to make vim-nox packages first!default you need to do one of the following:

  • completely remove vim; or
  • use update-alternatives to set vim-nox as default "vim"; or
  • just explicitly launch vim-nox, i.e.: vim.nox <filename>.

I fixed mine by tweaking my existing .vim plugin files. All that needs changing is swap out pyfile command for py3file:

for file in /home/user/.vim/bundle/custom/plugin/*.vim; do
    sed -i "s|pyfile|py3file|" $file
done

(obviously my username is user!:)

That solved most of the issues, but one of my .py plugins then starting giving some different (python3) errors:

Error detected while processing /home/user/.vim/bundle/custom/plugin/rst.vim:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.vim/bundle/custom/plugin/rst.py", line 100
    vim.command("let b:nestings = " + `self.nestings`)
                                      ^
SyntaxError: invalid syntax

So I used the 2to3 python tool to update that particular script to python3:

2to3 -w /home/user/.vim/bundle/custom/plugin/rst.py

All fixed! :)

I too struck this issue after updating from Jessie to Stretch.

As noted in another answer, installing vim-nox should resolve this issue (as vim-nox in Stretch is compiled against python2). However, I figured that python3 is the way of the future. So I decided to fix it another way. If you need Python2 support, this is probably the best method. Note you need to completely remove all vim packages first!

I fixed mine by tweaking my existing .vim files. All that needs changing is swap out pyfile command for py3file:

for file in /home/user/.vim/bundle/custom/plugin/*.vim; do
    sed -i "s|pyfile|py3file|" $file
done

(obviously my username is user!:)

That solved most of the issues, but one of my .py plugins then starting giving some different (python3) errors:

Error detected while processing /home/user/.vim/bundle/custom/plugin/rst.vim:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.vim/bundle/custom/plugin/rst.py", line 100
    vim.command("let b:nestings = " + `self.nestings`)
                                      ^
SyntaxError: invalid syntax

So I used the 2to3 python tool to update that particular script to python3:

2to3 -w /home/user/.vim/bundle/custom/plugin/rst.py

All fixed! :)

I too struck this issue after updating from Jessie to Stretch.

As noted in another answer, installing vim-nox should resolve this issue (as vim-nox in Stretch is compiled against python2). However, I figured that python3 is the way of the future. So I decided to fix it another way. 

If you need Python2 support, installing vim-nox is probably the best method. Note that if you still have vim installed, that will continue to be the default "vim" on your system. If you wish to make vim-nox default you need to do one of the following:

  • completely remove vim; or
  • use update-alternatives to set vim-nox as default "vim"; or
  • just explicitly launch vim-nox, i.e.: vim.nox <filename>.

I fixed mine by tweaking my existing .vim plugin files. All that needs changing is swap out pyfile command for py3file:

for file in /home/user/.vim/bundle/custom/plugin/*.vim; do
    sed -i "s|pyfile|py3file|" $file
done

(obviously my username is user!:)

That solved most of the issues, but one of my .py plugins then starting giving some different (python3) errors:

Error detected while processing /home/user/.vim/bundle/custom/plugin/rst.vim:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.vim/bundle/custom/plugin/rst.py", line 100
    vim.command("let b:nestings = " + `self.nestings`)
                                      ^
SyntaxError: invalid syntax

So I used the 2to3 python tool to update that particular script to python3:

2to3 -w /home/user/.vim/bundle/custom/plugin/rst.py

All fixed! :)

added 510 characters in body
Source Link

I too struck this issue after updating from Jessie to Stretch.

As noted in another answer, installing vim-nox should resolve this issue (as vim-nox in Stretch is compiled against python2). However, I fixedfigured that python3 is the way of the future. So I decided to fix it another way. If you need Python2 support, this is probably the best method. Note you need to completely remove all vim packages first!

I fixed mine by tweaking my existing .vim files,. All that needs changing is swap out pyfile command tofor py3file:

for file in /home/user/.vim/bundle/custom/plugin/*.vim; do
    sed -i "s|pyfile|py3file|" $file
done

(obviously my username is user!:)

That solved most of the issues, but one of my .py plugins then starting giving some different (python3) errors:

Error detected while processing /home/user/.vim/bundle/custom/plugin/rst.vim:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.vim/bundle/custom/plugin/rst.py", line 100
    vim.command("let b:nestings = " + `self.nestings`)
                                      ^
SyntaxError: invalid syntax

So I used the 2to3 python tool to update that particular script to python3:

2to3 -w /home/user/.vim/bundle/custom/plugin/rst.py

All fixed! :)

I too struck this issue after updating to Stretch. I fixed it by tweaking my existing .vim files, changing pyfile command to py3file:

for file in /home/user/.vim/bundle/custom/plugin/*.vim; do
    sed -i "s|pyfile|py3file|" $file
done

(obviously my username is user!:)

That solved most of the issues, but one of my .py plugins then starting giving some different (python3) errors:

Error detected while processing /home/user/.vim/bundle/custom/plugin/rst.vim:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.vim/bundle/custom/plugin/rst.py", line 100
    vim.command("let b:nestings = " + `self.nestings`)
                                      ^
SyntaxError: invalid syntax

So I used the 2to3 python tool to update that particular script to python3:

2to3 -w /home/user/.vim/bundle/custom/plugin/rst.py

All fixed! :)

I too struck this issue after updating from Jessie to Stretch.

As noted in another answer, installing vim-nox should resolve this issue (as vim-nox in Stretch is compiled against python2). However, I figured that python3 is the way of the future. So I decided to fix it another way. If you need Python2 support, this is probably the best method. Note you need to completely remove all vim packages first!

I fixed mine by tweaking my existing .vim files. All that needs changing is swap out pyfile command for py3file:

for file in /home/user/.vim/bundle/custom/plugin/*.vim; do
    sed -i "s|pyfile|py3file|" $file
done

(obviously my username is user!:)

That solved most of the issues, but one of my .py plugins then starting giving some different (python3) errors:

Error detected while processing /home/user/.vim/bundle/custom/plugin/rst.vim:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.vim/bundle/custom/plugin/rst.py", line 100
    vim.command("let b:nestings = " + `self.nestings`)
                                      ^
SyntaxError: invalid syntax

So I used the 2to3 python tool to update that particular script to python3:

2to3 -w /home/user/.vim/bundle/custom/plugin/rst.py

All fixed! :)

Source Link

I too struck this issue after updating to Stretch. I fixed it by tweaking my existing .vim files, changing pyfile command to py3file:

for file in /home/user/.vim/bundle/custom/plugin/*.vim; do
    sed -i "s|pyfile|py3file|" $file
done

(obviously my username is user!:)

That solved most of the issues, but one of my .py plugins then starting giving some different (python3) errors:

Error detected while processing /home/user/.vim/bundle/custom/plugin/rst.vim:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.vim/bundle/custom/plugin/rst.py", line 100
    vim.command("let b:nestings = " + `self.nestings`)
                                      ^
SyntaxError: invalid syntax

So I used the 2to3 python tool to update that particular script to python3:

2to3 -w /home/user/.vim/bundle/custom/plugin/rst.py

All fixed! :)