SSL(LNMP) For Lightsail(AWS) 填坑记

2018年05月24日 651点热度 0人点赞 0条评论

lnmp 1.4在阿里云服务器上增加ssl出现错误 填坑以后,AWS也出现类似这样的问题.

在运行virtualenv安装的时候

pip install --upgrade virtualenv
virtualenv env

如果出现类似这样的错误

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 444, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 725, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 632, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (virtualenv 15.0.0 (/usr/local/lib/python3.4/dist-packages), Requirement.parse('virtualenv==13.1.2'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2749, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 446, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 459, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 628, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: virtualenv==13.1.

从错误提示可以看出,virtualenv版本冲突了。可是我们刚才不是已经更新了virtualenv的版本了吗。于是谷歌,找到一个答案说需要安装python3,并将系统默认的python指向它。照做了,然并卵还是没用。
后来想到,亚马逊的系统默认是没pip,所以不是pip安装,而是easy_install,简直挖坑挖的太大了。于是,我运行了下面的命令。

easy_install --upgrade virtualenv

再尝试了下,嗯问题解决!

Sandyliao

保持飢渴好吃的性格、維持好攝之徒的愛好、繼續在三流的技術下活著!

文章评论

您需要 登录 之后才可以评论