#πŸ”’ python run

137 messages Β· Page 1 of 1 (latest)

broken prawnBOT
#

@orchid isle

Python help channel opened

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.

rich forge
#

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

orchid isle
#

@rich forge

orchid isle
rich forge
rich forge
#

for example installed libraries and stuff like that

wispy peak
#

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

orchid isle
#

python -m venv /path/to/new/virtual/environment

royal frigate
#

The error is "module not found : "requests”"

#

So try to install it

pure ibex
#

pip install requests

orchid isle
pure ibex
#

Before executing this -

Can you show the whole folder, what other files are there in ur current folder?

royal frigate
#

Open a cmd and run pip install requests

orchid isle
royal frigate
orchid isle
#

like this?

#

@royal frigate

royal frigate
#

Hum…. Do you have python??

pure ibex
#

do you have python installed?

orchid isle
#

yes

royal frigate
#

In path ?

pure ibex
#

reinstall it would be easier for you if u dont know how to add the interpreter in the path

orchid isle
pure ibex
#

during installation did you checked the "Add to path" option

orchid isle
#

i will reinstall it

royal frigate
#

K

pure ibex
#

uninstall then reinstall

royal frigate
#

Yes

orchid isle
royal frigate
#

Then run the same command you did before plz

orchid isle
#

?

pure ibex
#

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

orchid isle
#

@pure ibex

#

@royal frigate

royal frigate
royal frigate
pure ibex
royal frigate
orchid isle
#

icant del this version

#

3.14.2

pure ibex
#

wait pymanager? never heard of it.

royal frigate
#

Me neither

orchid isle
#

i install it from here

royal frigate
#

…ok

pure ibex
#

pymanager is not needed tho if i am not wrong

royal frigate
#

And what would happen if you type pip install requests in a cmd ?

pure ibex
#

you just need the interpreter

orchid isle
#

what version i have to install

royal frigate
#

You already have it

pure ibex
orchid isle
#

i delete every thing

pure ibex
#

now check in terminal

orchid isle
#

3.13?

pure ibex
#

it should work

orchid isle
pure ibex
#

its working, now install the requests lib

#

pip install requests

orchid isle
pure ibex
#

yes

orchid isle
pure ibex
#

first exit the shell

#

ctrl + z

royal frigate
orchid isle
royal frigate
#

Without typing python before

orchid isle
#

okay

pure ibex
#

its installed

royal frigate
#

No run your file

orchid isle
royal frigate
#

Now

#

Sorry

orchid isle
#

ok

orchid isle
#

still

pure ibex
#

probably there are other packages like requests, u have to instll one by one

orchid isle
#

how can i install it

royal frigate
#

K now reopen a cmd, so do pip install colorama

pure ibex
#

there is a neat solution, if ur friend provided a requirements.txt file

orchid isle
royal frigate
#

And now ?

orchid isle
#

still

pure ibex
#

these are the packages u need to install

orchid isle
#

what i have to type

pure ibex
#

pip install [package]

#

this is the format

orchid isle
#

okay

pure ibex
#

in the image u see inport

#

the words after the import are the names of packages

orchid isle
pure ibex
#

try all of them

#

πŸ€¦β€β™‚οΈ

pure ibex
orchid isle
#

what image

royal frigate
# pure ibex .

No just colorama and requests can be pip installed, the rest is preibstalled with python

pure ibex
#

wait configparser preinstalled?

orchid isle
#

i dont know what i have to do now

royal frigate
#

@orchid isle plz record again your screen when you run the file

royal frigate
orchid isle
royal frigate
orchid isle
#

?

pure ibex
#

send me the file..

#

if its not something private

orchid isle
#

i cant

#

you have to add me

#

i cant add you

pure ibex
#

wait

#

i send u rqst

royal frigate
#

Well good luck πŸ‘‹

#

If you need any help on this, dm

orchid isle
#

thank you all for helping
@royal frigate @pure ibex @rich forge@wispy peak

broken prawnBOT
#
Python help channel closed using Discord native close action

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.