Discuss Scratch

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)

NeonG4 wrote:

Can I import this into replit or github, or do I have to use the official python compiler?
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).


9NAwRfSR-%dWFS$a$g&zBMTj2?;jvS?L5%^X%qpCX|A<*paJ=lU07c)wmt$v{TxL5



scratchGui.timeTravel.year = '2020'
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):
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’
can someone help pls?

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)

NeonG4 wrote:

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):
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’
can someone help pls?
It gave you a link: https://numpy.org/devdocs/user/troubleshooting-importerror.html Try looking at that first.

Last edited by MonkeyBean2 (Aug. 13, 2022 09:36:42)



9NAwRfSR-%dWFS$a$g&zBMTj2?;jvS?L5%^X%qpCX|A<*paJ=lU07c)wmt$v{TxL5



scratchGui.timeTravel.year = '2020'
NeonG4
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

MonkeyBean2 wrote:

clipped
I tried the
pip install numpy -upgrade
and 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)

NeonG4 wrote:

MonkeyBean2 wrote:

clipped
I tried the
pip install numpy -upgrade
and it didn't resolve the error. help?
Did you still uninstalling and reinstalling numpy (or even Python)?

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
DifferentDance8
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

ZZC12345 wrote:

Did you still uninstalling and reinstalling numpy
That would be the most likely thing to fix your problem.

ZZC12345 wrote:

(or even Python)?
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.

R.I.P Zydrolic, 2023-2024
NeonG4
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

ZZC12345 wrote:

Did you still uninstalling and reinstalling 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?

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)

-FreeEngines- wrote:

TheReal_BestGamer wrote:

[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?
how would they?
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
Isn't changing a cloud variable an http request or am I wrong?
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)

Blackout32 wrote:

-FreeEngines- wrote:

TheReal_BestGamer wrote:

[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?
how would they?
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
Isn't changing a cloud variable an http request or am I wrong?
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/

ZZC12345 wrote:

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.
(probably, I haven't looked at the relevant code).
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.

NeonG4 wrote:

ZZC12345 wrote:

Did you still uninstalling and reinstalling 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?
What CPU do you have? Perhaps it doesn't support part of the C part of 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
MonkeyBean2
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

NeonG4 wrote:

ZZC12345 wrote:

Did you still uninstalling and reinstalling 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?
Try installing an earlier version.


9NAwRfSR-%dWFS$a$g&zBMTj2?;jvS?L5%^X%qpCX|A<*paJ=lU07c)wmt$v{TxL5



scratchGui.timeTravel.year = '2020'
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)

ZZC12345 wrote:

TheReal_BestGamer wrote:

-clipped-
Isn't changing a cloud variable an http request or am I wrong?
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/

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.


9NAwRfSR-%dWFS$a$g&zBMTj2?;jvS?L5%^X%qpCX|A<*paJ=lU07c)wmt$v{TxL5



scratchGui.timeTravel.year = '2020'
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)

Kessel_Run wrote:

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’
Gosh, that's weird!

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)



9NAwRfSR-%dWFS$a$g&zBMTj2?;jvS?L5%^X%qpCX|A<*paJ=lU07c)wmt$v{TxL5



scratchGui.timeTravel.year = '2020'
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)

NeonG4 wrote:

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.
ok, but what does that have to do with scratchattach

apparently that evil kumquat never ate my signature
when green flag clicked
forever
play sound [Undertale OST 100 - Megalovania v] until done
end
Shift down lol

Za-Chary wrote:

go pico go go pico yeah
anyways… i'm kinda random tbh
yall gotta cope seethe mald and dilate
NeonG4
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

m4th154w350m3 wrote:

NeonG4 wrote:

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.
ok, but what does that have to do with scratchattach
Someone wanted to know why numpy wasn't working and they asked for that information. : D

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)

NeonG4 wrote:

m4th154w350m3 wrote:

NeonG4 wrote:

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.
ok, but what does that have to do with scratchattach
Someone wanted to know why numpy wasn't working and they asked for that information. : D
what's numpy

apparently that evil kumquat never ate my signature
when green flag clicked
forever
play sound [Undertale OST 100 - Megalovania v] until done
end
Shift down lol

Za-Chary wrote:

go pico go go pico yeah
anyways… i'm kinda random tbh
yall gotta cope seethe mald and dilate

Powered by DjangoBB