In my last post, I covered some compelling reasons why network engineers should consider adding Python to their skillset. I want to be clear, however, that the goal isn’t to become a Python developer. The goal is to be a network engineer who can use Python to help build and administrate networks.

What I mean is that Python should be a tool in the network engineer’s arsenal. In the same way we don’t dissect EIGRP TLVs when considering network design, we don’t need to learn and remember everything there is to know about Python. That’s why having a goal is so important; knowing when to stop is as important as knowing how to start.

Great! I’m On Board! What’s Next?

When I started this journey, I took into consideration what I knew already and what the lowest barriers to entry were, to focus on what I was actually trying to learn. For me, that meant using a development environment I think lends itself a little easier to things like creating Python virtual environments, organizing folders and handling package installs as well as code commits so I could document my progress (for accountability as well as posterity).

I use Windows, so I settled on creating a Linux VM. I found through trial and error that I didn’t like coding on Windows. It has a hacked-in feel, a lot of the Python stuff ends up feeling like a Linux emulator.

Now, if you have Windows 10 you can actually use WSL. I’ve heard the Windows Subsytem for Linux is pretty good, but as a long-time labber I already have my own setup. I’ll show what I did, but there are a lot of ways to get there. It’s more important to do something than agonize over doing anything.

VMWare Workstation Player + Ubuntu Desktop 20.04

I’ve been labbing a long time. In fact, the words, “Always Be Labbing” are near and dear to me. So I have a lot of experience with setting up VMs on my computers, usually to run some sort of network simulator. For me, using VMWare Workstation Player was the smallest lift. It’s also free to download and use.

VMWare Player is free to download and use.

After installing VMWare Player, I downloaded the ISO file for my favorite Linux distribution, Ubuntu. I used Ubuntu Desktop in this case because I wanted to be able to use Postman (for testing API calls), a web browser (for signups to free online APIs and other resources), and PyCharm CE (for coding). I did have to add some extra resources to go with the Desktop versus Server version, but again, I am focused on Python here and I wanted ease of setup, ease of use concerning Python and the tools.

This might actually be more than I needed.

If you’ve never created a VM using VMWare Player before, what follows is the lightning-round walkthrough.

Click Create a New Virtual Machine and browse to the Ubuntu ISO you downloaded.

Fill out things like names and passwords on the next screen, then continue on.

Give the VM a name and decide where the disk should be stored on your host machine.
I would allocate 20-30Gb to the hard drive. I store the disk as a single file but there is no harm in splitting them.
Customize the hardware as shown above if you can spare it, otherwise the defaults should be fine.
In most cases this network setting is all you need. If this doesn’t give your VM internet access, you may have to try one of the others.
Hopefully this is what you see next!

After the install runs, check for Internet access via the Terminal. The Terminal is not pinned by default but it is really important to the Python setup.

After clicking through the notices and privacy questions, go to Show Applications at the bottom left:

Make sure to add Terminal to favorites to pin it on the taskbar.

At this point, if you aren’t great with Linux yet, no worries. The priority is to update/patch the OS which should pop up automatically and allow you to install via a menu.

If you know how to use Ubuntu’s package manager (APT), you already know how to install Postman, Pycharm CE and whatever web browser you want (Ubuntu Desktop comes with Firefox) from the terminal. Otherwise read on for the Linux Newbie version.

Before installing new programs/packages, always make sure the OS is up to date.
Open the Ubuntu Software window and search for PyCharm. Install PyCharm CE.
Don’t forget to pin to the taskbar!

Do the same for Postman and any web browser you may want besides Firefox (if needed).

Now we’re cooking! But we aren’t quite ready to start coding yet.

In my next post, I’ll cover creating a Python virtual environment (kind of like Python containers) and how to set up a GitHub repository to commit the code!

By the way, the first 15 days or so of the 100 Days of Code course uses an online web-based code platform called Repl.it. You can get started coding weeks before having to set up a dev environment, so don’t let the lack of a dedicated platform stop you from starting in the meantime.


1 Comment

#100DaysofCode: Python Virtual Environment and GitHub | Carpe DMVPN · March 12, 2021 at 1:28 pm

[…] post, I covered why network engineers should consider investing time and energy into Python. In the second post we got started building a Python development environment focused on ease of use and setup so the […]

Comments are closed.