Transport is already connected exception when trying to authenticate using python

I have just started experimenting with Speckle and while trying to authenticate using python libraries following the instructions in the documentation, i always receive: specklepy.logging.exceptions.SpeckleException: SpeckleException: Failed to execute the GraphQL active_user request. Inner exception: Transport is already connected

I have tried authenticating using:
client = SpeckleClient(host=“speckle.xyz”)
account = get_account_from_token(speckleToken, speckleServer)
client.authenticate_with_account(account)

of course i inserted the access token obtained by creating an access token from Developer settings on my profile

And i also tried using:

client = SpeckleClient(host="speckle.xyz")
account = get_default_account()
client.authenticate_with_account(account)

Can you please advise? Am I missing anything here? I extracted the token

1 Like

Hi @Ali_Abdel-Khalek !
This error might be caused by the mismatch between 3 libraries: urllib3, requests, requests_toolbelt. This might be happening if your specklepy is installed into a shared environment, where other libraries are causing conflict between dependencies’ versions.

When running your code, try running the command:

import requests, urllib3, specklepy 
from importlib.metadata import version
version('urllib3')
version('requests')
version('requests_toolbelt')

The compatible versions the libraries would be:
requests==2.31.0
urllib3==1.26.16
requests_toolbelt==0.10.1

You can try updating them manually, or just create a separate virtual environment with specklepy installation. Let us know if this works :raised_hands:

3 Likes

Thank you @Kateryna :raised_hands:

1 Like