Conda create environment linux

Getting started with condaВ¶

Conda is a powerful package manager and environment manager that you use with command line commands at the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux.

This 20-minute guide to getting started with conda lets you try out the major features of conda. You should understand how conda works when you finish this guide.

SEE ALSO: Getting started with Anaconda Navigator, a graphical user interface that lets you use conda in a web-like interface without having to enter manual commands. Compare the Getting started guides for each to see which program you prefer.

Before you startВ¶

You should have already installed Anaconda.

ContentsВ¶

Starting conda on Windows, macOS, or Linux. 2 MINUTES

Managing conda . Verify that Anaconda is installed and check that conda is updated to the current version. 3 MINUTES

Managing environments . Create environments and move easily between them. 5 MINUTES

Managing Python . Create an environment that has a different version of Python. 5 MINUTES

Managing packages . Find packages available for you to install. Install packages. 5 MINUTES

TOTAL TIME: 20 MINUTES

Starting condaВ¶

Windows

From the Start menu, search for and open «Anaconda Prompt.»

On Windows, all commands below are typed into the Anaconda Prompt window.

MacOS

Open Launchpad, then click the terminal icon.

On macOS, all commands below are typed into the terminal window.

Linux

Open a terminal window.

On Linux, all commands below are typed into the terminal window.

Managing condaВ¶

Verify that conda is installed and running on your system by typing:

Conda displays the number of the version that you have installed. You do not need to navigate to the Anaconda directory.

EXAMPLE: conda 4.7.12

If you get an error message, make sure you closed and re-opened the terminal window after installing, or do it now. Then verify that you are logged into the same user account that you used to install Anaconda or Miniconda.

Update conda to the current version. Type the following:

Conda compares versions and then displays what is available to install.

If a newer version of conda is available, type y to update:

We recommend that you always keep conda updated to the latest version.

Managing environmentsВ¶

Conda allows you to create separate environments containing files, packages, and their dependencies that will not interact with other environments.

When you begin using conda, you already have a default environment named base . You don’t want to put programs into your base environment, though. Create separate environments to keep your programs isolated from each other.

Create a new environment and install a package in it.

We will name the environment snowflakes and install the package BioPython. At the Anaconda Prompt or in your terminal window, type the following:

Conda checks to see what additional packages («dependencies») BioPython will need, and asks if you want to proceed:

Type «y» and press Enter to proceed.

To use, or «activate» the new environment, type the following:

Windows: conda activate snowflakes

macOS and Linux: conda activate snowflakes

conda activate only works on conda 4.6 and later versions.

For conda versions prior to 4.6, type:

Windows: activate snowflakes

macOS and Linux: source activate snowflakes

Now that you are in your snowflakes environment, any conda commands you type will go to that environment until you deactivate it.

Читайте также:  Computer stop at starting windows

To see a list of all your environments, type:

A list of environments appears, similar to the following:

The active environment is the one with an asterisk (*).

Change your current environment back to the default (base): conda activate

For versions prior to conda 4.6, use:

macOS, Linux: source activate

When the environment is deactivated, its name is no longer shown in your prompt, and the asterisk (*) returns to base. To verify, you can repeat the conda info —envs command.

Managing PythonВ¶

When you create a new environment, conda installs the same Python version you used when you downloaded and installed Anaconda. If you want to use a different version of Python, for example Python 3.5, simply create a new environment and specify the version of Python that you want.

Create a new environment named «snakes» that contains Python 3.9:

When conda asks if you want to proceed, type «y» and press Enter.

Activate the new environment:

Windows: conda activate snakes

macOS and Linux: conda activate snakes

conda activate only works on conda 4.6 and later versions.

For conda versions prior to 4.6, type:

Windows: activate snakes

macOS and Linux: source activate snakes

Verify that the snakes environment has been added and is active:

Conda displays the list of all environments with an asterisk (*) after the name of the active environment:

The active environment is also displayed in front of your prompt in (parentheses) or [brackets] like this:

Verify which version of Python is in your current environment:

Deactivate the snakes environment and return to base environment: conda activate

For versions prior to conda 4.6, use:

macOS, Linux: source activate

Managing packagesВ¶

In this section, you check which packages you have installed, check which are available and look for a specific package and install it.

To find a package you have already installed, first activate the environment you want to search. Look above for the commands to activate your snakes environment .

Check to see if a package you have not installed named «beautifulsoup4» is available from the Anaconda repository (must be connected to the Internet):

Conda displays a list of all packages with that name on the Anaconda repository, so we know it is available.

Install this package into the current environment:

Check to see if the newly installed program is in this environment:

Источник

conda create В¶

Create a new conda environment from a list of specified packages. To use the created environment, use ‘conda activate envname’ look in that directory first. This command requires either the -n NAME or -p PREFIX option.

Positional ArgumentsВ¶

Packages to install or update in the conda environment.

Named ArgumentsВ¶

Path to (or name of) existing local environment.

Read package versions from the given file. Repeated file specifications can be passed (e.g. —file=file1 —file=file2).

Use sys.executable -m conda in wrapper scripts instead of CONDA_EXE. This is mainly for use during tests where we test new conda source against old Python versions.

Target Environment SpecificationВ¶

Name of environment.

Full path to environment location (i.e. prefix).

Channel CustomizationВ¶

they are given (including local directories using the ‘file://’ syntax or simply a path like ‘/home/conda/mychan’ or ‘../mychan’). Then, the defaults or channels from .condarc are searched (unless —override-channels is given). You can use ‘defaults’ to get the default packages for conda. You can also use any name and the .condarc channel_alias value will be prepended. The default channel_alias is http://conda.anaconda.org/.

Use locally built packages. Identical to ‘-c local’.

Do not search default or .condarc channels. Requires —channel.

Specify name of repodata on remote server. Conda will try whatever you specify, but will ultimately fall back to repodata.json if your specs are not satisfiable with what you specify here. This is used to employ repodata that is reduced in time scope. You may pass this flag more than once. Leftmost entries are tried first, and the fallback to repodata.json is added for you automatically.

Читайте также:  Linux какие файлы были изменены

Solver Mode ModifiersВ¶

Packages in lower priority channels are not considered if a package with the same name appears in a higher priority channel.

Package version takes precedence over channel priority. Overrides the value given by conda config —show channel_priority .

Do not install, update, remove, or change dependencies. This WILL lead to broken environments and inconsistent behavior. Use at your own risk.

Only install dependencies.

Ignore pinned file.

Ignore create_default_packages in the .condarc file.

Package Linking and Install-time OptionsВ¶

Install all packages using copies instead of hard- or soft-linking.

Networking OptionsВ¶

Use cache of channel index files, even if it has expired.

Allow conda to perform «insecure» SSL connections and transfers. Equivalent to setting ‘ssl_verify’ to ‘false’.

Offline mode. Don’t connect to the Internet.

Output, Prompt, and Flow Control OptionsВ¶

Only display what would have been done.

Report all output as json. Suitable for using conda programmatically.

Do not display progress bar.

Can be used multiple times. Once for INFO, twice for DEBUG, three times for TRACE.

Do not ask for confirmation.

Solve an environment and ensure package caches are populated, but exit prior to unlinking and linking packages into the prefix.

Show channel urls. Overrides the value given by conda config —show show_channel_urls .

conda create -n myenv sqlite

© Copyright 2017, Anaconda, Inc Revision c1579681 .

Источник

Getting started with condaВ¶

Conda is a powerful package manager and environment manager that you use with command line commands at the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux.

This 20-minute guide to getting started with conda lets you try out the major features of conda. You should understand how conda works when you finish this guide.

SEE ALSO: Getting started with Anaconda Navigator, a graphical user interface that lets you use conda in a web-like interface without having to enter manual commands. Compare the Getting started guides for each to see which program you prefer.

Before you startВ¶

You should have already installed Anaconda.

ContentsВ¶

Starting conda on Windows, macOS, or Linux. 2 MINUTES

Managing conda . Verify that Anaconda is installed and check that conda is updated to the current version. 3 MINUTES

Managing environments . Create environments and move easily between them. 5 MINUTES

Managing Python . Create an environment that has a different version of Python. 5 MINUTES

Managing packages . Find packages available for you to install. Install packages. 5 MINUTES

TOTAL TIME: 20 MINUTES

Starting condaВ¶

Windows

From the Start menu, search for and open «Anaconda Prompt.»

On Windows, all commands below are typed into the Anaconda Prompt window.

MacOS

Open Launchpad, then click the terminal icon.

On macOS, all commands below are typed into the terminal window.

Linux

Open a terminal window.

On Linux, all commands below are typed into the terminal window.

Managing condaВ¶

Verify that conda is installed and running on your system by typing:

Conda displays the number of the version that you have installed. You do not need to navigate to the Anaconda directory.

EXAMPLE: conda 4.7.12

If you get an error message, make sure you closed and re-opened the terminal window after installing, or do it now. Then verify that you are logged into the same user account that you used to install Anaconda or Miniconda.

Update conda to the current version. Type the following:

Читайте также:  Copy from windows powershell

Conda compares versions and then displays what is available to install.

If a newer version of conda is available, type y to update:

We recommend that you always keep conda updated to the latest version.

Managing environmentsВ¶

Conda allows you to create separate environments containing files, packages, and their dependencies that will not interact with other environments.

When you begin using conda, you already have a default environment named base . You don’t want to put programs into your base environment, though. Create separate environments to keep your programs isolated from each other.

Create a new environment and install a package in it.

We will name the environment snowflakes and install the package BioPython. At the Anaconda Prompt or in your terminal window, type the following:

Conda checks to see what additional packages («dependencies») BioPython will need, and asks if you want to proceed:

Type «y» and press Enter to proceed.

To use, or «activate» the new environment, type the following:

Windows: conda activate snowflakes

macOS and Linux: conda activate snowflakes

conda activate only works on conda 4.6 and later versions.

For conda versions prior to 4.6, type:

Windows: activate snowflakes

macOS and Linux: source activate snowflakes

Now that you are in your snowflakes environment, any conda commands you type will go to that environment until you deactivate it.

To see a list of all your environments, type:

A list of environments appears, similar to the following:

The active environment is the one with an asterisk (*).

Change your current environment back to the default (base): conda activate

For versions prior to conda 4.6, use:

macOS, Linux: source activate

When the environment is deactivated, its name is no longer shown in your prompt, and the asterisk (*) returns to base. To verify, you can repeat the conda info —envs command.

Managing PythonВ¶

When you create a new environment, conda installs the same Python version you used when you downloaded and installed Anaconda. If you want to use a different version of Python, for example Python 3.5, simply create a new environment and specify the version of Python that you want.

Create a new environment named «snakes» that contains Python 3.9:

When conda asks if you want to proceed, type «y» and press Enter.

Activate the new environment:

Windows: conda activate snakes

macOS and Linux: conda activate snakes

conda activate only works on conda 4.6 and later versions.

For conda versions prior to 4.6, type:

Windows: activate snakes

macOS and Linux: source activate snakes

Verify that the snakes environment has been added and is active:

Conda displays the list of all environments with an asterisk (*) after the name of the active environment:

The active environment is also displayed in front of your prompt in (parentheses) or [brackets] like this:

Verify which version of Python is in your current environment:

Deactivate the snakes environment and return to base environment: conda activate

For versions prior to conda 4.6, use:

macOS, Linux: source activate

Managing packagesВ¶

In this section, you check which packages you have installed, check which are available and look for a specific package and install it.

To find a package you have already installed, first activate the environment you want to search. Look above for the commands to activate your snakes environment .

Check to see if a package you have not installed named «beautifulsoup4» is available from the Anaconda repository (must be connected to the Internet):

Conda displays a list of all packages with that name on the Anaconda repository, so we know it is available.

Install this package into the current environment:

Check to see if the newly installed program is in this environment:

Источник

Оцените статью