[英]I can't execute command inside vim but it can be executed in shell?
我使用vim,mac os x,virtualenv和zsh開發python。
但是我發現一個很奇怪的事情,就是在我使用virtualenv創建環境並使用pip install fabric
安裝python軟件包並在命令行中執行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
我認為這是由於我打開vim時引起的,一些python path
變量已被重置,因此我找不到安裝在virtualenv中的軟件包。
我通過在終端配置中設置默認外殼來解決此問題。 我不知道這和使用'chsh'設置默認外殼之間有什么區別,但是它可以工作。 感謝大家。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.