在系统里 /usr/bin/ 中有 Python3.3 和 Python3.7 两个 py 版本,在创建 venv 时,如何指定 Python3.3 或 Python3.7 呢?
官方文档里也没找到说明,这个命令能指定 Python3.* 的小版本吗?
python3 -m venv /path/venv
在系统里 /usr/bin/ 中有 Python3.3 和 Python3.7 两个 py 版本,在创建 venv 时,如何指定 Python3.3 或 Python3.7 呢?
官方文档里也没找到说明,这个命令能指定 Python3.* 的小版本吗?
python3 -m venv /path/venv
|
raycoolApr 29, 2020
1
python3 这个引用的是哪个版本创建的就是哪个吧
|
|
2
python3.3 -m venv
python3.7 -m venv |
|
hyfcApr 29, 2020
3
-p PYTHON_EXE, --python=PYTHON_EXE
The Python interpreter to use, e.g., --python=python3.5 will use the python3.5 interpreter to create the new environment. The default is the interpreter that virtualenv was installed with (/usr/bin/python2) |
|
hyfcApr 29, 2020
5
使用 python3 内置 venv 库的话,就按照 2 楼的方法指定解释器版本。如果用 virtualenv 命令行,可以用-p 参数
|
|
xpresslinkApr 29, 2020
6
如果默认要用 3.7 可以创建一个软连接
# rm /usr/bin/python3 # ln -s /usr/bin/python3.7 /usr/bin/python3 |
|
wellscApr 29, 2020
7
$ whereis python
$ /pathto/python3.7 -m venv ./somevenv |
|
Mark24Apr 29, 2020
8
|
|
laike9mApr 29, 2020
9
|
|
ruanimalApr 29, 2020
10
使用绝对路径启动 python 吧
|
|
chenglusApr 30, 2020
11
在?为什么不用 pyenv ?
|