Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of installing python3.6 in vitrualBox+ubuntu16.04

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "the method of installing python3.6 in vitrualBox+ubuntu16.04". In the daily operation, I believe that many people have doubts about the method of installing python3.6 in vitrualBox+ubuntu16.04. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the method of installing python3.6 in vitrualBox+ubuntu16.04". Next, please follow the editor to study!

Here are some tips installed along the way:

When installing ubuntu16, the language pack will be downloaded at last, because it is a foreign source and takes a lot of time, so you can skip it by clicking skip first. Modify the source later to continue the installation.

Find software and updates in the search, where you can switch download sources. I chose Aliyun's.

Then find the language support in the search, go in and download the language pack on ok. The next big thing is to install python3.6

Install python3.6

1. Individuals follow the online tutorials to install and find that they cannot be added and installed through the following instructions

Sudo add-apt-repository ppa:jonathonf/python-3.6 / / Don't use this

It is best to download the installation package and put the installation package into ubuntu through a shared folder.

two。 If the shared folder is inaccessible

Add the current user name to the user group vboxsf (my user name is frio) and restart the system to ok

Sudo adduser frio vboxsf

3. Then there is the process of installing python3.6

Right-click the terminal in the shared folder and you can access this folder

Then extract the file

Tar xfz python-3.6.5.tgz

Note: the xfz command is used here, rather than the-xvzf command, because the folder it frees requires root permission to change or delete.

Go to the extracted folder and add the configuration

Cd python-3.6.5/./configure "--prefix=/usr/bin/python3.6"

What you want to configure is the folder you need to install python. After the configuration is completed, the terminal will display the following paragraph, and you can choose to ignore it without affecting the subsequent operation.

If you want arelease build with all optimizations active (lto, pgo, etc)

Please run./configure-enable-optimizations

Compile source code

Sudo make

The compilation process takes a few minutes, and errors may be reported, depending on the version of gcc you installed.

Perform installation

Sudo make install

The installation process takes a few minutes, and after the installation is successful, the installed python is in the computer / usr/bin/python3.6 folder.

It is possible to report a missing zlib dependency package installation failure here

Solution.

Install gcc toolchain

Sudo apt install build-essential

Install various dependencies

Sudo apt install libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev

Come here and re-perform the installation.

Modify the default python version

Ubuntu16.04 version integrates python2.7 and 3.5. the original python in the system is / usr/bin/python. As you can see through ls-l, python is a soft link to python2.7 in this directory.

We need to delete this default link first, and then create a new soft link for python3.6. First, make sure that the terminal's pointer has been returned to the root directory, and then do the following.

You need to delete the original python link file:

Rm / usr/bin/python

Note that if the terminal prompts: rm: cannot delete'/ usr/bin/python': permission is not enough, then you need to use sudo or open root permission to delete the link.

Set up a link to python3.6. If you don't have enough permissions, use root or sudo plus command:

Ln-s / usr/bin/python3.6/bin/python3.6 / usr/bin/python

Query python version

Python@ubuntu:~$ python-vpython 3.6.5 at this point, the study on "how to install python3.6 in vitrualBox+ubuntu16.04" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report