2016-08-18 4 views
2

私はvimの中でYouCompleteMeプラグインを使用しようとすると、私は次のエラーを取得する:エラー:「YouCompleteMeが使用できない:このパッケージには、Python 3にアクセスできないようにしてください」

YouCompleteMe unavailable: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted

しかし、私は、自分の仮想環境内でvimを開くときにだけこのエラーが発生します。 virtualenvがアクティブでないときはうまく動作します。私の推測では、YouCompleteMeはPython 2で書かれていますが、なんらかの理由でPython2インタプリタが仮想環境内から見えないのですが、修正方法がわかりません。件名にStack Overflowの問題はないようですが、同様の問題がycm-users Google Groupで発生し、未回答になりました。

私はUbuntu 14.04でvim version 7.4を使用しています。

答えて

1

それはバグで次のようになります。

https://github.com/Valloric/ycmd/pull/578

In PR #448, I made the assumption that the site-packages paths are always placed after the standard library path so that if we insert the python-future module just before the first site-packages path, it would necessary be after the standard library. Turns out that it is not true when a site-packages path is added to the PYTHONPATH environment variable, e.g, when using the software ROS. See issue Valloric/YouCompleteMe#2186. When this happens, the python-future module will raise the following exception on Python 3:

ImportError: This package should not be accessible on Python 3. 
Either you are trying to run from the python-future src folder or 
your installation of python-future is corrupted. 

We prevent this by looking for the standard library path in sys.path and by inserting the python-future module just after it. If we can't find it, we raise an exception since YCM and ycmd cannot work without it.

Fixes Valloric/YouCompleteMe#2186

上記プル要求と合併し、あなたは修正することができるはずです更新プログラムを取得するか、まだリポジトリを複製していない場合は複製して再インストールして問題を解決します。

+0

ああ、私は数日前にその問題を見ましたが、問題を解決した最後の日にコミットがあったようです。私はそれを撃つだろう。ありがとう! –

0

virtualenvの中でpython 3を使用しているかのように聞こえます。限りVIMに関しては、あなたがYCM

https://github.com/Valloric/YouCompleteMe/issues/1140

でサポートされていないのpython 3を実行している回避策は、あなたのvirtualenvの外からちょうどオープンのvimになり

+0

私は同じgithub問題に出くわしました。しかし、それは2014年のことであり、YouCompleteMeの[readme](https://github.com/Valloric/YouCompleteMe)から、現在Python 3をサポートしているように見えます。 YouCompleteMe自体には問題があるとは思えません。それはvirtualenvの使用に結びついています。私はvirtulenvの外でvimを開くことができましたが、YouCompleteMeは使用しているライブラリのどれも見ることができません。これは目的を破ります。私はPythonファイルでYCMを無効にして、jedi-vimを代わりに使用できるかどうかを確認できたと思います。 –

関連する問題