File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 11# Managing a different Python interpreter  
22
3+ ``` {versionadded}  22.3
4+ ``` 
35
46Occasionally, you may want to use pip to manage a Python installation other than
57the one pip is installed into. In this case, you can use the ` --python `  option
@@ -16,22 +18,12 @@ environment.
1618One example of where this might be useful is to manage a virtual environment
1719that does not have pip installed.
1820
19- ```` {tab}  Unix/macOS
20- ```{code-block} console 
21+ ``` {pip-cli} 
2122$ python -m venv .venv --without-pip 
22- $ python -m pip --python .venv install SomePackage 
23- [...] 
24- Successfully installed SomePackage 
25- ``` 
26- ```` 
27- ```` {tab}  Windows
28- ```{code-block} console 
29- C:\> py -m venv .venv --without-pip 
30- C:\> py -m pip --python .venv install SomePackage 
23+ $ pip --python .venv install SomePackage 
3124[...] 
3225Successfully installed SomePackage 
3326``` 
34- ```` 
3527
3628You could also use ` --python .venv/bin/python `  (or on Windows,
3729` --python .venv\Scripts\python.exe ` ) if you wanted to be explicit, but the
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments