私は、vim、mac os x、virtualenv、および zsh を使用して Python を開発しています。
しかし、virtualenvを使用して環境を作成し、pythonパッケージをインストールしてコマンドラインpip install fabric
で実行した後、非常に奇妙なことがわかりました。fab
それはうまくいきます。
次に、vim を開いて で実行するfab
と:!fab
、次のエラーが表示されます。
Traceback (most recent call last): │ * Restarting with reloader
File "/usr/local/bin/fab", line 5, in <module> │ * Detected change in '/Users/ccheng/workspace/rms-rest/rms/account.py', reloading
from pkg_resources import load_entry_point │ * Restarting with reloader
File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 2793, in <module> │ * Detected change in '/Users/ccheng/workspace/rms-rest/rms/account.py', reloading
│ * Restarting with reloader
File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 673, in require │ * Detected change in '/Users/ccheng/workspace/rms-rest/rms/rms.py', reloading
def subscribe(self, callback): │ * Restarting with reloader
File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 576, in resolve │ * Detected change in '/Users/ccheng/workspace/rms-rest/rms/rms.py', reloading
plugin_env, full_env=None, installer=None, fallback=True │ * Restarting with reloader
pkg_resources.DistributionNotFound: Fabric==1.8.0 │ * Detected change in 'run.py', reloading
│ * Restarting with reloader
shell returned 1
python path
vimを開いたときに一部の変数がリセットされたため、virtualenvにインストールされているパッケージが見つからないことが原因だと思います。