scratchconnect icon indicating copy to clipboard operation
scratchconnect copied to clipboard

scratchconnect import issue???

Open boredistan opened this issue 2 years ago • 9 comments

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 avatar May 08 '23 11:05 boredistan

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 [1m[33mScratchConnect[32m[3m v5.0[37m -[36m https://sid72020123.github.io/scratchconnect/[0m 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

boredistan avatar May 08 '23 11:05 boredistan

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 avatar May 08 '23 12:05 Sid72020123

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...

Sid72020123 avatar May 08 '23 14:05 Sid72020123

I got the same error ...

programORdie2 avatar May 14 '23 15:05 programORdie2

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 :/

Sid72020123 avatar May 15 '23 15:05 Sid72020123

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

programORdie2 avatar May 16 '23 13:05 programORdie2

You can try to update your python version @boredistan

TheCommCraft avatar Jun 27 '23 21:06 TheCommCraft

@TheCommCraft I use replit.

programORdie2 avatar Jun 28 '23 11:06 programORdie2

You can try to update your python version @boredistan

TheCommCraft avatar Jul 03 '23 07:07 TheCommCraft