Commit 76b1755d authored by Marie-Ingrid Richard's avatar Marie-Ingrid Richard
Browse files

Merge branch 'mrichard-master-patch-05104' into 'master'

Update conda_installation.txt

See merge request !1
parents 2ae7a73d 7a287a4d
conda activate bcdiDevel.conda
How To Install Anaconda on Ubuntu 18.04 [Quickstart]
PythonQuickstartDevelopmentUbuntu 18.04
By Lisa Tagliaferri
Last Validated onApril 18, 2019 Originally Published onJuly 10, 2018 1.1m views
Designed for data science and machine learning workflows, Anaconda is an open-source package manager, environment manager, and distribution of the Python and R programming languages.
This tutorial will guide you through installing Anaconda on an Ubuntu 18.04 server. For a more detailed version of this tutorial, with better explanations of each step, please refer to How To Install the Anaconda Python Distribution on Ubuntu 18.04.
Step 1 — Retrieve the Latest Version of Anaconda
From a web browser, go to the Anaconda Distribution page, available via the following link:
Find the latest Linux version and copy the installer bash script.
Step 2 — Download the Anaconda Bash Script
Logged into your Ubuntu 18.04 server as a sudo non-root user, move into the /tmp directory and use curl to download the link you copied from the Anaconda website:
cd /tmp
curl -O
Step 3 — Verify the Data Integrity of the Installer
Ensure the integrity of the installer with cryptographic hash verification through SHA-256 checksum:
Step 4 — Run the Anaconda Script
You’ll receive the following output to review the license agreement by pressing ENTER until you reach the end.
Welcome to Anaconda3 2019.03
In order to continue the installation process, please review the license
Please, press ENTER to continue
Do you approve the license terms? [yes|no]
When you get to the end of the license, type yes as long as you agree to the license to complete installation.
Step 5 — Complete Installation Process
Once you agree to the license, you will be prompted to choose the location of the installation. You can press ENTER to accept the default location, or specify a different location.
Anaconda3 will now be installed into this location:
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/sammy/anaconda3] >>>
At this point, the installation will proceed. Note that the installation process takes some time.
Step 6 — Select Options
Once installation is complete, you’ll receive the following output:
installation finished.
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/sammy/.bashrc ? [yes|no]
[no] >>>
It is recommended that you type yes to use the conda command.
Step 7 — Activate Installation
You can now activate the installation with the following command:
source ~/.bashrc
Step 8 — Test Installation
Use the conda command to test the installation and activation:
conda list
You’ll receive output of all the packages you have available through the Anaconda installation.
Step 9 — Set Up Anaconda Environments
You can create Anaconda environments with the conda create command. For example, a Python 3 environment named my_env can be created with the following command:
conda create --name my_env python=3
Activate the new environment like so:
conda activate my_env
Your command prompt prefix will change to reflect that you are in an active Anaconda environment, and you are now ready to begin work on a project.
Related Tutorials
Here are links to more detailed tutorials that are related to this guide:
How To Install the Anaconda Python Distribution on Ubuntu 18.04
How To Set Up Jupyter Notebook for Python 3
How To Install the pandas Package and Work with Data Structures in Python 3
NEW ---
Anaconda Python distribution installed and accessible
1. Check conda is installed and in your PATH
Open a terminal client.
Enter conda -V into the terminal command line and press enter.
If conda is installed you should see somehting like the following.
$ conda -V
conda 3.7.0
2. Check conda is up to date
In the terminal client enter
conda update conda
Upadate any packages if necessary by typing y to proceed.
3. Create a virtual environment for your project
In the terminal client enter the following where yourenvname is the name you want to call your environment, and replace x.x with the Python version you wish to use. (To see a list of available python versions first, type conda search "^python$" and press enter.)
conda create -n yourenvname python=x.x anaconda
Press y to proceed. This will install the Python version and all the associated anaconda packaged libraries at “path_to_your_anaconda_location/anaconda/envs/yourenvname”
4. Activate your virtual environment.
To activate or switch into your virtual environment, simply type the following where yourenvname is the name you gave to your environement at creation.
source activate yourenvname
Activating a conda environment modifies the PATH and shell variables to point to the specific isolated Python set-up you created. The command prompt will change to indicate which conda environemnt you are currently in by prepending (yourenvname). To see a list of all your environments, use the command conda info -e.
5. Install additional Python packages to a virtual environment.
To install additional packages only to your virtual environment, enter the following command where yourenvname is the name of your environemnt, and [package] is the name of the package you wish to install. Failure to specify “-n yourenvname” will install the package to the root Python installation.
conda install -n yourenvname [package]
6. Deactivate your virtual environment.
To end a session in the current environment, enter the following. There is no need to specify the envname - which ever is currently active will be deactivated, and the PATH and shell variables will be returned to normal.
source deactivate
6. Delete a no longer needed virtual environment
To delete a conda environment, enter the following, where yourenvname is the name of the environment you wish to delete.
conda remove -n yourenvname -all
conda update -n base -c defaults conda
conda install -c conda-forge silx
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment