我当前的 Python 版本是 3.8,但我也在另一个目录中安装了 python 3.6。我的 IDE 是 PyCharm。我使用 3.6 版建立了一个新项目,因此我可以使用旧版本的 Tensorflow,即 Tensorflow==2.0.0b1。但是,在此项目上使用 pip install 时,它仍然可以识别版本 3.8。我的问题是如何将 pip 安装到我的 3.6 目录而不是 3.8 站点包文件夹。
这里是错误:
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.
我需要 pip 安装到这里:
C:\Users\folder_name\AppData\Local\Programs\Python\Python36\Lib\site-packages
P.S:我为这个新项目使用 Python 3.6 设置了一个 venv。