From the course: Python Data Analytics: From Notebooks to Production

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Solution: Create an environment

Solution: Create an environment

(upbeat music) - [Instructor] Let's have a look at my solution. So there is a requirement for the production requirement with lxml, numpy, and pandas. And there's development requirements, which has pytest. And I'm also going to use pytest-ruff to check for common errors in the code. So, cd Ch04/solution. And first, we are going to create the virtual environment. So python -m venv .venv. And now because I'm going to run several commands, I'm going to source .venv/bin/activate. And now, my Python is the one from the virtual environment. Now I'm going to install, so python -m pip install -r dev-requirements. This is going to install both production and development. And finally, now I can run the tests. So python -m pytest -v. And we see that the tests are passing now.

Contents