[英]How do I use the Python 3.7 packages with the Python 3.9 interpreter?
The system I'm using is MacOS Big Sur 11.2.1.我使用的系统是 MacOS Big Sur 11.2.1。 After I used Homebrew to upgrade everything on the system, I automatically upgraded Python 3.7 to 3.9, which caused my previous installed Python 3.7 packages not to be found under Python 3.9.使用 Homebrew 升级系统所有内容后,我自动将 Python 3.7 升级到 3.9,导致我之前安装的 Python 3.7 包在 ZA7F5F35426B9274117392 下找不到。 Can I use the Python 3.7 package with the Python 3.9 interpreter?我可以将 Python 3.7 package 与 Python 3.9 解释器一起使用吗? If you can.如果你可以的话。 How do you do that?你是怎样做的? By the way, I found all the packages I had installed under Python 3.7。顺便把之前安装的包都查到了Python 3.7下。
In addition, I will use the command brew search python3@
, return results boost - Python3另外,我会使用命令brew search python3@
,返回结果boost - Python3
Python@3.7 Python@3.8 Python@3.9 ✅ , and I will use the command brew Search Python@3.7
, Did not find Python 3.7 in the path he suggested. Python@3.7 Python@3.8 Python@3.9 ✅ ,我会使用命令brew Search Python@3.7
,在他建议的路径中没有找到 Python 3.7。 It has all become Python 3.9都变成了Python 3.9
type pip freeze with your old version of python, then, make a doc call t.txt, copy what your pip shown in it, then, save under code as a python file and run it on your new python, give it some time, it should work! type pip freeze with your old version of python, then, make a doc call t.txt, copy what your pip shown in it, then, save under code as a python file and run it on your new python, give it some time,它应该工作!
import os
try:
with open("t.txt") as f:
l = f.readlines()
print(l)
for i in l:
os.system(f"pip install {i}")
except Exception as e:
print(e)
input()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.