#๐ venv
50 messages ยท Page 1 of 1 (latest)
@atomic zephyr
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.
yeah what's the problem
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\
can you send exactly what it says
wdym
it should be here but for me its at c:\user\name
should i move it myself to python312 or should i keep it here at name?
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
someone told me to follow this guide
https://realpython.com/python-virtual-environments-a-primer/#how-can-you-work-with-a-python-virtual-environment
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
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.
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
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
I mean you can still set up the venv, even if you're not making a "project"
is it like the .env file in laravel?
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
oke so that packages wont be in 2 projects when i just need it in 1
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
oke then imma just leave it for now and maybe return to it sometime in the future ty for your help man
okay no worries
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
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
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.