Python Forum
Installing PIP and setting up virtualenv
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing PIP and setting up virtualenv
#2
Follow this first(install Python 3.7) so pip and python work from command line(cmd), Python 3.6/3.7 and pip installation under Windows

Virtual environment in build into Python(no install) trough venv.
Here is run:
# Test python
C:\>python -c "import sys; print(sys.executable)"
C:\python37\python.exe
 
# Test pip
C:\>pip -V
pip 19.0.3 from c:\python37\lib\site-packages\pip (python 3.7)
 
# Make virtual environment 
C:\1>python -m venv test_env
 
# Cd in
C:\1>cd test_env
 
# Activate environment 
C:\1\test_env>C:\1\test_env\Scripts\activate
 
# Test python again,see now that it point to environment folder
(test_env) C:\1\test_env>python -c "import sys; print(sys.executable)"
C:\1\test_env\Scripts\python.exe
 
# Test pip,see that it point to environment folder
(test_env) C:\1\test_env>pip -V
pip 19.0.3 from c:\1\test_env\lib\site-packages\pip (python 3.7)
 
# Will now only install to environment 
(test_env) C:\1\test_env>pip install requests
Collecting requests
......  
Installing collected packages: urllib3, certifi, chardet, idna, requests
Successfully installed certifi-2019.3.9 chardet-3.0.4 idna-2.8 requests-2.21.0 urllib3-1.24.2
 
# Test that it work
(test_env) C:\1\test_env>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> exit()
 
(test_env) C:\1\test_env>
If using virtual environment for Editor/IDE setup to use python.exe in environment.
Eg a good Editor is VS Code from start.
Reply


Messages In This Thread
RE: Installing PIP and setting up virtualenv - by snippsat - Aug-08-2019, 05:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python -m venv VS virtualenv kazi380 4 2,948 Jul-17-2019, 08:51 PM
Last Post: Larz60+
  Virtualenv and an infinitely spooling interpreter? eblade 3 2,649 Jul-11-2019, 06:58 PM
Last Post: eblade
  Why is virtualenv not by default relocatable? bpostow 1 2,203 Mar-08-2019, 06:57 PM
Last Post: bpostow
  opencv without virtualenv tony1812 0 3,027 Jan-20-2018, 12:42 AM
Last Post: tony1812
  virtualenv activate.ps1 hash error po20 2 3,766 Jan-13-2018, 09:21 AM
Last Post: po20
  virtualenv on powershell mcmxl22 3 6,317 Feb-08-2017, 06:29 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020