Pycharm使用错误的python版本运行虚拟环境

时间:2020-02-06 14:15:57

标签: python terminal pycharm virtualenv

enter image description here

我移到一台新PC,然后克隆了我的项目,已经设置了解释程序,但是终端继续使用旧版本的Python,这是Mac上的默认版本。如何在终端中运行更新的(venv)Python版本?

更新映像:在终端中使用virtualenv(不是PyCharm内置的)

enter image description here

1 个答案:

答案 0 :(得分:1)

@ vicktor9450我将概述确保在终端中键入python时使用python3启动外壳程序所需的步骤

  • 创建虚拟环境最简单的格式, virtualenv [name] --python = [要使用的python]
  • []创建虚拟环境:virtualenv venv --python=python3
  • []转到Pycharm>首选项>项目>项目解释器
  • []在 Projet Interpreter 下拉菜单的最右侧,单击齿轮/齿轮图标

enter image description here -[]单击选项添加

enter image description here

  • []选择现有环境选项,然后选择您刚刚创建的虚拟环境,应用并保存更改,并且应该全部 enter image description here