how to install 2fupgrade to latest python3 9 6

Solutions on MaxInterview for how to install 2fupgrade to latest python3 9 6 by the best coders in the world

showing results for - "how to install 2fupgrade to latest python3 9 6"
Salvatore
06 Jan 2018
1how-to-build- latest version of python-from-source-code from /usr/local/bin/python from root system
2Step 1: Download the Source Code
3To 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!
4
5When 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 wget to download the file to your current directory:
6
7$ wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz
8When the tarball finishes downloading, there are a few things you’ll need to do to prepare your system for building Python.
9
10Step 2: Prepare Your System
11There 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 apt-get:
12
13First, update your package manager and upgrade your packages:
14
15$ sudo apt-get update
16$ sudo apt-get upgrade
17Next, make sure you have all of the build requirements installed:
18
19# For apt-based systems (like Debian, Ubuntu, and Mint)
20$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
21       libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
22       libncurses5-dev libncursesw5-dev xz-utils tk-dev
23
24# For yum-based systems (like CentOS)
25$ sudo yum -y groupinstall "Development Tools"
26$ sudo yum -y install gcc openssl-devel bzip2-devel libffi-devel
27It’s fine if you already have some of the requirements installed on your system. You can execute the above commands and any existing packages will not be overwritten.
28
29Now that your system is ready to go, it’s time to start building Python!
30
31Step 3: Build Python
32Once you have the prerequisites and the TAR file, you can unpack the source into a directory. Note that the following command will create a new directory called Python-3.8.3 under the one you’re in:
33
34$ tar xvf Python-3.9.6.tgz
35$ cd Python-3.9.6
36Now you need to run the ./configure tool to prepare the build:
37
38$ ./configure --enable-optimizations --with-ensurepip=install
39The enable-optimizations flag will enable some optimizations within Python to make it run about 10 percent faster. Doing this may add twenty or thirty minutes to the compilation time. The with-ensurepip=install flag will install pip bundled with this installation.
40
41Next, you build Python using make. The -j option simply tells make to split the building into parallel steps to speed up the compilation. Even with the parallel builds, this step can take several minutes:
42
43$ make -j 8
44Finally, you’ll want to install your new version of Python. You’ll use the altinstall target here to avoid overwriting the system Python. Since you’re installing into /usr/bin, you’ll need to run as root:
45
46$ sudo make altinstall
47It might take a while to finish installation. Once it’s done, you can verify that Python is set up correctly.
48
49Step 4: Verify Your Installation
50Test that the python3.9 --version command returns the latest version:
51
52$ python3.8 --version
53Python 3.9.6
54If you see Python 3.9.6, then you’re all set!
55
56If 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.
57
58To run the test suite, type the following command:
59
60$ python3.9 -m test
61You’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!
62You’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!
63
64
queries leading to this page
how to upgrade python 2 7 to 3 7python 3 9 upgradehow to upgrade my python 3 9 5 in windowsupdate python version 3 5 to 3 6how to upgrade from python 3 9 6 to python 3 9 7 on windowspython 3 8 upgradehow to upgrade python to 3 8upgrade python from 3 7 6 to 3 9 6how to upgrade python version to 3 9 windows using pipupgrade python 2 7 to 3 7upgrade python3upgrade python version to 3 7update python 3 8 to python 3 9upgrade to python 3 6how to upgrade to python 3 8upgrade python from 3 8 to 3 9upgrade python3 to 3 7 5how to upgrade python to 3 7how to upgrade python3upgrade python 3 9 to latest version windowsupgrade python 3 9 to latest versionupdate python 3 to latest versionhow do i upgrade to python 3 10updating python to 3 6how to upgrade python from 2 7 to 3 6how to update python3 to latest versionupgrade python 3 6 9 to 3 9how to upgrade python 2 7 to 3how to upgrade version of python3upgrade python3 6 to 3 8python3 3a upgrade to 3 7 2how to upgrade python 3 7 to python 3 9how to update my python 3 7 7 to python 3 8upgrade python to 3 9 windowsupgrade to python 3upgrade python 3 6 to 3 8 windowspip upgrade python to 3 9upgrade python 3 6 to 3 9upgrading python3 5 to 3 6how to upgrade python version to 3 9update python 3 7 to 3 8how to upgrade python version to 3 9 windowsupgrade to python 3 10upgrade python 3 9 windowsupgrade python 3 7 the right wayupgrade python to 3 7how to upgrade my python 3 in windowsupgrade python version to 3 8upgrade from python 3 7 to 3 9 windows 10how to update python 3 9 to python 3 10upgrade python 3 9 windows using pippip upgrade python 3d 3d3 9update python to 3 9update to python 3 9update python version to 3 7how to upgrade from python 2 7 to python 3upgrade python 2 7 5 to 3 2how to install 2fupgrade to latest python3 9 6