如果 OS Python 版本是 3.5,如何设置 pipenv Python 3.6 项目? [英] How to setup a pipenv Python 3.6 project if OS Python version is 3.5?
问题描述
我的 Ubuntu 16.04.03 安装了 Python 3.5.2.当我的系统没有 python 3.6 时,如何设置 pipenv 以使用 Python 3.6?
My Ubuntu 16.04.03 is installed with Python 3.5.2. How do I setup pipenv to use Python 3.6 when my system does not have python 3.6?
$ pipenv --python 3.6
Warning: Python 3.6 was not found on your system…
You can specify specific versions of Python with:
$ pipenv --python path/to/python
推荐答案
要么在 Pipfile 中手动编写您需要的版本:
Either manually write the version you need in your Pipfile:
[requires]
python_version = "3.6"
或者在您的系统上安装它.但我想如果您计划实际运行 pipenv install
,您将需要安装该版本.
Or install it on your system. But I guess you will need the version to be installed if you plan to actually run pipenv install
.
我建议使用 pyenv
:https://github.com/pyenv/pyenv.
按照安装说明,然后安装 Python 3.6 只是一个问题
Follow the installation instructions, then installing Python 3.6 is just a matter of
pyenv install 3.6.3
然后你可以用
pyenv global system 3.6.3
此外,如果 pyenv
可用,pipenv
将自动使用它来安装所需的版本.来自 pipenv
自述文件:
Besides, if pyenv
is available, pipenv
will automatically use it to install the required version. From pipenv
README:
如果 pyenv 可用,则自动安装所需的 Python.
Automatically install required Pythons, if pyenv is available.
这篇关于如果 OS Python 版本是 3.5,如何设置 pipenv Python 3.6 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!