Search code examples
pythondiscordreplit

Two packages with same import namespace causing package manager to install additional package


I'm using repl.it with the discord2 package for slash commands. This package shares the same import namespace with discord.py. When I run "import discord", repl.it's package manager (poetry?) automatically goes and installs discord (the mirror for discord.py).

So, I already have discord2 installed. And, when I press "run", the console outputs,

Replit: Updating package configuration
--> python3 -m poetry add discord

and then it installs discord, and ignores discord2.

Is there a way around that? Like, can I explicitly declare which package I want to import from, or prevent repl.it from automatically installing the additional package?

Thanks in advance!


Solution

  • You can use Replit's Package Manager on the left to get discord2! Just go to the left bar with the files and settings and stuff, go to the package manager (The shaded in white cube) and then type in discord/discord2 and then you will find discord2!