Hướng dẫn get biopython version
Watch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Python Basics: Setting Up Python Show
Installing or updating Python on your computer is the first step to becoming a Python programmer. There are a multitude of installation methods: you can download official Python distributions from Python.org, install from a package manager, and even install specialized distributions for scientific computing, Internet of Things, and embedded systems. This tutorial focuses on official distributions, as they’re generally the best option for getting started with learning to program in Python. In this tutorial you’ll learn how to:
No matter what operating system you’re on, this tutorial has you covered. Find your operating system below and dive in! How to Install Python on WindowsThere are three installation methods on Windows:
In this section, you’ll learn how to check which version of Python, if any, is installed on your Windows computer. You’ll also learn which of the three installation methods you should use. For a more comprehensive guide, check out Your Python Coding Environment on Windows: Setup Guide. How to Check Your Python Version on WindowsTo check if you already have Python on your Windows machine, first open a command-line application, such as PowerShell. You can also use With the command line open, type in the following command and press Enter:
Using the
In
either case, if you see a version less than If you’re interested in where the installation is located, then you can use the
Note that the What Your Options AreAs mentioned earlier, there are three ways to install the official Python distribution on Windows:
In this section, we’ll focus on only the first two options, which are the most popular installation methods in a Windows environment. If you want to install in the WSL, then you can read the Linux section of this tutorial after you’ve installed the Linux distribution of your choice. The two official Python installers for Windows aren’t identical. The Microsoft Store package has some important limitations. Limitations of the Microsoft Store PackageThe official Python documentation has this to say about the Microsoft Store package:
The key takeaway here is that the Microsoft Store package is “intended mainly for interactive use.” That is, the Microsoft Store package is designed to be used by students and people learning to use Python for the first time. In addition to targeting beginning Pythonistas, the Microsoft Store package has limitations that make it ill-suited for a professional development environment. In particular, it does not have full write access to shared locations such as Windows Installer RecommendationsIf you’re new to Python and focused primarily on learning the language rather than building professional software, then you should install from the Microsoft Store package. This offers the shortest and easiest path to getting started with minimal hassle. On the other hand, if you’re an experienced developer looking to develop professional
software in a Windows environment, then the official Python.org installer is the right choice. Your installation won’t be limited by Microsoft Store policies, and you can control where the executable is installed and even add Python to How to Install From the Microsoft StoreIf you’re new to Python and looking to get started quickly, then the Microsoft Store package is the best way to get up and running without any fuss. You can install from the Microsoft Store in two steps. Step 1: Open the Python App Page in the Microsoft StoreOpen the Microsoft Store app and search for You’ll likely see multiple versions that you can choose to install: Select Python 3.8, or the highest version number you see available in the app, to open the installation page. Alternatively, you can open PowerShell and type the following command: If you don’t already have a version of Python on your system, then when you press Enter, the Microsoft Store will automatically launch and take you to the latest version of Python in the store. Step 2: Install the Python AppAfter you’ve selected the version to be installed, follow these steps to complete the installation:
Congratulations! You now have access to
Python, including How to Install From the Full InstallerFor professional developers who need a full-featured Python development environment, installing from the full installer is the right choice. It offers more customization and control over the installation than installing from the Microsoft Store. You can install from the full installer in two steps. Step 1: Download the Full InstallerFollow these steps to download the full installer:
If you aren’t sure whether to select the 32-bit or the 64-bit installer, then you can expand the box below to help you decide. For Windows, you can choose either the 32-bit or the 64-bit installer. Here’s the difference between the two:
If you’re unsure which version to pick, go with the 64-bit version. If you have a 64-bit system and would like to switch from 64-bit Python to 32-bit (or vice versa), then you can just uninstall Python and then reinstall it by downloading the other installer from Python.org. When the installer is finished downloading, move on to the next step. Step 2: Run the InstallerOnce you’ve chosen and downloaded an installer, run it by double-clicking on the downloaded file. A dialog box like the one below will appear: There are four things to notice about this dialog box:
The full installer gives you total control over the installation process. Customize the installation to meet your needs using the options available on the dialog box. Then click Install Now. That’s all there is to it! Congratulations—you now have the latest version of Python 3 on your Windows machine! How to Install Python on macOSPython 2 comes preinstalled on older versions of macOS. This is no longer the case for current versions of macOS, starting with macOS Catalina. There are two installation methods on macOS:
In this section, you’ll learn how to check which version of Python, if any, is installed on your macOS device. You’ll also learn which of the two installation methods you should use. How to Check Your Python Version on a MacTo check which Python version you have on your Mac, first open a command-line application, such as Terminal. With the command line open, type in the following commands:
If you have Python on your system, then one or more of these commands should respond with a version number. For example, if Python 3.6.10 were already set up on your computer, then the You’ll want to get the latest
version of Python if any of these conditions is true:
What Your Options AreThere are two ways to install the official Python distribution on macOS:
Both the official installer and the Homebrew package manager will work, but only the official installer is maintained by the Python Software Foundation. The distributions installed by the official installer and the Homebrew package manager aren’t identical. Installing from Homebrew has some limitations. Limitations of Installing From HomebrewThe Python distribution for macOS available on Homebrew doesn’t include the Tcl/Tk dependency required by the Tkinter module. Tkinter is the standard library module for developing graphical user interfaces in Python and is in fact an interface for the Tk GUI toolkit, which isn’t part of Python. Homebrew doesn’t install the Tk GUI toolkit dependency. Instead, it relies on an existing version installed on your system. The system version of Tcl/Tk may be outdated or missing entirely and could prevent you from importing the Tkinter module. macOS Installer RecommendationsThe Homebrew package manager is a popular method for installing Python on macOS because it’s easy to manage from the command line and offers commands to upgrade Python without having to go to a website. Because Homebrew is a command-line utility, it can be automated with bash scripts. However, the Python distribution offered by Homebrew isn’t controlled by the Python Software Foundation and could change at any time. The most reliable method on macOS is to use the official installer, especially if you plan on doing Python GUI programming with Tkinter. How to Install From the Official InstallerInstalling Python from the official installer is the most reliable installation method on macOS. It includes all the system dependencies needed for developing applications with Python. You can install from the official installer in two steps. Step 1: Download the Official InstallerFollow these steps to download the full installer:
When the installer is finished downloading, move on to the next step. Step 2: Run the InstallerRun the installer by double-clicking the downloaded file. You should see the following window: Follow these steps to complete the installation:
Congratulations—you now have the latest version of Python 3 on your macOS computer! How to Install From HomebrewFor users who need to install from the command line, especially those who won’t be using Python to develop graphical user interfaces with the Tkinter module, the Homebrew package manager is a good option. You can install from the Homebrew package manager in two steps. Step 1: Install HomebrewIf you already have Homebrew installed, then you can skip this step. If you don’t have Homebrew installed, then use the following procedure to install Homebrew:
Depending on your Internet connection, it may take a few minutes to download all of Homebrew’s required files. Once the installation is complete, you’ll end up back at the shell prompt in your terminal window. Now that Homebrew is installed, you’re ready to install Python. Step 2: Install PythonFollow these steps to complete the installation with Homebrew:
Installing with Homebrew is now as straightforward as running the command You can make sure everything went correctly by testing if you can access Python from the terminal:
Congratulations—you now have Python on your macOS system! How to Install Python on LinuxThere are two installation methods on Linux:
In this section, you’ll learn how to check which version of Python, if any, is on your Linux computer. You’ll also learn which of the two installation methods you should use. How to Check Your Python Version on LinuxMany Linux distributions come packaged with Python, but it probably won’t be the latest version and may even be Python 2 instead of Python 3. You should check the version to make sure. To find out which version of Python you have, open a terminal window and try the following commands:
If you have Python on your machine, then one or more of these commands should respond with a version number. For example, if you already had Python 3.6.10 on your computer, then the
You’ll want to get the latest version of Python if your current version is in the Python 2.X series or is not the latest version of Python 3 available, which was 3.8.4 as of this writing. What Your Options AreThere are two ways to install the official Python distribution on Linux:
Not every Linux distribution has a package manager, and not every package manager has Python in its package repository. Depending on your operating system, building Python from source code might be your only option. Which installation method you use mainly boils down to whether your Linux OS has a package manager and whether you need to control the details of the installation. Linux Installation RecommendationsThe most popular way to install Python on Linux is with your operating system’s package manager, which is a good choice for most users. However, depending on your Linux distribution, Python may not be available through a package manager. In this case, you’ll need to build Python from source code. There are three main reasons that you might choose to build Python from source code:
To complete the installation on your Linux machine, find your Linux distribution below and follow the steps provided. How to Install on Ubuntu and Linux MintIn this section, you’ll learn how to install Python using Ubuntu’s Depending on the version of the Ubuntu distribution you run, the process for setting up Python on your system will vary. You can determine your local Ubuntu version by running the following command:
Follow the instructions below that match the version number you see under
Congratulations! You now have Python 3 set up on your machine! How to Install on Debian LinuxBefore you can install Python 3.8 on Debian, you’ll need to install the
After that, open the
Now you can skip ahead to the How to Build Python From Source Code section to finish installing Python. How to Install on openSUSEBuilding from source is the most reliable way to set up Python on openSUSE. To do that, you’ll need to install the development tools, which can be done in
This might take a while to complete as it installs over 150 packages. Once it’s completed, skip ahead to the How to Build Python From Source Code section. How to Install on CentOS and FedoraPython 3.8 isn’t available in the CentOS and Fedora repositories, so you’ll have to build Python from source code. Before you compile Python, though, you need to make sure your system is prepared. First, update the Once
When everything is finished installing, skip ahead to the How to Build Python From Source Code section. How to Install on Arch LinuxArch Linux is fairly diligent about keeping up with Python releases. It’s likely you already have the latest version. If not, use the following command to update Python: When Python is finished updating, you should be all set! How to Build Python From Source CodeSometimes your Linux distribution doesn’t have the latest version of Python, or maybe you just want to be able to build the latest, greatest version yourself. Here are the steps you need to take to build Python from source: Step 1: Download the Source CodeTo start, you need to get the Python source code. Python.org makes this fairly straightforward. If you go to the Downloads page, then you’ll see the latest source for Python 3 at the top. Just make sure you don’t grab Legacy Python, Python 2! When you select the Python 3 version, you’ll see a “Files” section at the bottom of the page. Select Gzipped source tarball and download it to your machine. If you prefer a command-line method, you can use
When the tarball finishes downloading, there are a few things you’ll need to do to prepare your system for building Python. Step 2: Prepare Your SystemThere are a few distro-specific steps involved in building Python from scratch. The goal of each step is the same on all distros, but you might need to translate to your distribution if it doesn’t use
Now that your system is ready to go, it’s time to start building Python! Step 3: Build Python
It might take a while to finish installation. Once it’s done, you can verify that Python is set up correctly. Step 4: Verify Your InstallationTest that the
If you see If you have some extra time on your hands, you can also run the test suite to make sure everything is working properly on your system. To run the test suite, type the following command: You’ll probably want to find something else to do for a while, as your computer will be running tests for some time. If all the tests pass, then you can be confident that your brand-new Python build is working as expected! How to Install Python on iOSThe Pythonista app for iOS is a full-fledged Python development environment that you can run on your iPhone or iPad. It features a Python editor, technical documentation, and an interpreter all rolled into a single app. Pythonista is surprisingly fun to use. It’s a great little tool when you’re stuck without a laptop and want to work on your Python skills on the go. It comes with the complete Python 3 standard library and even includes full documentation that you can browse offline. To set up Pythonista, you need to download it from the iOS app store. How to Install Python on AndroidIf you have an Android tablet or phone and want to practice Python on the go, there are several options available. The one that we found most reliably supports Python 3.8 is Pydroid 3. Pydroid 3 features an interpreter that you can use for REPL sessions, and it also allows you to edit, save, and execute Python code. You can download and install Pydroid 3 from the Google Play store. There is a free version and also a paid Premium version that supports code prediction and code analysis. Online Python InterpretersIf you want to try out the examples in this tutorial without setting up Python on your machine, then there are several websites that offer an online Python interpreter:
These cloud-based Python interpreters may not be able to execute some of the more complex examples in this tutorial, but they’re adequate for running most of the code and may be a nice way to get started. More information on using these sites is presented in the next tutorial in this series. ConclusionCongratulations! You now have access to the latest version of Python for your system. Your Python journey is just beginning. In this tutorial you’ve learned how to:
You’re now ready to get started programming in Python! Be sure to share your progress and any questions you may have in the comments below. Watch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Python Basics: Setting Up Python |