There are so many different Python guides like this, it always reminds me of The Rifleman’s Creed from Full Metal Jacket. (“This is my rifle {python guide}. There are many like it, but this one is mine…”) Anyhow, here we go…
I’ve had a number of people (lab mates, friends, family, students) ask me how to get started with Python. Here’s what I recommend to them.
Installing Python
- Install Anaconda Python. Use Python 3.x. Anaconda gives you a few things that make it easier to get started. It’s a package of Python and some tools so you don’t need to go install things individually.
- Add Anaconda to Windows Environmental Variables
- Search for Advanced System Settings menu
- Click on Environmental Variables in bottom right corner
- Click and Edit “Path” category
- Navigate to where Python is on your PC (The goal is to select the python.exe file.)
- Restart computer to update environmental variable.
- Open Command Prompt and type “python”. If no error, python path is correct.
*See the end of this page for abnormal issues/solutions I encountered.
Getting Started with Python
- Writing Python code (editor): I recommend using Spyder, an IDE that installs with Anaconda by default. Just search your programs for “Spyder” and start writing.
- If you already know how to code, I’d recommend just jumping in and figuring it out as you.
- If you don’t know how to code, I’d recommend taking a course from Coursera. Find one that you like and stick with it.
- Some learning resources:
- Corey Schafer – excellent Python tutorials on YouTube
- Take a free Python MOOC from Coursera. Just audit the course when you enroll. Find something that works for you.
- Practice Python – this is what I started with to practice a few of the basics.
Other Problems
I ran into a brand new issue today on a fresh install of Windows 10. All steps listen above were completed and Python was working in Spyder. Long story short, when trying to run “python” from Command Prompt, only the Windows store window (pictured below) would pop up.
Following the instructions given in the description shown above solved the problem for me. You can see in the picture below that I switched off the app execution aliases for Python.