求救呀, Let’s Encrypt 证书续期碰到"No module named virtualenv"问题? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
通过以下 Referral 链接购买 DigitalOcean 主机,你将可以帮助 V2EX 持续发展
DigitalOcean - SSD Cloud Servers
cpublic
V2EX    VPS

求救呀, Let’s Encrypt 证书续期碰到"No module named virtualenv"问题?

  •  
  •   cpublic 2017-04-08 16:29:15 +08:00 1257 次点击
    这是一个创建于 3157 天前的主题,其中的信息可能已经有所发展或是发生改变。

    折腾了好久了都, Let ’ s Encrypt 证书续期总是出现这个 virtualenv 的问题,我的VPS用的是Debian,求大虾帮忙看看是哪里出问题了? 具体提示如下:

    …… libffi-dev is already the newest version. python is already the newest version. python-dev is already the newest version. python-virtualenv is already the newest version. virtualenv is already the newest version. libssl-dev is already the newest version. openssl is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Creating virtual environment... Traceback (most recent call last): File "/usr/local/bin/virtualenv", line 7, in <module> from virtualenv import main ImportError: No module named virtualenv 

    到这里就停止了,造成 Let ’ s Encrypt 证书续期无法完成,求解?

    第 1 条附言    2017-04-08 18:43:38 +08:00

    如果运行pip install virtualenv的话,也是错误一堆:

    …… File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 272, in run with self._build_session(options) as session: File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 72, in _build_session insecure_hosts=options.trusted_hosts, File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/download.py", line 329, in __init__ self.headers["User-Agent"] = user_agent() File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/download.py", line 93, in user_agent from pip._vendor import distro File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 1050, in <module> _distro = LinuxDistribution() File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 594, in __init__ if include_lsb else {} File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 933, in _get_lsb_release_info raise subprocess.CalledProcessError(code, cmd, stdout) …… File "/usr/local/bin/pip", line 9, in <module> load_entry_point('pip==9.0.1', 'console_scripts', 'pip')() File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/__init__.py", line 233, in main return command.main(cmd_args) …… if include_lsb else {} File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 933, in _get_lsb_release_info raise subprocess.CalledProcessError(code, cmd, stdout) subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1 

    这难道是python依赖库出问题了?还是pip的问题呀?

    9 条回复    2017-04-11 02:24:25 +08:00
    d7101120120
        1
    d7101120120  
       2017-04-08 17:35:20 +08:00
    pip install virtualenv
    cpublic
        2
    cpublic  
    OP
       2017-04-08 18:40:15 +08:00
    @d7101120120 哎, pip 也是提示错误!
    jimmyye
        3
    jimmyye  
       2017-04-08 19:07:38 +08:00
    https://github.com/Neilpang/acme.sh 吧,没有依赖,就一脚本
    cpublic
        4
    cpublic  
    OP
       2017-04-08 22:13:40 +08:00
    jimmyye
        6
    jimmyye  
       2017-04-09 00:57:53 +08:00
    也许是账号原因?我的步骤里面有设置 Email ,官方的好像没有仔细讲:

    Install
    wget -O - https://get.acme.sh | sh
    # relogin or source .bashrc

    Setup
    # ACCOUNT_EMAIL:
    vim .acme.sh/account.conf

    # webroot:
    sudo mkdir /srv/www/acme && chown jimmyye:jimmyye /srv/www/acme

    sudo vim /etc/nginx/acme-challenge.conf
    ```
    location /.well-known/acme-challenge/ {
    root /srv/www/acme/;
    try_files $uri =404;
    access_log off;
    }
    ```

    # change /etc/nginx/site-enabled/domain.com.conf
    ```
    server {
    listen 80;
    server_name domain.com www.domain.com;

    include acme-challenge.conf;

    location / {
    return 301 https://domain.com$request_uri;
    }
    }
    ```

    Issue certs
    acme.sh --issue --days 60 -w /srv/www/acme -d domain.com -d www.domain.com

    Install certs

    **** Permissions ****
    sudo chown jimmyye:www-data /etc/nginx/ssl
    sudo vim /etc/sudoers.d/nginx_reload
    ```
    # Cmnd alias specification
    # Nginx reload
    Cmnd_Alias NGINX_RELOAD = /usr/sbin/service nginx reload

    # No-Password Commands
    jimmyye ALL=NOPASSWD: NGINX_RELOAD

    ```

    acme.sh --installcert -d domain.com --fullchainpath /etc/nginx/ssl/domain.com-chained.crt --keypath /etc/nginx/ssl/domain.com.key --reloadcmd "sudo service nginx reload"

    另外测试的时候使用 --staging 或 --test 使用测试服务器,以免超出次数限制:
    https://github.com/Neilpang/acme.sh/wiki/Options-and-Params
    SharkIng
        7
    SharkIng  
       2017-04-09 12:27:16 +08:00
    pip 的安装需要 sudo ,是这个问题么?
    cpublic
        8
    cpublic  
    OP
       2017-04-09 15:25:15 +08:00
    @SharkIng 不是,我感觉应该是 pip 的依赖有问题!
    msg7086
        9
    msg7086  
       2017-04-11 02:24:25 +08:00
    "Error creating new authz :: Too many invalid authorizations recently."
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2576 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 24ms UTC 07:43 PVG 15:43 LAX 23:43 JFK 02:43
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86