Discuss Scratch

2tables
Scratcher
100+ posts

How do I use ScratchAttach on my Windows computer?

So when I ran this code:
import os
os.system("pip install scratchattach")
it worked, but it didn't say anything.
So I ran this code:
import scratchattach as scratch3
and it popped up with an error:
Traceback (most recent call last):
File "C:\Users\directories\script.py", line 17, in <module>
import scratchattach as scratch3
ModuleNotFoundError: No module named 'scratchattach'
Is there any way to fix this?

Edit: This has been solved. In fact, I'm editing this with ScratchAttach.

Last edited by 2tables (March 22, 2023 11:53:46)


This is my signature. It appears at the bottom of every post I make, and is irrelevant to my post.
BreadcatGames
Scratcher
1000+ posts

How do I use ScratchAttach on my Windows computer?

2tables wrote:

Also, I tried installing PIP, and I couldn't.
Is it possible that would be the problem?
That is definitely the problem, you need pip to install scratchattach

Last edited by BreadcatGames (March 22, 2023 01:17:19)


nintendo is my favorite indie company :3 they deserve all my money and i love them and will always buy a $60/yr subscription for 30 year old games!!!
imfh
Scratcher
1000+ posts

How do I use ScratchAttach on my Windows computer?

Try opening pip with the -m option to python. For example, if you open Python with the python command, run:
python -m pip install scratchattach
If you use a different command, like py -3.10, use that instead. Hopefully it will give you useful output if it still doesn't work.

Scratch to Pygame converter: https://scratch.mit.edu/discuss/topic/600562/
2tables
Scratcher
100+ posts

How do I use ScratchAttach on my Windows computer?

imfh wrote:

Try opening pip with the -m option to python. For example, if you open Python with the python command, run:
python -m pip install scratchattach
If you use a different command, like py -3.10, use that instead. Hopefully it will give you useful output if it still doesn't work.
This works! Thank you so much!

This is my signature. It appears at the bottom of every post I make, and is irrelevant to my post.
ajskateboarder
Scratcher
1000+ posts

How do I use ScratchAttach on my Windows computer?

I have no clue why the ScratchAttach docs have this weird os.system command
Just tell people to use pip directly
2tables
Scratcher
100+ posts

How do I use ScratchAttach on my Windows computer?

ajskateboarder wrote:

I have no clue why the ScratchAttach docs have this weird os.system command
Just tell people to use pip directly
It's because you can;t run normal OS commands in Python, and have to import the os and run the command there.

This is my signature. It appears at the bottom of every post I make, and is irrelevant to my post.
ajskateboarder
Scratcher
1000+ posts

How do I use ScratchAttach on my Windows computer?

2tables wrote:

It's because you can;t run normal OS commands in Python, and have to import the os and run the command there.
No I mean to open Windows PowerShell and use pip there
It's like the standard method
PPPDUD
Scratcher
1000+ posts

How do I use ScratchAttach on my Windows computer?

How do you even edit posts with ScratchAttach?

Fun fact: If you have malware on a Windows NT device, it's possible that deleting system32 will severely damage the malware. It will also damage your Windows install.

Help keep this topic alive!

The rest of my signature was eaten by an evil kumquat attacked by a terrible president who ate my banana shot down this signature instead of shooting down the TikTok Cell Tower white balloon that probably had a camera bundled with it.

https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AA1isnZw.img?w=800&h=435&q=60&m=2&f=jpg
2tables
Scratcher
100+ posts

How do I use ScratchAttach on my Windows computer?

PPPDUD wrote:

How do you even edit posts with ScratchAttach?
You connect to the post using the function, then edit it.
Of course, it only works if you made it.

This is my signature. It appears at the bottom of every post I make, and is irrelevant to my post.
applejuiceproduc
Scratcher
1000+ posts

How do I use ScratchAttach on my Windows computer?

2tables wrote:

PPPDUD wrote:

How do you even edit posts with ScratchAttach?
You connect to the post using the function, then edit it.
Of course, it only works if you made it.
Can you show us the code though?

A signature
ScratchCatHELLO
Scratcher
1000+ posts

How do I use ScratchAttach on my Windows computer?

2tables wrote:

ajskateboarder wrote:

I have no clue why the ScratchAttach docs have this weird os.system command
Just tell people to use pip directly
It's because you can;t run normal OS commands in Python, and have to import the os and run the command there.

it’s better practice (and easier in the long term) to use a terminal. you could type the command into powershell or whatever the normal shell is called on windows instead, which is what most modules ask you to do.





ScratchCatHELLO
I have 5600+ posts, I've been on scratch for 5 1/2 years, I'm a Forum Helper™ and I have a Scratch Wiki account!
I like: Python, CSS, Javascript, Rust



Python 3 Text Adventure
cool new browser game - cursed laughing-crying emoji - Illuminati - you know waterbenders, but do you know stock-imagebenders? - snek - vibin' - Bump song (vevo) - Speed bump - yee - fred - m i c k e y
2tables
Scratcher
100+ posts

How do I use ScratchAttach on my Windows computer?

applejuiceproduc wrote:

2tables wrote:

PPPDUD wrote:

How do you even edit posts with ScratchAttach?
You connect to the post using the function, then edit it.
Of course, it only works if you made it.
Can you show us the code though?
import scratchattach as scratch3
session = scratch3.login("username", "password")[s][/s]
post = session.connect_post("post_id")
post.edit(new_content)

This is my signature. It appears at the bottom of every post I make, and is irrelevant to my post.

Powered by DjangoBB