I set up a venv for a project, activated it and all on my laptop while at uni. Then i saved it and create a repo for it (venv and project included in the repo). Now at my home desktop i when i cloned my repo it just gives an error because the packages i installed with pip in my laptop just are not present, for i usually never download any global env packages. Is it something im doing wrong?
#๐ venv not carrying pip packages from clonning repos
24 messages ยท Page 1 of 1 (latest)
@small rose
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.
Closes after a period of inactivity, or when you send !close.
whats the error?
nothing, just says that the packages are not installed
Did you activate your venv?
i activated the venv and all, in my laptop when i first created and installed the packages locally, it worked just fine. After i uploaded it to a repo and cloned in my home desktop it just doesnt seem to be installed anymore. Dont know if this is normal behaviour or not, suppose it isnt
yeah:
On your home desktop, did you activate your venv?
Run pip list or py -m pip list and show me the output
what package is missing?
yeah. so much so that in my laptop if i try to import one of the packages outside of the venv i also cant, but they work just fine inside the venv
one problem at a time
$ pip list
Package Version
------- -------
pip 24.0
[notice] A new release of pip is available: 24.0 -> 24.1
[notice] To update, run: C:\Users\Aron\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip
yeah so its not showing in the .venv
OK change your workflow. Don't upload the .venv folder to the repo
On your laptop do py -m pip freeze > requirements.txt
Then upload requirements.txt to your repo
Then pull requirements.txt from your repo on your desktop PC
Then activate/create a venv, then pip install -r requirements.txt
Then the whole thing should work
Thats the better env workflow practice
ok ill do that, much thanks!
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.