执行 ./certbot-auto 时提示 File “/usr/bin/virtualenv”, line 2, in module

[root@hexingxing certbot]# ./certbot-auto 
Bootstrapping dependencies for RedHat-based OSes... (you can skip this with --no-bootstrap)
yum is /usr/bin/yum
yum is hashed (/usr/bin/yum)
Loaded plugins: fastestmirror
Setting up Install Process
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Package gcc-4.4.7-18.el6.x86_64 already installed and latest version
Package augeas-libs-1.0.0-10.el6.x86_64 already installed and latest version
Package openssl-1.0.1e-57.el6.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-57.el6.x86_64 already installed and latest version
Package libffi-devel-3.0.5-3.2.el6.x86_64 already installed and latest version
Package redhat-rpm-config-9.0.3-51.el6.centos.noarch already installed and latest version
Package ca-certificates-2017.2.14-65.0.1.el6_9.noarch already installed and latest version
Package python-devel-2.6.6-66.el6_8.x86_64 already installed and latest version
Package python-virtualenv-12.0.7-1.el6.noarch already installed and latest version
Package python-tools-2.6.6-66.el6_8.x86_64 already installed and latest version
Package python-pip-7.1.0-1.el6.noarch already installed and latest version
Package 1:mod_ssl-2.2.15-60.el6.centos.6.x86_64 already installed and latest version
Nothing to do
Creating virtual environment...
Traceback (most recent call last):
  File "/usr/bin/virtualenv", line 2, in module
    import virtualenv
ImportError: No module named virtualenv
[root@hexingxing certbot]# vi /usr/bin/virtualenv 
#!/usr/bin/python2  ##添加 pythone 版本,修改为 #!/usr/bin/python2.6.6
import virtualenv
virtualenv.main()
[root@hexingxing certbot]# cat /usr/bin/virtualenv 
#!/usr/bin/python2.6.6
import virtualenv
virtualenv.main()

出现这个错误,是因为 python 执行版本与本地版本不一致,修改完以后即可修复该报错。

0 条评论

昵称

沙发空缺中,还不快抢~