我遇到的问题是,在Amazon EC2实例的虚拟环境中运行pip freeze
时,不显示flask
。但是,如果我在虚拟环境之外运行它,它会安装--user
标志。
[ec2-user@ip-34-235-217-226 html]$ virtualenv venv
New python executable in /var/www/html/venv/bin/python2.7
Also creating executable in /var/www/html/venv/bin/python
Installing setuptools, pip, wheel...done.
[ec2-user@ip-34-235-217-226 html]$ source venv/bin/activate
(venv) [ec2-user@ip-34-235-217-226 html]$ pip install flask
Collecting flask
Using cached https://files.pythonhosted.org/packages/90/72/b5ed853418364d8e7006550dbdb2cb9ac3e33ce3c9145acc7898fca8c0b6/Flask-1.0.1-py2.py3-none-any.whl
Requirement already satisfied: Werkzeug>=0.14 in ./venv/lib/python2.7/dist-packages (from flask) (0.14.1)
Requirement already satisfied: click>=5.1 in ./venv/lib/python2.7/dist-packages (from flask) (6.7)
Requirement already satisfied: Jinja2>=2.10 in ./venv/lib/python2.7/dist-packages (from flask) (2.10)
Requirement already satisfied: itsdangerous>=0.24 in ./venv/lib/python2.7/dist-packages (from flask) (0.24)
Collecting MarkupSafe>=0.23 (from Jinja2>=2.10->flask)
Installing collected packages: flask, MarkupSafe
Successfully installed MarkupSafe-1.0 flask-1.0.1
但是我运行pip freeze
并且烧瓶不在列表中
(venv) [ec2-user@ip-34-235-217-226 html]$ pip freeze
click==6.7
itsdangerous==0.24
Jinja2==2.10
Werkzeug==0.14.1
现在疯狂的部分是,如果我在虚拟环境之外运行pip install flask --user
和pip freeze
,它的工作正常。
有什么建议吗?