I’ve been trying to code python on my deck and I can’t for the life of me figure out how to activate the virtual environment. I keep using “source .venv/bin/activate” and it does nothing. No errors, no feedback, doesn’t hang, doesn’t use the environment, nothing.
I’ve tried installing Kitty to see if it was an issue with Konsole but the exact same thing happens. It works fine in Visual Studio Code but I do t want to have to open that every time I try and run a command.
Anyone know why this could be or what I could do to fix it?
Edit to add: This is my first real attempt at Linux idk what I’m doing in a very broad way. Only other time I tried was nearly 15 years ago dual booting Windows/Ubuntu but that lasted like a week because Windows kept blowing up the config and I needed some Windows only programs for school
Solved edit: I don’t exactly know what was up. If I made the venv with the terminal, it would work in the terminal but not work with VSCode’s terminal. If I made it in VSCode it would work in VSCode’s terminal but not the normal terminal. I uninstalled VSCode, made the venv in the Konsole terminal, and everything seems to work fine through PyCharm instead.
I think VS Code is doing its own thing and it might be better if you create your own. It doesn’t have to be called .venv, that is just a VS Code convention.
python -m venv myenv
and then
source myvenv/bin/activate
should do it.
Otherwise there is something wrong in your path or a weird python installation.
python --version
should give you a version number 3.4 or above, because these have venv included and need no additional pip installs