thank you very much for your effort I have a problem , I create a python file then I create a venv in the bash terminal , then I download a backage in the venv after activation ,and then install and import a backage in the python file , but it give an error to the package import , then I run the code by the terminal test.venv\Scripts\python.exe and then the path of the python file I created in vscode of python , and yes the code is run in the terminal but still give me an error in the python file in vscode . how could I change the directory of the file to this specific env ??when io ever I sat run it will run it in the master pyton interpreter and not in the env pls help me I have tons of files I need to move them in venv and I don't know how .
This depends on how you are running the Python file. You can run the Python file in VSCode by clicking the Play button, or you can type in the terminal "python MyPythonFile.py" and press Enter. but change the MyPythonFile.py part to the actual name of your python file. you mentioned that, yes it is run in the terminal, but it gives you an error in vscode probably because you use the Play button and the VSCode is not set to use the virtual environment. so do this: go to VSCode. and you see in my video at 11:40 ? in the bottom left or the bottom right where it says the Python version number, click on it and then you will see a menu pops up to choose your environment. so you type in test.venv/Scripts/python.exe
Absolute fucking legend!! been looking for this for like 10 mins already
Thank you...awesome.
Miami dade college !
thank you very much for your effort
I have a problem , I create a python file then I create a venv in the bash terminal , then I download a backage in the venv after activation ,and then install and import a backage in the python file , but it give an error to the package import , then I run the code by the terminal
test.venv\Scripts\python.exe and then the path of the python file I created in vscode of python , and yes the code is run in the terminal but still give me an error in the python file in vscode . how could I change the directory of the file to this specific env ??when io ever I sat run it will run it in the master pyton interpreter and not in the env
pls help me I have tons of files I need to move them in venv and I don't know how .
This depends on how you are running the Python file. You can run the Python file in VSCode by clicking the Play button, or you can type in the terminal "python MyPythonFile.py" and press Enter. but change the MyPythonFile.py part to the actual name of your python file.
you mentioned that, yes it is run in the terminal, but it gives you an error in vscode probably because you use the Play button and the VSCode is not set to use the virtual environment. so do this: go to VSCode. and you see in my video at 11:40 ? in the bottom left or the bottom right where it says the Python version number, click on it and then you will see a menu pops up to choose your environment. so you type in test.venv/Scripts/python.exe
@@jfleischer omg thank a thousand time
It did run the file in the venv thank you again 💓
@@mssafy2592 fantastic