In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to install Anaconda in Ubuntu". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Anaconda is a python distribution that includes python and many common software libraries, as well as a package manager conda. Anaconda integrates a lot of third-party libraries about python scientific computing, mainly because it is easy to install, while python is a compiler, if you do not use anaconda, then it will be more painful to install, the dependencies between the libraries are difficult to connect well.
1. Download Anaconda
Download Anaconda3-5.3.1-Linux-x86_64.sh (the corresponding Anaconda version of Ubuntu18.04):
Method 1: download on the Anaconda official website is very slow due to network reasons, as shown in figure 1.
Official download address: https://www.anaconda.com/download/
Python 3.7 version of "Anaconda3-5.3.1-Linux-x86_64.sh" is used here. If the download speed is slow or the download fails, please find your own way.
Method 2: now we download it from the open source software mirror station of Tsinghua University, as shown in the following figure.
The Anaconda version corresponds to the default Python version
Anaconda 3-5.2 is Python3.6
Anaconda 3-5. 3 is Python3.7
2. Install Anaconda
The installation is relatively simple. Refer to the official documentation here, enter the location of the downloaded file, open the terminal terminal and execute it in the file directory:
[linuxidc@linuxidc:~/www.linuxidc.com] $bash Anaconda3-5.3.1-Linux-x86_64.sh
Welcome to Anaconda3 5.3.1
In order to continue the installation process, please review the licenseagreement.Please, press ENTER to continue > enter
Then enter enter as prompted above
As shown in the figure above, you need to check the Anaconda end-user license agreement and enter until you have finished browsing the information.
After reading the registration information, enter "yes" here (as shown above)
Then enter to install (as shown below), and Anaconda3 will now be installed in the following location:
Anaconda3 will now be installed into this location:/home/linuxidc/anaconda3
-Press ENTER to confirm the location-Press CTRL-C to abort the installation-Or specify a different location below
[/ home/linuxidc/anaconda3] > > PREFIX=/home/linuxidc/anaconda3installing: python-3.7.0-hc3d631a_0... Python 3.7.0
Here we enter "yes" to choose to add the environment variable
Do you wish the installer to initialize Anaconda3in your / home/linuxidc/.bashrc? [yes | no] [no] > > yes
Initializing Anaconda3 in / home/linuxidc/.bashrcA backup will be made to: / home/linuxidc/.bashrc-anaconda3.bak
For this change to become active, you have to open a new terminal.
Thank you for installing Anaconda3!
Next, we install Visual Studio Code,Anaconda to cooperate with Microsoft! Microsoft VSCode is a compact code editor that supports debugging, tasks and other development operations to run and version control.
Do you wish to proceed with the installation of Microsoft VSCode? [yes | no]
In this part, we enter
> > yesProceeding with installation of Microsoft VSCodeChecking Internet connectivity... Installing Visual Studio Code... [sudo] password of linuxidc:
Seeing these messages indicates that the installation is complete. As shown below:
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2)... Updating VSCode Config... Installing Extensions... Installing extensions... Installing extension 'ms-python.anaconda-extension-pack' v1.0.1... Extension 'ms-python.anaconda-extension-pack' v1.0.1 was successfully installed.VSCode successfully installed in / usr/share/code!
We can now use Anaconda3 in the new terminal window, open the new terminal and view the corresponding version information.
[linuxidc@linuxidc:~/www.linuxidc.com] $anaconda-Vanaconda Command line client (version 1.7.2) [linuxidc@linuxidc:~/www.linuxidc.com] $pythonPython 3.7.0 (default, Jun 28 2018, 13:15:42) [GCC 7.2.0]:: Anaconda, Inc. On linuxType "help", "copyright", "credits" or "license" for more information. >
Open Jupyter Notebook
The way to open notebook is very simple, just type in the terminal
[linuxidc@linuxidc:~/www.linuxidc.com] $ipython notebook
When the startup is complete, the browser will be opened automatically
Install a third-party package
Input
Conda install requests
Or
Pip install requests
To install the requests package.
After the installation is complete, we enter python to enter the interpreter and import requests the package, which must be successful this time.
Uninstall a third-party package
So how do you uninstall a package?
Conda remove requests
Or
Pip uninstall requests
That's all right.
View environment package information
To view all installed packages in the current environment, you can use the
Conda list
Import and export environment
If you want to export package information for the current environment, you can use
Conda env export > environment.yaml
Save the package information in the yaml file.
Can be used when you need to recreate the same virtual environment
Conda env create-f environment.yaml
In fact, whether the command is very simple or not, I will give some commonly used ones below, and I believe that I can remember it by typing two more times.
Activate / / switch to base environment
Activate learn / / switch to learn environment
Conda create-n learn python=3 / / create an environment named learn and specify python version 3 (the latest version of)
Conda env list / / lists all environments managed by conda
Conda list / / lists all packages for the current environment
Conda install requests install requests package
Conda remove requests uninstalls requets package
Conda remove-n learn-all / / Delete learn environment and all subordinate packages
Conda update requests updates the requests package
Conda env export > environment.yaml / / Export package information for the current environment
Conda env create-f environment.yaml / / create a new virtual environment with configuration files
This is the end of "how to install Anaconda in Ubuntu". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.