Learning to Use Python with Windows Coming from Unix

Recently I purchased an Acer gaming laptop loaded with Windows 10. I was really attracted to the quality of the hardware vs the price. The hard part would be moving off of the Unix type environment I’ve been used to. Adjusting to Windows took a little tweaking on my part. My goal was to get my workflow as similar as possible with the least amount of effort. I didn’t want to have to deal with the Bash on Ubuntu on Windows conncector.

Getting my Python setup going

I started by downloading the python-3.7.9.msi file from https://www.python.org/downloads/ and completing the wizard. Be sure to select the option for having it included on the system path. Once Python was installed the next step was to figure out how to get going with Pip

Using the default setup on windows, to perform Python incantations

python -m

Such as to invoke pip

python -m pip install requests

Or when spinning up a virtualenv

python -m venv venv

But you don’t have to use the -m flag to run a script

python myscript.py

A difference in how virtualenv works

Something noticable when moving between these platforms is that on windows the activate files are moved into venv/Scripts/activate vs on MacOS or Ubuntu venv/bin/activate

For compatibility, install GitBash

You can use git bash to do a bunch of this stuff too so it is much more Unix style When you open git bash run as administrator and make a new .bashrc file in the ~ directory

include things there like

export PATH=$PATH:/c/Python37/
export PATH=$PATH:/c/Python37/Scripts

Install the more cross-platform windows terminal

There is an app available from Microsoft that modernizes the terminal quite a bit and makes it much more similar to a linux of mac terminal, including support of commands like ls It can be found here https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701#activetab=pivot:overviewtab