r/learnpython • • Feb 01 '25

I have never used Python. I am just trying to install one thing from GitHub but have no idea what I'm doing.

I just need help figuring out what I'm supposed to do. A friend of mine wants me to print out some experimental roles for a social deduction game. He found this GitHub resource that supposedly can download all of the tokens from the official site. https://github.com/Tsubashi/botc_tokens

The problem is the instructions for the use of the program assume you are already familiar with how to use Python. I downloaded the latest release of Python and installed it. However, the next step just says:

Once you have Python installed, you can install these scripts using pip:

pip install botc_tokens

And I have no idea what that means or how to do it.

Can someone please provide a step-by-step guide on how I actually use Python to execute this command? Assume I have zero programming knowledge and need to know literally everything I type or click or whatever. I'm not a complete dumbass with computers by any means, but I can't figure out how to navigate Python to the root directory. It just keeps giving me a syntax error, and the "tutorials" online make my eyes glaze over because they don't make any sense.

0 Upvotes

23 comments sorted by

4

u/unhott Feb 01 '25

Python scripts are usually run through a terminal (command line / powershell / etc)

When you install python your system has a python.exe installed somewhere. And you can find its location in terminal with "which python" (mac) or "where python" (windows)

I dunno how you installed it, but if the terminal doesn't find it it means your python folder is not in the "path" environment variable. That's a list of folders your terminal looks in for these commands. You can also which pip or where pip in the terminal.

If they're found, then you should be able to just type pip install whatever

Then you would type python

If it's not finding them, you can still run them with the FULL path like

"C:\something\something\pip" install packagename

And then

"C:\something\something\python" 
>>> import packagescriptname

-6

u/GodlessGambit Feb 01 '25

OK, I know you're trying to help, but this still doesn't make sense to me.

I can get the Python command prompt open. The problem is I get a syntax error every time I try to execute the command.

It says something about an "unexpected character" and won't run it and highlights the "U" after C:\Users.

So please help me by saying step by step literally what I need to do. Do I need to download the files from GitHub? Can I just use some kind of URL to have Python install the files from GitHub without downloading them? If so, how? Like, what would I literally type into Python to make this happen?

12

u/unhott Feb 01 '25 edited Feb 01 '25

Gotta go back thru what I said. Pip is not a python command, per se. It's a separate executable that you have to run outside of python. Through a terminal.

Eta There is a way to call pip as a module with the python executable but that's not worth getting into.

Same thing with which / where (terminal cmmands for your operating system, not python commands). Those are small executable system scripts that your operating system includes.

5

u/crashfrog04 Feb 02 '25

I can get the Python command prompt open.

You need to open your shell, not the Python interpreter.

1

u/queerkidxx Feb 01 '25

Can you reply with the exact error message

17

u/Lewri Feb 01 '25

pip is not a python command, you do not run it in your python interpreter. You run it in your system terminal/command prompt.

If this isn't enough info for you to get it to work, please let us know your OS and how you installed python.

3

u/NlNTENDO Feb 01 '25 edited Feb 01 '25

I’ll start by saying you should not be opening the Python shell at all. That’s for the program, not for you. You should be in your computer’s default command window/terminal

A bit of key info for you:

  • pip is a terminal command that allows you to install Python packages to your computer.

  • It is NOT a Python command or code. This is crucial. It’s an operation run directly on your computer that enables custom functionality when you later run a Python script.

  • Similarly, if you’re trying to navigate directories, this too is NOT Python. It’s a terminal command that instructs your computer to point to a specific folder (presumably the highest-level folder that is still specific to botc tokens)

These are run in the command window (PC) or terminal (Mac). I’ll assume you’re not running Linux or you’d have to know a lot of this stuff as a prerequisite.

In this case, you’re being told to copy and paste that code right into your terminal. It will install a package that can later be accessed with Python.

I don’t know enough about this game to have a full grasp of how to navigate the commands that follow, but based on the readme all of the following scripts are also done in the terminal, not in Python. It appears that the program is built in Python and needs the pip install to run, but you don’t actually need to ever run Python yourself; instead you use the keywords discussed to run the program in terminal.

1

u/senzavita Feb 01 '25

Open up your shell:

In Windows, find an app on your computer called Command Prompt.

In Mac, find an app called the Terminal.

I don’t know Linux but there should be an app too.

Type in pip install botc_tokens and press Enter/Return.

You’ll also need Wand and ImageMagick, which you can click on the link in the github page for the steps.

-4

u/GodlessGambit Feb 01 '25

When I type in pip install botc_tokens I just get a syntax error

18

u/cgoldberg Feb 01 '25

If you get a syntax error, you are inside the Python shell and not a regular command prompt.

12

u/throwaway6560192 Feb 01 '25

You're not following exactly what the comment said. Do literally what is written. And you won't get a syntax error.

One more thing: when you're asking for help with errors... always, always, always, include the full text of the error.

4

u/senzavita Feb 01 '25

It would be helpful to see the exact wording of the error since that line is not syntactically incorrect.

However, you can also try pip3 instead of pip and as another commenter says, check your environment variables to ensure Python is available.

https://realpython.com/add-python-to-path/

0

u/GodlessGambit Feb 01 '25

Just to report back, I did eventually get it working, but it apparently requires building a JSON file from scratch, so I’m going to leave this post up and let a more technically minded friend work on this. 

1

u/Individual_Author956 Feb 02 '25

You can always use ChatGPT for Python questions, it’s pretty good, especially for the kinds of things you need it for

0

u/PaperHandsProphet Feb 02 '25

Claude sonnet 3.5 is insanely better than ChatGPT for coding.

Roo code / cline is revolutionary

0

u/PaperHandsProphet Feb 02 '25

You should really check out warp terminal using Claude Sonnet AI. It’s free and you just type what you want to do into a prompt and it does it for you. It will build that json file for you.

JSON is also stupid easy to learn if you have a good editor. Just ask Claude seriously

1

u/pumapuma12 Feb 02 '25

Its a great game though! My favorite

1

u/020516e03 Feb 02 '25

Bro needs a absolute beginner course from YouTube or Udemy

1

u/Agitated-Soft7434 Feb 02 '25

Use TERMINAL or CMD (Command Prompt) or POWERSHELL.

You cannot use the "Python Interpreter" to run this because it is a command not python code. Which is why your getting the syntax error.

If it can't find "pip" make sure to add it to ENVIROMENTAL VARIABLES (look up how to do this it is a very common issue with many tutorials).
Or you can put the whole file path for pip. E.g. `C:\\Users\aguy\randomfolder\pip.exe  install botc_tokens` etc.

The difference:

Command Prompt
pip install botc_tokens

Python code/python interpreter:

    # This hashtag makes a comment that does nothing to the code       import os # A python library that allows us to interact with the system      command = 'pip install botc_tokens' # This is what we are running                   os.system(command)

Obviously please use command prompt not the silly python interpreter solution. This is just to show the difference.

Edit: I can't seem to make the code block render on multiple lines. So sorry about that, hopefully you still understand my point however.

1

u/PaperHandsProphet Feb 01 '25

Download warp shell which has AI claude built in. Then ask it to install it for you and it will.

https://www.warp.dev/

1

u/crashfrog04 Feb 02 '25

Can someone please provide a step-by-step guide on how I actually use Python to execute this command?

Yeah, the guy who wrote it can. This is a subreddit for people who want to learn to program in Python but you don't; you just want tech support for this other guy's code. For free. Why are you coming to us in the first place?

I can't figure out how to navigate Python to the root directory.

That isn't a thing. You navigate your shell to the directory, not Python.

2

u/Vertinova Feb 02 '25

found the stackoverflow user

1

u/crashfrog04 Feb 02 '25

It’s not a tech support sub