sarumont / py-trello

Python API wrapper around Trello's API
BSD 3-Clause "New" or "Revised" License
946 stars 330 forks source link

No complete support for python3, unable to import trello module #254

Open thallia opened 6 years ago

thallia commented 6 years ago

I have the latest version of py-trello, checked with pip list, as well as Python 3. I see some others having this error, but I haven't come across any fixes yet.

My code errors on the line from the README: from trello import TrelloClient

EDIT: It's because there's no support for Python3, currently. It worked on python2.7.

ededdneddyfan commented 6 years ago

I resolved this by going into site-packages and -

Not sure if this breaks compatibility anywhere but this worked for me

delandtj commented 6 years ago

ededdneddyfan can you send a patch (a diff -u) so that other people may do exactly the same thing?

if this code has been abandoned (which given that it's been four months and no reply it looks like it has), i may create a hard fork of it and will let you know where it can be obtained from... i will need those patches, though ededdneddyfan, otherwise i (and other people) have to duplicate absolutely everything that you did.

sarumont commented 6 years ago

Patches/PRs are welcome and will be merged and pushed to PyPi. The project is no longer under active development, but it is not completely abandoned. :)

AlexanderLill commented 6 years ago

@ededdneddyfan I can't even find the line import quote_plus in this repo so that we could fix it here instead of creating manually-edited workarounds. @sarumont any hints?

ededdneddyfan commented 6 years ago

Hi @AlexanderLill - not quite sure what happened w/ that line since July. If I get some time I will try to dig up the changes but I think they're lost (recently switched to a new setup on my machine)

AlexanderLill commented 6 years ago

I am using it now just with from trello.trelloclient import TrelloClient and everything seems to work, maybe you can verify this @ededdneddyfan and this issue resolved itself :)

(I am only using board.open_cards(), board.closed_cards() and card.fetch_actions())

Python: Python 3.7.0 py-trello: py-trello 0.11.3

EnGlamdring commented 6 years ago

@AlexanderLill I've got the following in my code and still getting the same error. What am I missing?

'from trello.trelloclient import TrelloClient

client = TrelloClient( api_key='#########', api_secret='#############################################', token='your-oauth-token-key', token_secret='your-oauth-token-secret' )

all_boards = client.list_boards() last_board = all_boards[-1] print(last_board.name)`

Getting this error as well... ModuleNotFoundError: No module named 'trello.trelloclient'; 'trello' is not a package

I've installed is using Pip.

Windows 10 Python 3.6.5

spyoungtech commented 6 years ago

There's probably a confusion here and in #220 -- There is an older unmaintained trello project on PyPI (what you get when doing pip install trello). However, this project, py-trello is a completely different project, although the import name is the same.

According to the git history of this project, that import never existed, so this issue must refer to the old unmaintained trello project.

zackshapiro commented 4 years ago

@spyoungtech I'm still confused. How does someone import this library into a Python 3.7 project then? I've tried the suggestions in this thread with no luck. Searching the code hasn't proved helpful either. I'm using this for a tiny job - just to leave a comment on a card. I'm including py-trello in my requirements.txt

Thanks

JedMeister commented 4 years ago

It appears to be working as expected for me, so not sure what is going on for others

FWIW I'm running Debian Sid (currently I have python 3.7.5) and just installed py-trello like this:

sudo pip3 install py-trello

Then the following "just works":

from trello import TrelloClient

client = TrelloClient( 
    api_key='MY_API_KEY',
    api_secret='MY_API_TOKEN')

all_boards = client.list_boards() 
last_board = all_boards[-1] 
print(last_board.name)

And it output the name of the board that I had just created... So I'm not really sure what is going on for others...

cvorland commented 4 years ago

I am getting this error in Heroku using either python 3.6.10 or 3.7.6. Neither of these work.

from trello import TrelloClient
from trello.trelloclient import TrelloClient

When I run it in Google Colab on 3.6.9, it works fine. Py-trello version 0.16.0. I tried 0.11.3 as someone indicated above and got the same error.

EDIT: I tried it in Python 2.7 which gave the same message, so it is some other issue. Not clear how to debug.

EDIT2: Solved it. Silly mistake: I named one of my files trello.py, so it was trying to import that instead of py-trello.