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 latest tutorials and detailed steps of vitrualBox+ubuntu16.04 installation python3.6

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Because these two days in the study of deep learning need to use ubuntu+ Python 3.6 version, so according to the online teaching installation, but ubuntu 16.04 comes with Python 2.7 and 3.5 versions, so you need to install separately. But it took half a day to install and a whole day to step in all kinds of pits. Finally, it worked. So write this tutorial to help future generations, avoid the wrong path.

Here are a few tips for installing all the way:

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

Find software and updates in search, where you can switch download sources, I chose Alibaba Cloud.

Then find language support in the search, go in and download the good language pack on OK. Next up is Python 3.6.

Install Python 3.6

1. Follow the online tutorial to install the individual found by the following instructions can not be added and installed

sudo add-apt-repository ppa:jonathonf/python-3.6 //do not use this

It is best to download the installation package at https://www.python.org/ftp/python/3.6.5/and put the installation package in ubuntu through a shared folder.

2. If the shared folder is inaccessible

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

sudo adduser frio vboxsf

3. Then there is the process of installing Python 3.6.

Right-click the terminal in the shared folder to access this folder.

and 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 releases requires root privileges to change or delete.

Go to the extracted folder and add configuration

cd Python-3.6.5/./ configure "--prefix=/usr/bin/python3.6"

What you want to configure are the folders required to install Python. After the configuration is completed, the terminal will display the following paragraph, you can choose to ignore it, does not affect subsequent operations.

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 occur depending on which version of gcc you have installed.

perform the installation

sudo make install

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

There is a possibility of missing zlib dependencies and failed installation.

solutions

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

Re-install here.

Modify the default Python version

Ubuntu version 16.04 integrates Python 2.7 and 3.5 versions. The original python in the system is in/usr/bin/python. You can see through ls -l that python is a soft link to Python 2.7 in this directory.

We need to delete this default link first, and then create a Python 3.6 soft link. First make sure that the pointer to the terminal has been returned to the root directory, and then do the following.

You need to delete the Python link file:

rm /usr/bin/python

Note If the terminal prompt: rm: cannot delete '/usr/bin/python': permissions are not enough, then you need to use sudo or open root permissions to delete links.

Create a link to Python 3.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

The installation is successful here.

summary

The above is the vitrualBox+ubuntu16.04 installation python3.6 latest tutorial and detailed steps introduced by Xiaobian. I hope it will help you. If you have any questions, please leave me a message. Xiaobian will reply to you in time. Thank you very much for your support! If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!

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

Servers

Wechat

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

12
Report