简体   繁体   English

Pycharm 终端不同的 Python 版本

[英]Pycharm Terminal Different Python Version

My current Python version is 3.8, but I do also have python 3.6 installed in another directory.我当前的 Python 版本是 3.8,但我也在另一个目录中安装了 python 3.6。 My IDE is Pycharm.我的 IDE 是 Pycharm。 I set up a new project using version 3.6 so I can use an older version of Tensorflow, namely Tensorflow==2.0.0b1.我使用 3.6 版建立了一个新项目,因此我可以使用旧版本的 Tensorflow,即 Tensorflow==2.0.0b1。 However, when using pip install on this project it still recognises version 3.8.但是,在此项目上使用 pip install 时,它仍然可以识别版本 3.8。 My question is how can I pip install to my my 3.6 directory and not the 3.8 site packages folder.我的问题是如何将 pip install 安装到我的 3.6 目录而不是 3.8 站点包文件夹。

Here is the error:这是错误:

C:\Users\my_folder_name\PycharmProjects\Anomaly_Dectection>pip install tensorflow==2.0.0
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0
ERROR: No matching distribution found for tensorflow==2.0.0
WARNING: You are using pip version 21.0.1; however, version 21.2.1 is available.
You should consider upgrading via the 'c:\program files\python38\python.exe -m pip install --upgrade pip' command.

I need the pip install to go here:我需要 pip install 到这里:

C:\Users\folder_name\AppData\Local\Programs\Python\Python36\Lib\site-packages

ps: I set up a virtual env with Python 3.6 for this new project ps:我为这个新项目使用 Python 3.6 设置了一个虚拟环境

Any help will be much appreciated!任何帮助都感激不尽!

It should work, when you run pip from the script folder:当您从脚本文件夹运行 pip 时,它应该可以工作:

C:\Users\folder_name\AppData\Local\Programs\Python\Python36\Scripts

If there is no pip3 in your current directory, windows is looking at your PATH variable and i guess, it takes pip3 from the newest python, not 3.6.如果您的当前目录中没有 pip3,Windows 正在查看您的 PATH 变量,我猜它从最新的 python 中获取 pip3,而不是 3.6。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM