Python 3, an Illustrated Tour Transcripts
Chapter: Virtual Environments
Lecture: Walk-through: Virtual Environments and Pip (PyCharm)

Login or purchase this course to watch this video and the rest of the course contents.
0:00 In this video I'm going to show how to use PyCharm to run the venv test file. I'm going to use the environment that we created using pipenv.
0:08 So I'm going to say create new project, it's going to be a pure Python project and it's going to point to the labs folder where I have the labs
0:15 and note I'm going to say use an existing interpreter. PyCharm will happily create a new virtual environment for us
0:22 if we want to, but we're going to use an existing one, so we have to click the little gear here and say add local
0:27 and let's make sure that we use the right one. So I'm going to go into my home directory
0:34 and I'm going to go to my .local and in my shared directory there is labs and note that it's looking for the Python executable there
0:45 so I need to come down here and click on Python right here. Okay, at this point, I'll hit create and it will say the directory labs is not empty,
0:54 would you like to create a project from existing sources? Yes, let's do that. Great. Here's the file right here. Let's run this and see if it runs.
1:05 So to run it, it's going to index, we'll let it index for a while. Okay, now let's run this here.
1:13 So I'm going to say run venv test, and it looks like it ran, note that it said it used the virtual environment Python to run it and it ran it
1:23 and the test imports pytest so it looks like pytest is working. This video showed how to use PyCharm to create a new project
1:32 using an existing pipenv environment and to run a test, note that I can also right click here and say run test again and it will run it again.

Talk Python's Mastodon Michael Kennedy's Mastodon