Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- Kitten-da-Cat
- Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
Scratchattack lol
Signed:
J. N.
Here is my cute cat:
- MonkeyBean2
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
Python is not a complied language (there is a compilation-like step, before interpretation, but that doesn't really count). Replit uses the official python interpreter. Github does not have a VM, or any way of running python (to my knowlege). Can I import this into replit or github, or do I have to use the official python compiler?
- NeonG4
- Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
I just got scratchattach on replit, but it gave me an error. I don't quite understand it though, but its not in my code.
Traceback (most recent call last):can someone help pls?
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 23, in <module>
from . import multiarray
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/multiarray.py”, line 10, in <module>
from . import overrides
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/overrides.py”, line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “main.py”, line 1, in <module>
import scratchattach as scratch3
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/__init__.py”, line 1, in <module>
from ._cloud import *
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 2, in <module>
from numpy import var
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/__init__.py”, line 140, in <module>
from . import core
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
Traceback (most recent call last):
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 23, in <module>
from . import multiarray
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/multiarray.py”, line 10, in <module>
from . import overrides
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/overrides.py”, line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “main.py”, line 1, in <module>
import scratchattach as scat
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/__init__.py”, line 1, in <module>
from ._cloud import *
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 2, in <module>
from numpy import var
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/__init__.py”, line 140, in <module>
from . import core
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
Traceback (most recent call last):
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 23, in <module>
from . import multiarray
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/multiarray.py”, line 10, in <module>
from . import overrides
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/overrides.py”, line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “main.py”, line 1, in <module>
import scratchattach
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/__init__.py”, line 1, in <module>
from ._cloud import *
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 2, in <module>
from numpy import var
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/__init__.py”, line 140, in <module>
from . import core
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
Traceback (most recent call last):
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 23, in <module>
from . import multiarray
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/multiarray.py”, line 10, in <module>
from . import overrides
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/overrides.py”, line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “main.py”, line 1, in <module>
import scratchattach as scratch3
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/__init__.py”, line 1, in <module>
from ._cloud import *
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 2, in <module>
from numpy import var
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/__init__.py”, line 140, in <module>
from . import core
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.8 from “/home/runner/Scratch-attach/venv/bin/python”
* The NumPy version is: “1.23.1”
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named ‘numpy.core._multiarray_umath’
Last edited by NeonG4 (Aug. 12, 2022 19:21:57)
Visit my shop!
Be high contrast
Hi! I'm NeonG4! I help on the HWS forum, create lame projects, and give advice.
My advice: Read this => https://en.scratch-wiki.info/wiki/User:Jvvg/Essays/Some_thoughts_on_the_forums
ROYGBIV (Rainbow text)
Sigs can go on for a while lol
Hi
when green flag clicked
set [move (10) steps] to [10]
think [move (10) steps]
Golly gee, what if I say something important like: I'm making minecraft in scratch! Follow me or I'll steal your ovens' fans' cabinets' glass. Or just a glass from your cabinet next to your oven fan. Do ovens have fans? Maybe its a stove fan, idk.
]
Generation 3: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and increase the generation by 1. Social experiment.
Never gonna give you up, never gonna let you down.
You didn't learn.
- MonkeyBean2
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
It gave you a link: I just got scratchattach on replit, but it gave me an error. I don't quite understand it though, but its not in my code. https://numpy.org/devdocs/user/troubleshooting-importerror.html Try looking at that first.Traceback (most recent call last):can someone help pls?
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 23, in <module>
from . import multiarray
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/multiarray.py”, line 10, in <module>
from . import overrides
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/overrides.py”, line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’
During handling of the above exception, another exception occurred:
… CLIPPED …
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “main.py”, line 1, in <module>
import scratchattach as scratch3
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/__init__.py”, line 1, in <module>
from ._cloud import *
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 2, in <module>
from numpy import var
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/__init__.py”, line 140, in <module>
from . import core
File “/home/runner/Scratch-attach/venv/lib/python3.10/site-packages/numpy/core/__init__.py”, line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.8 from “/home/runner/Scratch-attach/venv/bin/python”
* The NumPy version is: “1.23.1”
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named ‘numpy.core._multiarray_umath’
Last edited by MonkeyBean2 (Aug. 13, 2022 09:36:42)
- NeonG4
- Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
I tried the clipped
pip install numpy -upgradeand it didn't resolve the error. help?
Visit my shop!
Be high contrast
Hi! I'm NeonG4! I help on the HWS forum, create lame projects, and give advice.
My advice: Read this => https://en.scratch-wiki.info/wiki/User:Jvvg/Essays/Some_thoughts_on_the_forums
ROYGBIV (Rainbow text)
Sigs can go on for a while lol
Hi
when green flag clicked
set [move (10) steps] to [10]
think [move (10) steps]
Golly gee, what if I say something important like: I'm making minecraft in scratch! Follow me or I'll steal your ovens' fans' cabinets' glass. Or just a glass from your cabinet next to your oven fan. Do ovens have fans? Maybe its a stove fan, idk.
]
Generation 3: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and increase the generation by 1. Social experiment.
Never gonna give you up, never gonna let you down.
You didn't learn.
- ZZC12345
- Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
Did you still uninstalling and reinstalling numpy (or even Python)?I tried the clippedpip install numpy -upgradeand it didn't resolve the error. help?
This is my signature. Go check out my GitHub if you want to!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Make sure to check out these cool projects, written in real code! (outdated, sorry)
Aviate - Itinerary - Scratch Auth - Orange OS Linux Distro - ocular - Leopard - PyHelp - My GitHub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Make sure to check out these cool projects, written in real code! (outdated, sorry)
Aviate - Itinerary - Scratch Auth - Orange OS Linux Distro - ocular - Leopard - PyHelp - My GitHub
- DifferentDance8
- Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
That would be the most likely thing to fix your problem. Did you still uninstalling and reinstalling numpy
That would break stuff beyond repair, because that would also mean uninstalling EVERY module on your computer, and you then would have to reinstall every module as well. (or even Python)?
R.I.P Zydrolic, 2023-2024
- NeonG4
- Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
I tried that, stuff happened, it uninstalled, I reinstalled numpy, and error was still there. my numpy version is 1.23.1, is that up to date? Did you still uninstalling and reinstalling numpy
Visit my shop!
Be high contrast
Hi! I'm NeonG4! I help on the HWS forum, create lame projects, and give advice.
My advice: Read this => https://en.scratch-wiki.info/wiki/User:Jvvg/Essays/Some_thoughts_on_the_forums
ROYGBIV (Rainbow text)
Sigs can go on for a while lol
Hi
when green flag clicked
set [move (10) steps] to [10]
think [move (10) steps]
Golly gee, what if I say something important like: I'm making minecraft in scratch! Follow me or I'll steal your ovens' fans' cabinets' glass. Or just a glass from your cabinet next to your oven fan. Do ovens have fans? Maybe its a stove fan, idk.
]
Generation 3: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and increase the generation by 1. Social experiment.
Never gonna give you up, never gonna let you down.
You didn't learn.
- Blackout32
- Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
Isn't changing a cloud variable an http request or am I wrong?how would they? [Removed - please don't quote the main post]
How are you able to connect to the Scratch servers? Don't they encrypt data or at least have very minimal protection against this?
Like anytime you send a request to the servers, the encryption etc. would have to be done client sided, which means you can replicate it. what would encrypting do anyways? and how would they have protection
- QuestExplorer123
- Scratcher
4 posts
scratchattach - A Scratch API wrapper (Python)
Very helpful! thank you timmccool
- ZZC12345
- Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
It's sort of an HTTP request. Cloud vars use the WebSocket protocol (it used to use HTTP, but to improve latency the ST switched it). I wrote a post a while ago about this: https://scratch.mit.edu/discuss/post/6510239/Isn't changing a cloud variable an http request or am I wrong?how would they? [Removed - please don't quote the main post]
How are you able to connect to the Scratch servers? Don't they encrypt data or at least have very minimal protection against this?
Like anytime you send a request to the servers, the encryption etc. would have to be done client sided, which means you can replicate it. what would encrypting do anyways? and how would they have protection
And about encryption, Scratch and (I hope) scratchattach use the version of the protocol that uses encryption (WS I don't think so. Scratch cloud variables use WebSockets to set information. Using WebSockets, the server sends data whenever it wants (in this case, when there's an update in the cloud var) and so does the client (though Scratch probably rate limits you in the client-side code), so there should be no “updates” when a variable gets read, it's just reading internal state.S), just like how there's HTTP and HTTPS.
(probably, I haven't looked at the relevant code).
What CPU do you have? Perhaps it doesn't support part of the C part of NumPy.I tried that, stuff happened, it uninstalled, I reinstalled numpy, and error was still there. my numpy version is 1.23.1, is that up to date? Did you still uninstalling and reinstalling numpy
This is my signature. Go check out my GitHub if you want to!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Make sure to check out these cool projects, written in real code! (outdated, sorry)
Aviate - Itinerary - Scratch Auth - Orange OS Linux Distro - ocular - Leopard - PyHelp - My GitHub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Make sure to check out these cool projects, written in real code! (outdated, sorry)
Aviate - Itinerary - Scratch Auth - Orange OS Linux Distro - ocular - Leopard - PyHelp - My GitHub
- MonkeyBean2
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
Try installing an earlier version.I tried that, stuff happened, it uninstalled, I reinstalled numpy, and error was still there. my numpy version is 1.23.1, is that up to date? Did you still uninstalling and reinstalling numpy
- Mast_Scratch
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
Update on what's happening, I was not on scratch for 2-3 days straight
- MonkeyBean2
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
It's sort of an HTTP request. Cloud vars use the WebSocket protocol (it used to use HTTP, but to improve latency the ST switched it). I wrote a post a while ago about this: -clipped-https://scratch.mit.edu/discuss/post/6510239/
Isn't changing a cloud variable an http request or am I wrong?
A WebSocket connection is initiated with an HTTP(S) request, and the server responds with HTTP response code 101 (switching protocols), that tells the browser to switch to use the Websocket protocol.
And about encryption, Scratch and (I hope) scratchattach use the version of the protocol that uses encryption (WSS), just like how there's HTTP and HTTPS.
I bet it would upgrade the connection to WSS if you tried to connect with WS… And, modern browsers won't let you use WS on HTTPS pages, for security reasons.
What CPU do you have? Perhaps it doesn't support part of the C part of NumPy.
C is compiled…So it would probably be the compiler which is having trouble. I doubt it would be the CPU.
- Kessel_Run
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
I installed it using
pip install scratchattach
and it worked. I have a folder called “scratchattach” and a folder called “scratchattach-0.9.9.dist-info” in my Python39/Lib/site-packages. But I can't import it into my program. I typed
import scratchattach as scratch3
and it threw this error:
ModuleNotFoundError: No module named ‘scratchattach’
- MonkeyBean2
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
Gosh, that's weird! I installed it usingpip install scratchattach
and it worked. I have a folder called “scratchattach” and a folder called “scratchattach-0.9.9.dist-info” in my Python39/Lib/site-packages. But I can't import it into my program. I typedimport scratchattach as scratch3
and it threw this error:ModuleNotFoundError: No module named ‘scratchattach’
Make sure running it with python3.
Run python3 –version, and see what it's version is.
Installing it with pip3 should make no difference.
Last edited by MonkeyBean2 (Aug. 14, 2022 17:12:36)
- NeonG4
- Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
For whoever is wondering, I have chrome. I am not as fluent in chrome os than windows os, so idk how to check full os.
Visit my shop!
Be high contrast
Hi! I'm NeonG4! I help on the HWS forum, create lame projects, and give advice.
My advice: Read this => https://en.scratch-wiki.info/wiki/User:Jvvg/Essays/Some_thoughts_on_the_forums
ROYGBIV (Rainbow text)
Sigs can go on for a while lol
Hi
when green flag clicked
set [move (10) steps] to [10]
think [move (10) steps]
Golly gee, what if I say something important like: I'm making minecraft in scratch! Follow me or I'll steal your ovens' fans' cabinets' glass. Or just a glass from your cabinet next to your oven fan. Do ovens have fans? Maybe its a stove fan, idk.
]
Generation 3: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and increase the generation by 1. Social experiment.
Never gonna give you up, never gonna let you down.
You didn't learn.
- m4th154w350m3
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
ok, but what does that have to do with scratchattach For whoever is wondering, I have chrome. I am not as fluent in chrome os than windows os, so idk how to check full os.
apparently that evil kumquat never ate my signature
when green flag clickedShift down lol
forever
play sound [Undertale OST 100 - Megalovania v] until done
end
anyways… i'm kinda random tbh go pico go go pico yeah
yall gotta cope seethe mald and dilate
- NeonG4
- Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
Someone wanted to know why numpy wasn't working and they asked for that information. : Dok, but what does that have to do with scratchattach For whoever is wondering, I have chrome. I am not as fluent in chrome os than windows os, so idk how to check full os.
Visit my shop!
Be high contrast
Hi! I'm NeonG4! I help on the HWS forum, create lame projects, and give advice.
My advice: Read this => https://en.scratch-wiki.info/wiki/User:Jvvg/Essays/Some_thoughts_on_the_forums
ROYGBIV (Rainbow text)
Sigs can go on for a while lol
Hi
when green flag clicked
set [move (10) steps] to [10]
think [move (10) steps]
Golly gee, what if I say something important like: I'm making minecraft in scratch! Follow me or I'll steal your ovens' fans' cabinets' glass. Or just a glass from your cabinet next to your oven fan. Do ovens have fans? Maybe its a stove fan, idk.
]
Generation 3: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and increase the generation by 1. Social experiment.
Never gonna give you up, never gonna let you down.
You didn't learn.
- m4th154w350m3
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
what's numpySomeone wanted to know why numpy wasn't working and they asked for that information. : Dok, but what does that have to do with scratchattach For whoever is wondering, I have chrome. I am not as fluent in chrome os than windows os, so idk how to check full os.
apparently that evil kumquat never ate my signature
when green flag clickedShift down lol
forever
play sound [Undertale OST 100 - Megalovania v] until done
end
anyways… i'm kinda random tbh go pico go go pico yeah
yall gotta cope seethe mald and dilate