Discuss Scratch

TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

wvzacktest wrote:

So I am getting a error when I use user.does_exist() even though it is a command and I have checked everything with pip3.11 show scratchattach and scratchattach is on version 1.7.3. Here is the part of my code where i am using it:

@client.request
def pay(to, amount): #called when client receives request
user = scratch3.get_user(to)
if not user.does_exist() == True:
return("account", to, "does not exist. You have been refunded.")

return_value = main.pay_user(client.get_requester(), to, amount)

return return_value #sends back balance to the Scratch project

and here is the error I am getting:
Caught error in request 'pay' - Full error below
Traceback (most recent call last):
File "c:\Users\###\AppData\Local\Programs\Python\Python311\Lib\site-packages\scratchattach\_cloud_requests.py", line
61, in call_request
output = req_obj["on_call"](*arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\####\Desktop\python_banking\cloud handeler.py", line 23, in pay
if not user.does_exist() == True:
^^^^^^^^^^^^^^^
AttributeError: 'User' object has no attribute 'does_exist'

Thanks
you probably need to
update scratchattach to the latest version
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

TimMcCool wrote:

wvzacktest-snip-[/quote wrote:

you probably need to
update scratchattach to the latest version
I did that and when I run
pip3.11 show scratchattach
it says im on version 1.7.3

Last edited by wvzack (May 26, 2024 19:54:32)

cs845962
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
FishHoue
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
Do you have sys?
If you don't, use ‘import sys’, then 'print(“.sys.version”).
cs845962
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.

Last edited by wvzack (May 26, 2024 20:36:21)

cs845962
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
Do you have sys?
If you don't, use ‘import sys’, then 'print(“.sys.version”).
Yes I have it. 3.12.3 (v3.12.3:f6650f9ad7, Apr 9 2024, 08:18:47)
cs845962
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.
Hmm… I think I understand what you are saying. I changed the folder name, but it didn't fix my module problem. Thanks anyway!
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.
Hmm… I think I understand what you are saying. I changed the folder name, but it didn't fix my module problem. Thanks anyway!
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Okay try asking on stackoverflow if you want. Sometimes naming stuff certain names will make the modules not work.
nexoalex
Scratcher
79 posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.
Hmm… I think I understand what you are saying. I changed the folder name, but it didn't fix my module problem. Thanks anyway!
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
pip install websocket run it

Last edited by nexoalex (May 26, 2024 23:19:31)

cs845962
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

nexoalex wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.
Hmm… I think I understand what you are saying. I changed the folder name, but it didn't fix my module problem. Thanks anyway!
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
pip install websocket run it
It is not letting me run the command. It says that there is a syntax error, and it highlights the “i” Come to think of it, it didn't let me run pip install -U scratchattach either, and for the same reasons!
wvzacktest
Scratcher
13 posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

nexoalex wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.
Hmm… I think I understand what you are saying. I changed the folder name, but it didn't fix my module problem. Thanks anyway!
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
pip install websocket run it
It is not letting me run the command. It says that there is a syntax error, and it highlights the “i” Come to think of it, it didn't let me run pip install -U scratchattach either, and for the same reasons!
ok so are you on windows?
cs845962
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

wvzacktest wrote:

cs845962 wrote:

nexoalex wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.
Hmm… I think I understand what you are saying. I changed the folder name, but it didn't fix my module problem. Thanks anyway!
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
pip install websocket run it
It is not letting me run the command. It says that there is a syntax error, and it highlights the “i” Come to think of it, it didn't let me run pip install -U scratchattach either, and for the same reasons!
ok so are you on windows?
No. I'm on mac, but I finally figured it out. I didn't have pip installed. I followed the steps here: https://packaging.python.org/en/latest/tutorials/installing-packages/ and it is now working. Thank you so much. I should have guessed that it was pip…
wvzacktest
Scratcher
13 posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

wvzacktest wrote:

cs845962 wrote:

nexoalex wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.
Hmm… I think I understand what you are saying. I changed the folder name, but it didn't fix my module problem. Thanks anyway!
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
pip install websocket run it
It is not letting me run the command. It says that there is a syntax error, and it highlights the “i” Come to think of it, it didn't let me run pip install -U scratchattach either, and for the same reasons!
ok so are you on windows?
No. I'm on mac, but I finally figured it out. I didn't have pip installed. I followed the steps here: https://packaging.python.org/en/latest/tutorials/installing-packages/ and it is now working. Thank you so much. I should have guessed that it was pip…
Okay and if you have problems installing scratchattach go to your files (this is how you do it on windows but im sure its not that different on mac) look up pip.exe if pip.exe does not exist there might be something like pip11.3.exe after that instead of doing pip install -U scratchattach try pip(in my case “pip11.3” basically the numbers you see after pip) install -U scratchattach
nexoalex
Scratcher
79 posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

nexoalex wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.
Hmm… I think I understand what you are saying. I changed the folder name, but it didn't fix my module problem. Thanks anyway!
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
pip install websocket run it
It is not letting me run the command. It says that there is a syntax error, and it highlights the “i” Come to think of it, it didn't let me run pip install -U scratchattach either, and for the same reasons!
pip install pip
dynamicsofscratch
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

(#2485)

TimMcCool wrote:

wvzacktest-snip-[/quote wrote:

you probably need to
update scratchattach to the latest version
I did that and when I run
pip3.11 show scratchattach
it says im on version 1.7.3
the latest pip scratchattach version is 1.7.3. try downloading from guthib
nexoalex
Scratcher
79 posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

wvzacktest wrote:

cs845962 wrote:

nexoalex wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

wvzack wrote:

cs845962 wrote:

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!
What is the exact error?
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratchattach/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratchattach/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
Ok so i am not sure if this will fix your problem but there are a couple things in python that you shouldn't name your project. Scratchattach is one of them as instead of finding the scratchattach module it just gets its self because its named scratchattach. And try what the other person said.
Hmm… I think I understand what you are saying. I changed the folder name, but it didn't fix my module problem. Thanks anyway!
Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 1, in <module>
import scratchattach as scratch3
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/__init__.py”, line 1, in <module>
from .cloud import *
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/cloud.py”, line 2, in <module>
import websocket
ModuleNotFoundError: No module named ‘websocket’
pip install websocket run it
It is not letting me run the command. It says that there is a syntax error, and it highlights the “i” Come to think of it, it didn't let me run pip install -U scratchattach either, and for the same reasons!
ok so are you on windows?
No. I'm on mac, but I finally figured it out. I didn't have pip installed. I followed the steps here: https://packaging.python.org/en/latest/tutorials/installing-packages/ and it is now working. Thank you so much. I should have guessed that it was pip…
good job for troubleshouting like a master (also first on this page)

Last edited by nexoalex (May 27, 2024 16:06:47)

cs845962
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

Hehe… I think this is a TimMcCool level question. My code seemed to work, and I successfully invited one curator to a studio, but as soon as I tried to invite two, I got this monster of an error. I can't make any sense of it. Any help is appreciated.
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/models.py”, line 963, in json
return complexjson.loads(self.content.decode(encoding), **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/studio.py”, line 285, in invite_curator
).json()
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/models.py”, line 971, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 2 column 1 (char 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 17, in <module>
studio.invite_curator(username)
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/studio.py”, line 287, in invite_curator
raise(_exceptions.Unauthorized)
NameError: name ‘_exceptions’ is not defined. Did you mean: ‘exceptions’?
Again, I got one invite to work (confirmed), but as soon as I tried to send two (two users, one studio) the script failed. Thanks!
wvzacktest
Scratcher
13 posts

scratchattach - A Scratch API wrapper (Python)

cs845962 wrote:

Hehe… I think this is a TimMcCool level question. My code seemed to work, and I successfully invited one curator to a studio, but as soon as I tried to invite two, I got this monster of an error. I can't make any sense of it. Any help is appreciated.
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/models.py”, line 963, in json
return complexjson.loads(self.content.decode(encoding), **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/studio.py”, line 285, in invite_curator
).json()
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/models.py”, line 971, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 2 column 1 (char 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/Testing.py”, line 17, in <module>
studio.invite_curator(username)
File “/Users/~/Documents/Python Programs/Scratch_Test_Project/scratchattach/studio.py”, line 287, in invite_curator
raise(_exceptions.Unauthorized)
NameError: name ‘_exceptions’ is not defined. Did you mean: ‘exceptions’?
Again, I got one invite to work (confirmed), but as soon as I tried to send two (two users, one studio) the script failed. Thanks!
ok so can I see your code? Also it seems that the variable “_exceptions” is not defined and it might be “exceptions” (like when you call a variable thats not set to anything eg: if I check if true_false == True but I have never set true_false to anything).

So you got the error however the first 2 errors are scratchattach errors. The 3rd error is the one that seems to be from your code.

Last edited by wvzacktest (May 27, 2024 22:22:19)

Powered by DjangoBB