Skip to content
Advertisement

Cannot import: “from trello import TrelloClient” py-trello and trello packages (replit)

To be simple, I couldn’t import py-trello bcs there is also a package named trello. when I run

from trello import TrelloClient

replit thinks that I’m working on python trello package and installs trello package. And then my code gives error like “cannot import TrelloClient”. But actually I’m trying to work on py-trello

I tried to add a requirements.txt file to my workspace but when I run the main.py file it automatically downloads the trello package. How can I import py-trello package instead of trello package? It works perfectly fine on my local workspace because I only have py-trello. So it’s importing py-trello. But the automatic download system of replit does not let me import py-trello. What should I do?

Advertisement

Answer

import trello #upm package(py-trello)

When you add a package by importing, we attempt to guess what package you want based on the modules you are importing. In most languages this is a direct correspondence, but in Python sometimes we can get it wrong. You can directly request a package by specifying the package directly on the import line.

Read in documentation

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement