#๐Ÿ”’ venv

50 messages ยท Page 1 of 1 (latest)

atomic zephyr
#

i need help making a venv file and getting it to work if someone can help me it whould be great

stable agateBOT
#

@atomic zephyr

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.

old bloom
#

yeah what's the problem

atomic zephyr
#

PS> py -m venv venv\ i ran this command

#

then it says it should be put at this location C:\Users\Name\AppData\Local\Programs\Python\Python312\python -m venv venv\

old bloom
#

can you send exactly what it says

atomic zephyr
#

wdym

atomic zephyr
#

should i move it myself to python312 or should i keep it here at name?

old bloom
#

but what makes you say that it should be put here C:\Users\Name\AppData\Local\Programs\Python\Python312\python

#

This is the python installation folder it looks like

#

the venv shouldn't go here

#

It should go in your project folder

atomic zephyr
old bloom
#

hmm lemme have a look

#
You can bypass the launcher and run the Python executable directly using the python command, but if you havenโ€™t configured the PATH and PATHEXT variables, then you might need to provide the full path:

PS> C:\Users\Name\AppData\Local\Programs\Python\Python312\python -m venv venv\
The system path shown above assumes that you installed Python 3.12 using the Windows installer provided by the Python downloads page. The path to the Python executable on your system might be different. 

This is saying that you might need to provide a full path to the python executable hence C:\Users\Name\AppData\Local\Programs\Python\Python312\python <rest of the command>

#

but this is the same as py -m venv ... or python -m venv ...

#

The venv should go in the folder that you are planning to do your project in

#

c:\user\name\Documents\python_project For example I would put the venv here

atomic zephyr
#

i wasnt planning on making a project i was told this ts recommended to, unless whatever you install will go to your global python install and lead to conflicts between projects eventually.

old bloom
#

from personal experience, i'm not sure this is actually a big problem

#

venvs are nice so that you can package all of the required project dependencies in one place, if you decide to later publish the code

#

I wouldn't really worry about it if you are starting out

atomic zephyr
#

i was just asking in discussion if i had the correct mysql package and was told to look in my env file

#

but im not rly publishing anything right now just trying to learn the syntex and stuff

#

so then i can skip the venv file

old bloom
#

I mean you can still set up the venv, even if you're not making a "project"

atomic zephyr
#

is it like the .env file in laravel?

old bloom
#

no the .env file stores values

#

Like um api keys and configuration settings

#

the venv folder is a python thing that allows you to keep installed packages separate from each other

atomic zephyr
#

oke so that packages wont be in 2 projects when i just need it in 1

old bloom
#

yes but it's not normally an issue if you have installed a bunch of libraries into your global interpreter

#

sometimes you can have issues if a library you are using requires an older version of a certain library, and another project requires a new one

#

things like that

atomic zephyr
#

oke then imma just leave it for now and maybe return to it sometime in the future ty for your help man

old bloom
#

okay no worries

atomic zephyr
#

wait 1 more thing where do i run this in my database folder or in a normal powershell at C:?

#

pip install mysql-connector-python

old bloom
#

it doesn't matter where because pip will always install to the libraries folder of whatever interpreter you have active

#

if you have a venv active, it will install to the venv

#

if you have a global python interpreter active, it will install there

#

it doesn't install relative to whatever folder you're currently in

atomic zephyr
#

oke ty

#

.close

drowsy raftBOT
#
Did you mean:
atomic zephyr
#

/close

#

!close

stable agateBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.