简体   繁体   English

如何将 Python 3.7 包与 Python 3.9 解释器一起使用?

[英]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.

相关问题 如果 openmesh 和 igl 库都不适用于 python2.7 或 python3.9,我该如何使用 Python 中的这些库? - How do I use openmesh and igl libraries in Python if both are not available for python2.7 or python3.9? 如何在 Visual Studio Code 中将我的解释器从 Python 3.8 更改为 Python 3.9? [已解决] - How could I change my Interpreter from Python 3.8 to Python 3.9 in Visual Studio Code? [Resolved with answer] 如何使 python 3.9 在 centos 上成为我的默认 python 解释器 - How to make python 3.9 my default python interpreter on centos 如何在 Ubuntu 14 中使用 pip 为 python 3.7 安装软件包? - How do I install packages using pip for python 3.7 in Ubuntu 14? 我如何使用IPython作为我的Emacs Python解释器? - How do I use IPython as my Emacs Python interpreter? 多处理在 python 3.9 中从 MacOSx 上的 3.7 更改,如何修复? - Multiprocessing changed in python 3.9 from 3.7 on MacOSx, how to fix? 如何将我的 conda 基础环境从 Python 3.7 更改为 3.9? - How to change my conda base environment from Python 3.7 to 3.9? Python ImportError 在 Python 3.6、3.7、3.8 上,但不在 3.9 上 - Python ImportError on Python 3.6, 3.7, 3.8, but not on 3.9 如何在 Python 3.7 上安装 PyAudio? - How do I install PyAudio on Python 3.7? 如何在 python 3.7 中安装 Urduhack? - How do I install Urduhack in python 3.7?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM