Sid72020123 / scratchconnect

Python Library to connect Scratch API and much more.
https://sid72020123.github.io/scratchconnect/
MIT License
25 stars 14 forks source link

scratchconnect import issue??? #58

Open boredistan opened 1 year ago

boredistan commented 1 year ago

Exception has occurred: TypeError 'type' object is not subscriptable File "/home/musa/Desktop/scratchautomation.py", line 1, in import scratchconnect TypeError: 'type' object is not subscriptable

boredistan commented 1 year ago

Python 3.8.10 (default, Mar 13 2023, 10:26:41) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license()" for more information.

import scratchconnect ScratchConnect v5.0 - https://sid72020123.github.io/scratchconnect/ Traceback (most recent call last): File "/usr/lib/python3.8/idlelib/run.py", line 559, in runcode exec(code, self.locals) File "<pyshell#0>", line 1, in File "/home/musa/.local/lib/python3.8/site-packages/scratchconnect/init.py", line 26, in from scratchconnect.ScratchConnect import ScratchConnect File "/home/musa/.local/lib/python3.8/site-packages/scratchconnect/ScratchConnect.py", line 13, in from scratchconnect import Project File "/home/musa/.local/lib/python3.8/site-packages/scratchconnect/Project.py", line 10, in from scratchconnect import CloudConnection File "/home/musa/.local/lib/python3.8/site-packages/scratchconnect/CloudConnection.py", line 22, in class CloudConnection: File "/home/musa/.local/lib/python3.8/site-packages/scratchconnect/CloudConnection.py", line 58, in CloudConnection def get_variable_data(self, limit: int = 100, offset: int = 0) -> list[dict]: TypeError: 'type' object is not subscriptable

Sid72020123 commented 1 year ago

Can you share me the full code here? Seems like there is a problem in your code...

Remove the sensitive information such as username and password from your code and share it here.

Sid72020123 commented 1 year ago

Also, uninstall the v5.0 of the library and install the v4.5.1 using pip install scratchconnect==4.5.1 and then try again! Note: In v4.5.1, the online IDE feature will not work!

I will try to find all the errors and fix them in the next versions...

programORdie2 commented 1 year ago

I got the same error ...

Sid72020123 commented 1 year ago

Sorry. I actually developed the new version in Python 3.10 which supports "|" for Union typing but the lower Python versions doesn't :(

I will fix that soon but I don't have the time to do that :/

programORdie2 commented 1 year ago

Maybe i can help? If you tell me what to do, I'll fix it.

TheCommCraft commented 1 year ago

You can try to update your python version @boredistan

programORdie2 commented 1 year ago

@TheCommCraft I use replit.

TheCommCraft commented 1 year ago

You can try to update your python version @boredistan