Pycharm虚拟环境的使用

pycharm创建项目的时候,一定勾选inhert global site-packages。不然系统的库就没法用了。

打开Project Interpreters页面:文件(file)——>设置(setting)——>项目(Project)——>Project Interpreters

配置新环境:

  • Location中填写新环境的文件目录;
  • Base interpreter下拉框中选择Python解释器;
  • 勾选Inherit global site-packages可以使用base interpreter中的第三方库,不选将和外界完全隔离;
  • 勾选Make available to all projects可将此虚拟环境提供给其他项目使用。

Pycharm虚拟环境的使用