Notices



How to install Python on Windows, Linux, and macOS

AVN News Feed

Post New ThreadReply
 
Thread Tools
  #1  
Old 08-28-2022, 04:01 PM
phillynewsnow's Avatar
phillynewsnow phillynewsnow is offline   Thread Starter  
Site Moderator - Staff

 
Join Date: October 11th, 2009
Posts: 4,640
Thanks: 0
Thanked 668 Times in 568 Posts
Downloads: 0
Uploads: 0


View phillynewsnow's Profile   Edit Options Edit Profile Picture View phillynewsnow's Photo Album Add phillynewsnow's to Your Contacts Show Groups Edit Avatar Subscribed Threads Private Messages
How to install Python on Windows, Linux, and macOS

How to install Python on Windows, Linux, and macOS



If you want to get into development, one of my favorite programming languages that I’ve learned is Python. It’s a multi-paradigm language, supporting imperative, functional, procedural, and object-oriented programming. It’s wide open and can be used for practically anything, and is a go-to language for many when working in artificial intelligence or machine learning. I use it for a lot of automation, and it’s even the language that some of the testing tools that we’ve used are written in.

Python is a powerful language, and if you want to get started with it, this guide will teach you the basics. Not only will you need to install the Python binaries and ensure that it’s in your PATH, but you’ll also need something to actually write code in. You could use a full-fledged IDE (Integrated Development Environment) like PyCharm, or you could lean towards a text editor such as the pre-installed IDLE or Sublime Text 3. There are a lot of options, but this guide should kick-start you on the basics.

Installing Python

On Windows and macOS

Installing Python is the easy part, and you’ll need to decide whether you’re installing Python 2.7 or Python 3.x. Python 2.7 is often used for legacy projects, but if you’re writing your own software, then you should install Python 3.x.

To install on Windows or Mac, do the following:

  • Go to the official Python site, and navigate to the most recent release. At the time of writing, that is 3.10.6.
  • Download the binary for your platform.
  • Execute the binary.
You don’t need to select any options aside from adding Python to your PATH, as the default installer has everything that you need. Simply clicking “Install” is all you need to do. On Mac, this will be done by default in the dmg installer.



Installing Python on Linux

If you use Linux, though, then it will depend on the distribution that you’re using. Debian-based distributions (such as Ubuntu) can use the apt package installer in Terminal by executing the following command:

  • apt-get install python3.6
Other distributions may have it already pre-installed, and if not, you’ll need to use the package manager in your distribution. For example, on CentOS, you would execute “yum install -y python3”.

Verify Installation

You can verify your install is active, by running the “python” command in PowerShell, command prompt, or your Terminal.



Choose your Python IDE

You’ll need an IDE or text editor to write code effectively, and there are a few options. Python comes with IDLE pre-installed, and while it works well, it’s not great for larger files that may be more complicated. Here are some of the IDEs that I’ve used for Python over the years, both in university and in my own projects. All of these IDEs are cross-platform, meaning you can run them on Windows, Linux, or macOS.

PyCharm



If you’re familiar with Android Studio or IntelliJ, then you’re already familiar with PyCharm. It’s from the same developers, and you can even enable the exact same functionality in IntelliJ by installing the Python plugin. The difference is that PyCharm is built from the ground up purely just for Python, and packs all of the features you’d expect of any modern IDE. That includes built in version control, syntax highlighting, window splitting, debugging features, and more.


Spyder



If you’re a data scientist (or are going to be using Python for data science purposes), then you need to install Spyder. It’s an IDE that packs in some of the most popular data analysis packages for Python already. These include matplotlib, numpy, scipy, and pandas. If you want to get into data analysis, data plotting, and other scientific investigation, then Spyder is 100% what you need to install. Spyder even has Jupyter Notebooks built in, which can be used to explore and plot data really easily.


Sublime Text 3



Sublime Text 3 is one of my go-to text editors, simply thanks to its simplicity. It’s super versatile, though barebones, and more suited towards smaller projects. If you’re only working with a few hundred lines of code in a program that you’re writing, then Sublime Text 3 is probably the best way to go. I once wrote a web scraper in Python that would read local renting sites and email me and some friends a link to new listings just using Sublime Text 3 and Python. It’s a perfectly capable development environment and one that I think most people should be familiar with.


Visual Studio Code (VSCode)



Visual Studio Code (or VSCode) is one of the most versatile development environments out there. It’s entirely customizable, with a massive repository of plugins that you can access from within. It’s not compatible with Python straight away, but you can install a Python plugin from within that will enable syntax highlighting, intelligent code completion, Jupyter Notebooks, debugging, unit testing, and other features. I love Visual Studio Code, and it’s actually the IDE that I use the most when I’m working on something complex.


What next

If you want to get started with development, there are loads of tutorials online that will teach you the basics. Between the likes of CodeAcademy and w3schools, there are lots of options. There are even Python interpreters on Android that you can use to write on your phone, and the best way to learn is by doing. If you’re doing anything resource-intensive that may use a lot of machine learning models or artificial intelligence, you might need one of the best laptops to handle it, though.

The best way that I learned was by realizing a problem or other difficulty I had and trying to figure out a way to automate the solution to it. That’s why I had the idea of writing a program that would scrape renting sites for me, and I’m sure there are other reasons you may find that you want to use Python, too.


The post How to install Python on Windows, Linux, and macOS appeared first on XDA.



More...
Reply With Quote
Post New ThreadReply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows 11 and Android are lifting this cool feature from macOS and iPhones phillynewsnow AVN News Feed 0 10-28-2022 07:35 AM
How to install ADB on Windows, macOS, and Linux phillynewsnow AVN News Feed 0 10-28-2022 07:35 AM
How to install macOS Ventura in a virtual machine on your Mac phillynewsnow AVN News Feed 0 07-29-2022 02:36 AM
Google announces Flutter 3, now with macOS and Linux desktop support phillynewsnow AVN News Feed 0 05-11-2022 05:01 PM
Does the Lenovo ThinkPad T14 Gen 3 run Linux? Can you install it? phillynewsnow AVN News Feed 0 05-03-2022 11:39 AM


All times are GMT -5. The time now is 05:09 PM.

Layout Options | Width: Fixed
Contact Us - SPJ Bulletin - Archive - Privacy Statement - Terms of Service - Top