pythonvirtualenvpackageinstaller

How can I install python packages in a virtual environment?


I am trying to use virtualenv. I used this command to install the package: pip install virtualenv Then I create a folder using this command: python -m venv venv Now I want to use django package in this environment. What should should do? I got this error message: Could not install packages due to an OSError: HTTPSConnectionPool ...

how to install any package in virtualenv


Solution

  • You can activate virtual environment: on windows use venv\scripts\activate

    Or on Unix or Mac you can use source venv\bin\activate

    Then install django

    and if You are getting error message OSError: HTTPSConnectionPool Then it might be due to your internet connectivity problem. Or You can try to upgrade pip by pip install --upgrade pip