In Old Days, We Used Cygwin to use Windows Like unix. Now, as Windows officially has ways to configure and run terrminal, it is easy. Here is an Example of How to Use Windows 10 Like Ubuntu With Step by Step Guide to Install Python, pip on Windows 10 From Bash Like SSH. From this guide, we can direct the readers with Windows 10 to follow our Ubuntu server guides on Data Sciences and sysadmin works.
Install Python, pip on Windows 10 From Bash (Like Ubuntu)
Launch the Bash. First update, upgrade :
1 2 | apt update apt upgrade |
Then check if Python installed :
---
1 | which python |
The below set of commands will install Python & pip from Ubuntu repository which is too old (version 2.7) :
1 2 3 4 | apt install curl wget apt install python-setuptools python-dev build-essential python-pip pip install --upgrade pip pip install --upgrade virtualenv |
If you run :
1 | python --version |
You’ll get output like :
1 | Python 2.7.12 |
Often we need both Python 2.x and Python 3.x. For latest Python, we should do these steps. Add this repo :
1 | sudo add-apt-repository ppa:jonathonf/python-3.6 |
Then run update :
1 | sudo apt update |
Then install Python 3.6 :
1 | sudo apt install python3.6 |
Then :
1 | curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6 |
Run to check :
1 | python3 --version |
Python 2.x will be the default installation. To switch the system to Python 3.x there needs to be done a piece of work, consisting of updating and re-testing all the scripts. You can’t just “switch” your system to Python 2.7 and delete the older version for the sake of existence of older scripts. Just remember to launch your scripts with python3
and use #!/usr/bin/env python3
shebang line.
So this will work to evoke help of Python 2.x :
1 | python --help |
This will work to evoke help of Python 3.x :
1 | python3 --help |
I guess the above writing is meaningful to the new users. This step often not written in many guides :
1 2 | sudo apt -y install python3-pip pip3 install --upgrade pip |
Without the above (pip for Python 3), bash behaviour becomes unpredictable upon pip3 command.
Now who are around data science, they can follow guides which are originally intended for Mac and GNU/Linux users like Jupyter Notebook Tutorial. In short, in that guide we ran :
1 2 | sudo -H pip3 install jupyter # the above will take some time |
Run :
1 2 3 4 | # if you are root user jupyter notebook --allow-root # if you are non-root jupyter notebook |
And open http://localhost:8888
on browser. You will see how nicely Jupyter is running on Windows 10 exactly like Mac or GNU/Linux.