在Ubuntu 16.04上使用virtualenv 15.0.1和Python 3.5.2(都安装了apt),当我创建和激活新的Python虚拟环境时
virtualenv .virtualenvs/wtf -p $(which python3) --no-site-packages
source .virtualenvs/wtf/bin/activate
Run Code Online (Sandbox Code Playgroud)
我得到以下输出:
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/das-g/.virtualenvs/wtf/bin/python3
Also creating executable in /home/das-g/.virtualenvs/wtf/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
Run Code Online (Sandbox Code Playgroud)
确实pip freeze --all列出了这4个包:
pip==8.1.2
pkg-resources==0.0.0
setuptools==25.2.0
wheel==0.29.0
Run Code Online (Sandbox Code Playgroud)
虽然,我希望pip freeze(没有--all)省略这些隐式安装的软件包.它确实省略了其中一些,但没有pkg-resources:
pkg-resources==0.0.0
Run Code Online (Sandbox Code Playgroud)
(同btw.pip freeze --local)
虽然这与帮助文本一致
$> pip freeze --help | grep '\--all'
--all Do not skip these packages in the output: pip, setuptools, …Run Code Online (Sandbox Code Playgroud) 我正在为django项目设置基础,已经克隆了一个存储库,并且刚刚在同一目录中为该项目创建了虚拟环境。但是,当我尝试在项目目录中运行命令“ pip install -r requirements.txt”时,出现此错误:
[Errno 2]没有这样的文件或目录:'requirements.txt'
我相信我只是在错误的目录中运行它,但我真的不知道应该在哪里运行它。您是否知道文件可以存放在哪里?
我正在使用Django REST Framework在Google App Engine上部署,我的requirements.txt文件如下:
asn1crypto==0.24.0
astroid==2.1.0
boto3==1.9.55
botocore==1.12.55
certifi==2018.8.13
cffi==1.11.5
chardet==3.0.4
colorama==0.4.1
coreapi==2.3.3
coreschema==0.0.4
cryptography==2.4.2
defusedxml==0.5.0
Django==2.1
django-allauth==0.36.0
django-filter==2.0.0
django-rest-auth==0.9.3
django-rest-swagger==2.0.7
djangorestframework==3.8.2
djangorestframework-jwt==1.11.0
docutils==0.14
idna==2.7
isort==4.3.4
itypes==1.1.0
Jinja2==2.10
jmespath==0.9.3
lazy-object-proxy==1.3.1
lxml==4.2.5
MarkupSafe==1.0
mccabe==0.6.1
oauthlib==2.1.0
openapi-codec==1.3.2
Pillow==5.3.0
pycparser==2.19
PyJWT==1.6.4
pylint==2.2.2
PyMySQL==0.9.2
python-dateutil==2.7.5
python-social-auth==0.3.6
python3-openid==3.1.0
pytz==2018.5
requests==2.19.1
requests-oauthlib==1.0.0
s3transfer==0.1.13
simplejson==3.16.0
six==1.11.0
social-auth-app-django==3.1.0
social-auth-core==2.0.0
typed-ast==1.1.0
uritemplate==3.0.0
urllib3==1.23
virtualenv==16.0.0
wrapt==1.10.11
Run Code Online (Sandbox Code Playgroud)
这是我的app.yaml文件,我的项目在本地pip venv上正常运行:
# [START django_app]
runtime: python37
handlers:
# This configures Google App Engine to serve the files in …Run Code Online (Sandbox Code Playgroud)