在Ubuntu上安装Python 3.9的软件包22.04

发布于 2025-02-04 02:00:40 字数 482 浏览 2 评论 0原文

我正在使用Ubuntu 22.04 LTS,更新后,默认的Python更改为Python 3.10。但是,我目前使用的大多数库仅在3.9上可用。

当我尝试通过

pip安装mypackage

安装软件包时,默认情况下是为python 3.10安装的,v3.9,

python3.9 -m pip install mypackage

我遇到以下错误,

from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'

我必须能够安装这些模块,这一点至关重要对于Python3.9。我试图通过使用Pycharm安装虚拟环境来实现相同的操作,即使在此内,我也会遇到此“ Distutil”错误。我们该如何解决?

I'm using Ubuntu 22.04 LTS, after the update, the default python changed to Python 3.10. However, most of the libraries I'm currently using are only available on 3.9.

when I try to install packages by

pip install mypackage

it is by default installed for python 3.10, V3.9 by

python3.9 -m pip install mypackage

I'm getting the following error,

from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'

It is essential that I should be able to install these modules for Python3.9. I tried to achieve the same by installing a Virtual environment using Pycharm and even inside this VE I'm getting this 'distutil' error. How can we fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文