(最简单)在同一台计算机上使用 Python 3.6 和 3.7 的方法? [英] (Easiest) Way to use Python 3.6 and 3.7 on same computer?

查看:42
本文介绍了(最简单)在同一台计算机上使用 Python 3.6 和 3.7 的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的计算机上安装了 Python 3.7.我想用 tensorflow 才发现它基本上不支持 3.7,所以我想(也)安装 Python 3.6.

I have Python 3.7 installed on my computer. I want to use tensorflow and just found out that it basically doesn't support 3.7, so I'd like to (also) install Python 3.6.

关于如何做到这一点的任何建议?我是否必须卸载 3.7 并用 3.6 替换它,或者有没有办法只将 3.6 用于与 tensorflow 相关的内容?

Any suggestions of how to do that? Do I have to uninstall 3.7 and replace it by 3.6 or is there a way to just use 3.6 for the stuff related to tensorflow?

推荐答案

安装不同库的多个 python 安装的推荐方法之一是使用 Virtualenv.这使您可以拥有一个特定的 python 环境,它为您处理的每个项目都有自己的一组依赖项.这不仅适用于依赖项,还适用于不同版本的 python.

One of the recommended ways to have multiple python installations with differing libraries installed is to use Virtualenv. This gives you the possibility to have a specific python environment with it's own set of dependencies for each project you work on. This works not only for the dependencies, but also for different versions of python.

最重要的是,您可以使用 Pipenv 来管理不同的 virtualenv.在 Pipfile 中,您可以描述所需的 Python 及其依赖项,Pipenv 使用它来管理特定于您的项目的 Python 环境.

On top of that you can use Pipenv to manage the different virtualenvs. In a Pipfile you can describe your required python and it's dependencies which is used by Pipenv to manage a python env specific for your project.

这篇关于(最简单)在同一台计算机上使用 Python 3.6 和 3.7 的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆