首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用pipenv为python 2.7创建虚拟环境?

问如何使用pipenv为python 2.7创建虚拟环境?
EN

Stack Overflow用户
提问于 2019-01-06 22:29:35
回答 1查看 5.9K关注 0票数 2
代码语言:javascript
复制
C:\Users\Abj>python
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

C:\Users\Abj>cd Documents\VVV\qq\

C:\Users\Abj\Documents\VVV\qq>pipenv install django
Creating a virtualenv for this project…
Pipfile: C:\Users\Abj\Documents\VVV\qq\Pipfile
Using c:\python\python37-32\python.exe (3.7.2) to create virtualenv…
[    ] Creating virtual environment...Already using interpreter 
c:\python\python37-32\python.exe
Using base prefix 'c:\\python\\python37-32'
New python executable in C:\Users\Abj\.virtualenvs\qq- 
bCTw3U33\Scripts\python.exe
Installing setuptools, pip, wheel...
done.

Successfully created virtual environment!
Virtualenv location: C:\Users\Abj\.virtualenvs\qq-bCTw3U33
Creating a Pipfile for this project…
Installing django…
Adding django to Pipfile's [packages]…
Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Success!
Updated Pipfile.lock (4f9dd2)!
Installing dependencies from Pipfile.lock (4f9dd2)…
================================ 2/2 - 00:00:01
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

C:\Users\Abj\Documents\VVV\qq>pipenv run python
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

C:\Users\Abj\Documents\VVV\qq>pipenv shell
Launching subshell in virtual environment…
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

(qq-bCTw3U33) C:\Users\Abj\Documents\VVV\qq>which python
/c/Users/Abj/.virtualenvs/qq-bCTw3U33/Scripts/python

(qq-bCTw3U33) C:\Users\Abj\Documents\VVV\qq>python -V
Python 3.7.2

我想使用python2.7创建一个虚拟环境

Python 3.7.2是我的计算机环境中的默认版本。因此,我在path环境变量中将其更改为python 2.7.15。之后,在使用pipenv时,python也使用python 3.7.2。

有人能帮我吗?在这种情况下我该如何使用python 2.7.15?

EN

回答 1

Stack Overflow用户

发布于 2019-01-06 22:53:09

我从https://pypi.org/project/pipenv/那里得到了答案,需要使用命令

代码语言:javascript
复制
pipenv --two install django
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54062498

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档