Difficulty with python while installing YouCompleteMe in vim
<p>I've followed <a href="https://github.com/Valloric/YouCompleteMe/tree/ddf18cc6ec3bb0108bb89ac366fd74394815f2c6#ubuntu-linux-x64" rel="nofollow">these instructions</a>, in order to install YouCompleteMe in Vim, but when I issue:</p>

<pre><code>./install.py --clang-completer
</code></pre>

<p>The following error message comes up:</p>

<pre><code>Searching Python 2.7 libraries...
ERROR: found static Python library (/usr/local/lib/python2.7/config/libpython2.7.a) but a dynamic one is required. You must use a Python compiled with the --enable-shared flag. If using pyenv, you need to run the command:
  export PYTHON_CONFIGURE_OPTS="--enable-shared"
before installing a Python version.
Traceback (most recent call last):
  File "./install.py", line 44, in &lt;module&gt;
    Main()
  File "./install.py", line 33, in Main
    subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
  File "/usr/local/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/bin/python', u'/home/anmol/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py', '--clang-completer']' returned non-zero exit status 1
</code></pre>

<p>and now I'm stuck, what should I do?</p>

<p>The plugin builds for me on the same operating system. The relevant line from the configuration looks like this:</p>

<pre><code>Found PythonLibs: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
</code></pre>

<p>The shared object can be identified as belonging to <code>libpython2.7</code> package:</p>

<pre><code>apt-file search /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
libpython2.7: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
</code></pre>

<p>So I would check if you have the file named, if not try <code>sudo apt install libpython2.7</code>, and otherwise try moving away the static version, or let us know how you installed Python.</p>

python linux python-2.7 ubuntu vim