2016-06-13 3 views
0

私はpython2.7python3.5をMacports経由でインストールしています。私はneovim取得しようとして実行し、このために私は/opt/local/Library/Frameworks/Python.framework/Versions/の異なるサブディレクトリにパッケージをインストールなぜpython35のインポートでpython27パッケージを読み込もうとしますか?

$ sudo pip2 install neovim 
$ sudo pip-3.5 install neovim 

を走っています。今度はPython 3.5を実行しているとき、import neovimはスタックトレースからわかるように、2.7パッケージをロードしようとします(失敗します)。

完全なエラーはこれです:私は私のシステムで平和的に共存する

$ python3.5 -c "import neovim" 
Traceback (most recent call last): 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/__init__.py", line 7, in <module> 
    from .uv import UvEventLoop 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/uv.py", line 5, in <module> 
    import pyuv 
ImportError: No module named 'pyuv' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/asyncio.py", line 19, in <module> 
    import asyncio 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/__init__.py", line 21, in <module> 
    from .base_events import * 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py", line 18, in <module> 
    import concurrent.futures 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/concurrent/futures/__init__.py", line 8, in <module> 
    from concurrent.futures._base import (FIRST_COMPLETED, 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/concurrent/futures/_base.py", line 357 
    raise type(self._exception), self._exception, self._traceback 
          ^
SyntaxError: invalid syntax 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/__init__.py", line 11, in <module> 
    from .msgpack_rpc import (ErrorResponse, child_session, socket_session, 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/__init__.py", line 8, in <module> 
    from .event_loop import EventLoop 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/__init__.py", line 12, in <module> 
    from .asyncio import AsyncioEventLoop 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/asyncio.py", line 22, in <module> 
    import trollius as asyncio 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/__init__.py", line 21, in <module> 
    from .base_events import * 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/base_events.py", line 39, in <module> 
    from . import coroutines 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/coroutines.py", line 16, in <module> 
    from . import futures 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/futures.py", line 19, in <module> 
    from . import executor 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/executor.py", line 12, in <module> 
    import concurrent.futures 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/concurrent/futures/__init__.py", line 8, in <module> 
    from concurrent.futures._base import (FIRST_COMPLETED, 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/concurrent/futures/_base.py", line 357 
    raise type(self._exception), self._exception, self._traceback 
          ^
SyntaxError: invalid syntax 

何をPythonの2.7ために行う必要があると3か?

+1

スタックトレースをポストできますか?これは奇妙な動作のように聞こえます。私はOS XマシンにPythonの複数のバージョン(一部はMacportsのもの)を平和的に共存させています。 –

+0

@MarkDickinson更新された質問を参照してください。 – oarfish

+2

〜/ .bashrcや〜/ .profileに 'PYTHONPATH'環境変数が設定されている可能性があります。 – mata

答えて

0

私は最近この問題も抱えていましたが、PYTHONPATHに関連するに関連するはありませんでした。これは私のマシンでは設定されていませんでした。私の状況では、PythonとpipがMacPorts経由でインストールされました。 MacPortsのクリーニング、自己更新を行い、最新のバージョンにpipを更新してから、次の問題を解決してください。

port select --set pip pip35 
関連する問題