virtualenv错误检查版本

时间:2014-07-09 19:11:21

标签: pip virtualenv

$  virtualenv --versionTraceback (most recent call last):
  File "/home/rohit/bin/virtualenv", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/home/rohit/.local/lib/python2.7/site-packages/pkg_resources.py", line 3011, in <module>

  File "/home/rohit/.local/lib/python2.7/site-packages/pkg_resources.py", line 626, in resolve

pkg_resources.DistributionNotFound: virtualenv==1.9.1

1 个答案:

答案 0 :(得分:0)

我在Google网上找到了解决方案。

似乎/ usr / local / bin / virtualenv未更新,因此当您打开它时,您会在系统上安装较新版本时看到对旧版virtualenv 1.9.1的引用。

所以,你只需要打开/ usr / local / bin / virtualenv并将其替换为:

#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from virtualenv import main

if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

这对我有用!

来源:https://groups.google.com/forum/#!topic/python-virtualenv/hL_QDPJsnuY