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
#1
Please see error codes below


C:\cicdbuzz>dir
Volume in drive C is OS
Volume Serial Number is 6465-B18E

Directory of C:\cicdbuzz

07/08/2019 20:15 <DIR> .
07/08/2019 20:15 <DIR> ..
06/08/2019 08:18 <DIR> buzz
06/08/2019 07:38 507 OS © - Shortcut.lnk
07/08/2019 20:13 1,414,720 pip-19.2.1-py2.py3-none-any.whl
06/08/2019 14:33 <DIR> virtualenv-16.7.2
2 File(s) 1,415,227 bytes
4 Dir(s) 918,918,098,944 bytes free

C:\cicdbuzz>python get-pip.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\cicdbuzz>python get-pip-19.2.1-py2.py3-none-any.whl
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\cicdbuzz>get-pip-19.2.1-py2.py3-none-any.whl
'get-pip-19.2.1-py2.py3-none-any.whl' is not recognized as an internal or external command,
operable program or batch file.

C:\cicdbuzz>get pip-19.2.1-py2.py3-none-any.whl
'get' is not recognized as an internal or external command,
operable program or batch file.

C:\cicdbuzz>get-pip.py
'get-pip.py' is not recognized as an internal or external command,
operable program or batch file.

C:\cicdbuzz>pip-v
'pip-v' is not recognized as an internal or external command,
operable program or batch file.



Also get these errors – user366006 50 mins ago




C:\cicdbuzz>get-pip.py 'get-pip.py' is not recognized as an internal or external command, operable program or batch file. C:\cicdbuzz>pip-v 'pip-v' is not recognized as an internal or external command, operable program or batch file. – user366006 50 mins ago

C:\cicdbuzz>virtualenv venv
'virtualenv' is not recognized as an internal or external command,
operable program or batch file.

C:\cicdbuzz>dir
Volume in drive C is OS
Volume Serial Number is 6465-B18E

Directory of C:\cicdbuzz

06/08/2019 14:35 <DIR> .
06/08/2019 14:35 <DIR> ..
06/08/2019 08:18 <DIR> buzz
06/08/2019 07:38 507 OS © - Shortcut.lnk
06/08/2019 14:33 <DIR> virtualenv-16.7.2
1 File(s) 507 bytes
4 Dir(s) 919,497,621,504 bytes free

C:\cicdbuzz>source venv/bin/activate
'source' is not recognized as an internal or external command,
operable program or batch file.
Reply
#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


Possibly Related Threads…
Thread Author Replies Views Last Post
  python -m venv VS virtualenv kazi380 4 2,940 Jul-17-2019, 08:51 PM
Last Post: Larz60+
  Virtualenv and an infinitely spooling interpreter? eblade 3 2,643 Jul-11-2019, 06:58 PM
Last Post: eblade
  Why is virtualenv not by default relocatable? bpostow 1 2,201 Mar-08-2019, 06:57 PM
Last Post: bpostow
  opencv without virtualenv tony1812 0 3,024 Jan-20-2018, 12:42 AM
Last Post: tony1812
  virtualenv activate.ps1 hash error po20 2 3,761 Jan-13-2018, 09:21 AM
Last Post: po20
  virtualenv on powershell mcmxl22 3 6,315 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