1) How to install Python / Pip on Windows 7 (or 8)
How to install Python / Pip on Windows 7 (or 8)
- Download the MSI installer from http://www.python.org/download/. Select 32 bit or 64 bit based on the System Settings which opens by pressing Win+Break
- Run the installer. Be sure to check the option to add Python to your PATH while installing.
- Open PowerShell as admin by right clicking on the PowerShell icon and selecting ‘Run as Admin’
- To solve permission issues, run the following command:
Set-ExecutionPolicy Unrestricted
- Enter the following commands in PowerShell to download the bootstrap scripts for
easy_install
andpip
:mkdir c:\envs cd c:\envs (new-object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/ez_setup.py', 'c:\envs\distribute_setup.py') (new-object System.Net.WebClient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'c:\envs\get-pip.py') python c:\envs\distribute_setup.py python c:\envs\get-pip.py
Once these commands run successfully, you can delete the scriptsget-pip.py
anddistribute_setup.py
HTTP Issue with distribute_setup.py?[Updated 2015-03-05] The script distribute_setup is no longer available at its old location. Thanks to Rudhra for sharing the new location. - Now typing
easy_install
orpip
should work. If it doesn’t it means the Scripts folder is not in your path. Run the next command in that case (Note that this command must be run only once or your PATH will get longer and longer). Make sure to replacec:\Python33\Scripts
with the correct location of your Python installation:setx PATH "%PATH%;C:\Python33\Scripts"
Close and reopen PowerShell after running this command. - To create a Virtual Environment, use the following commands:
cd c:\python pip install virtualenv virtualenv acme .\acme\Scripts\activate.ps1 pip install IPython ipython3
That’s it! I suppose the same steps work for Windows 8 as well. But I don’t have a machine to try it out. Do let me know if this worked for you.
Now set PATH as below
setx PATH "%PATH%;C:\Python33\Scripts"
Comments
Post a Comment