#π python run
137 messages Β· Page 1 of 1 (latest)
@orchid isle
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
This probably means there was an error
the terminal doesn't keep itself open for long enough for you to read what went wrong
you should open the python file via the terminal
@orchid isle
@rich forge
but it works with my friend
what happens when you run from vscode
yes but it could be a number of differences between your systems
for example installed libraries and stuff like that
You generally can't execute a Python file by double-clicking it.
For the regular way you would first need to activate your venv. Creating the venv: https://docs.python.org/3/library/venv.html#creating-virtual-environments
python -m venv /path/to/new/virtual/environment
For Windows this will usually be:
py -m venv .\.venv
Then to activate it:
- Windows:
.venv\Scripts\activate
You'll see that the venv is activated by the text in front of your line, like e.g. here (I'm on Linux so the command looks a bit different here):
That's step 1. Now for step 2, you'll want to type:
py /path/to/source/file
and you may need to install some library installs with
py -m pip install <pip_package>
*Step 0 is making sure you have a Python implementation installed
where i have to write this?
python -m venv /path/to/new/virtual/environment
pip install requests
install what?
Before executing this -
Can you show the whole folder, what other files are there in ur current folder?
The python module name requests
Open a cmd and run pip install requests
how can i install it
β¦
Humβ¦. Do you have python??
do you have python installed?
yes
In path ?
reinstall it would be easier for you if u dont know how to add the interpreter in the path
i do it
it dosent work
?
during installation did you checked the "Add to path" option
K
uninstall then reinstall
Yes
π
And make sure clicking this
Then run the same command you did before plz
generally packages are not recommend to be installed globally -
Before executing your file store it in a folder
and use the python -m venv .venv command - this would make new and separate interpreter
Honestly for a little project like this, it would just complicate thingsβ¦
y
interesting.. it popped up during installation?
true..
But if you want huh I donβt to contradict U
wait pymanager? never heard of it.
Me neither
β¦ok
pymanager is not needed tho if i am not wrong
And what would happen if you type pip install requests in a cmd ?
you just need the interpreter
what version i have to install
You already have it
everything's good.
i delete every thing
now check in terminal
3.13?
i have to write this?
yes
Nah sorry open a new cmd, type it, and press enter
Without typing python before
its installed
No run your file
no or now?
ok
probably there are other packages like requests, u have to instll one by one
how can i install it
K now reopen a cmd, so do pip install colorama
there is a neat solution, if ur friend provided a requirements.txt file
i install it
And now ?
still
these are the packages u need to install
what i have to type
okay
.
what image
.
No just colorama and requests can be pip installed, the rest is preibstalled with python
wait configparser preinstalled?
i dont know what i have to do now
@orchid isle plz record again your screen when you run the file
I think so
Yes
?
okay thank you
thank you all for helping
@royal frigate @pure ibex @rich forge@wispy peak
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.