姚万超
姚万超

Reputation: 41

vim: symbol lookup error: vim: undefined symbol: PyUnicodeUCS4_AsEncodedString

Today I encountered a problem about vim:

vim: symbol lookup error: vim: undefined symbol: PyUnicodeUCS4_AsEncodedString

I didn't install any vim plugins. But I installed some Python projects(Nginx, uwsgi). Seemingly after these installations, vim crushed.

Any clues?

Upvotes: 3

Views: 9621

Answers (4)

venky513
venky513

Reputation: 321

the problem can also occur when you point the library path to another path BY exporting to environment mentioning in .bash.rc . Probably can happen when you are changing the paths for oracle installations. So correct your Paths so that vim would be pointing to the correct lib path

Upvotes: 1

DryLabRebel
DryLabRebel

Reputation: 10183

This might not directly answer the question, but I had the same problem when loading anaconda and found that invoking vi, instead of vim worked. Since I'm guessing that vi is symlinked to vim because syntax highlighting worked and my ~/.vimrc commands all work as expected.

It's a simple and inelegant option, but perhaps this might work for others too.

Upvotes: 2

Romapecker
Romapecker

Reputation: 41

I have encountered the same problem. Here is my solution.

Type in terminal

ldd /usr/bin/vim

it showed that the python lib pointing to a location customized by me.

libpython2.7.so.1.0 => /home/ql/software/vtk/vtkpython-7.0.0-Linux-64bit/lib/libpython2.7.so.1.0 (0x00007f303b99c000)

I opened my .bashrc, finding something related to the above line:

export LD_LIBRARY_PATH=/home/ql/software/vtk/vtkpython-7.0.0-Linux-64bit/lib:$LD_LIBRARY_PATH

Then I commented the above line out.

Open a new terminal and type again:

ldd /usr/bin/vim

It can be noticed that the python lib points to some location other than that in the previous result:

libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007f1ed4a36000)

Now vim runs.

Upvotes: 4

Yash Mehrotra
Yash Mehrotra

Reputation: 3120

This may happen if you are using a different python version in your machine compared to the one vim is compiled in.

For eg. If you are in a virtualenv, try deactivating it and then use vim.

Upvotes: 1

Related Questions