How to pip install Python Modules in VSCode


VSCode pip command example

If you have a Python project that you are working on in VS Code and want to import a module using pip, follow the below steps,

  1. Open Terminal,
  2. Create Virtual Environment (.venv),
    Mac/Linux: python3 -m venv .venv
    Windows: py -3 -m venv .venv
  3. Press yes when you see the notice: "We noticed a new virtual environment has been created. Do you want to select it for the workspace folder?"
  4. Now you can install Python modules using pip (pip3) command.


Have Questions? Post them here!
Advertisements
Try Out Code2care Dev Tools:

Advertisements

Advertisements
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.