默认为用户安装,因为普通站点包不可写。 (Linux)
系统:Fedora 36
在创建 Discord 机器人的过程中,我安装了 pip,然后运行命令:
pip install discord
终端中出现了一些进度条内容,很快就安装了 Discord。 但是,等一下,我仍然看到我无法在 VS Code 中使用不和谐库。我在终端中再次运行该命令。输出是:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: discord in /home/Satyam/.local/lib/python3.10/site-packages (1.7.3)
Requirement already satisfied: discord.py>=1.7.3 in /home/Satyam/.local/lib/python3.10/site-packages (from discord) (1.7.3)
Requirement already satisfied: aiohttp<3.8.0,>=3.6.0 in /home/Satyam/.local/lib/python3.10/site-packages (from discord.py>=1.7.3->discord) (3.7.4.post0)
Requirement already satisfied: multidict<7.0,>=4.5 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (6.0.2)
Requirement already satisfied: async-timeout<4.0,>=3.0 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (3.0.1)
Requirement already satisfied: attrs>=17.3.0 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (21.4.0)
Requirement already satisfied: yarl<2.0,>=1.0 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (1.7.2)
Requirement already satisfied: chardet<5.0,>=2.0 in /usr/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (4.0.0)
Requirement already satisfied: typing-extensions>=3.6.5 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (4.1.1)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3.10/site-packages (from yarl<2.0,>=1.0->aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (3.3)
浏览文章 https://itsmycode.com/solved-defaulting-to-user-installation-because-normal-site-packages-is-not-writeable/ 我发现这可能是由于两个版本造成的python安装在我的机器。文章中也列出了解决方案。我尝试过,但第一个对我不起作用。对于第二个解决方案,我不喜欢每次开始新项目时都这样做。
那么,有没有办法管理 python 的两个冲突版本呢?
System: Fedora 36
On my way to create a discord bot, I installed pip
and then ran the command:
pip install discord
There was some progress bar stuff in the terminal and soon the discord was installed.
But, wait a minute, I still see that I could not use discord library in VS Code. I ran the command again in the terminal. The output was:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: discord in /home/Satyam/.local/lib/python3.10/site-packages (1.7.3)
Requirement already satisfied: discord.py>=1.7.3 in /home/Satyam/.local/lib/python3.10/site-packages (from discord) (1.7.3)
Requirement already satisfied: aiohttp<3.8.0,>=3.6.0 in /home/Satyam/.local/lib/python3.10/site-packages (from discord.py>=1.7.3->discord) (3.7.4.post0)
Requirement already satisfied: multidict<7.0,>=4.5 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (6.0.2)
Requirement already satisfied: async-timeout<4.0,>=3.0 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (3.0.1)
Requirement already satisfied: attrs>=17.3.0 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (21.4.0)
Requirement already satisfied: yarl<2.0,>=1.0 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (1.7.2)
Requirement already satisfied: chardet<5.0,>=2.0 in /usr/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (4.0.0)
Requirement already satisfied: typing-extensions>=3.6.5 in /home/Satyam/.local/lib/python3.10/site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (4.1.1)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3.10/site-packages (from yarl<2.0,>=1.0->aiohttp<3.8.0,>=3.6.0->discord.py>=1.7.3->discord) (3.3)
After going through the article https://itsmycode.com/solved-defaulting-to-user-installation-because-normal-site-packages-is-not-writeable/ I found that this was probably due to two versions of python installed on my machine. Solutions were listed in the article as well. I tried but the first one didn't work for me. For the second solution, I didn't prefer to do it each time I started a new project.
So, is there a way to manage the two clashing versions of python?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论