[Python] Can we create a venv for python and use that venv in other folders in VSCode, Windows...

Discussão em 'Python' iniciado por Stack, Julho 12, 2025.

  1. Stack

    Stack Membro Participativo

    • Operating System: windows10
    • editor: VSCode (installed extensions: python, Code Runner.)
    • Python installed on my machine: 3.9.0

    1- My project is in this folder "D:\darsy\Python\Learning\Code with Mosh - The Complete Python Programming Course for Beginners 2019-4\11- Popular Python Packages\code\7- Web Scraping\PyCrawler2"

    2- I have app.py in this folder

    3- I opened this folder in VSCode.

    4- I opened VSCode terminal and run this command: D:\darsy\Python\Learning\Code with Mosh - The Complete Python Programming Course for Beginners 2019-4\11- Popular Python Packages\code\7- Web Scraping\PyCrawler2> pipenv install requests

    5- so I have a venv in this directory: "C:\Users\Acer.virtualenvs\PyCrawler2-RWWuk_HY"

    6- I changed my python interpreter in VSCode to this venv.

    7- I write this code in my app.py file

    import requests


    8- in VSCode terminal, I run this command:

    D:\darsy\Python\Learning\Code with Mosh - The Complete Python Programming Course for Beginners 2019-4\11- Popular Python Packages\code\7- Web Scraping\PyCrawler2> python app.py

    9- I got this error: ModuleNotFoundError: No module named 'requests' .

    why? I have installed requests package in my venv.

    I think it's not specific to this package. any package I install and want to use I get this issue.

    Thanks for your helps in advance.

    Continue reading...

Compartilhe esta Página