You can create a new environment with the following command: $ conda create -name myenvname The command to remove an environment is: $ conda env remove -name ENVNAME $ conda deactivate # it returns you to the root/base environmnet To deactivate an environment and deactivate, you type the following commands: $ conda activate ENVANME For example, $ conda list -name test-env 'numpy|pandas' Switch -name or -n allows you to query anotherĮnvironment. Or you may wish to find out what versions you or aĬolleague used in some prior project (developed in that other environment). You mightĭo this simply to verify the package versions in that environment that you needįor a given project. Useful to query a different environment’sĬonfiguration (i.e., as opposed to the currently active environment). How to get the installed packages in an environment? With the following command, you can get the list of the conda environments and the currently activated one is marked with an asterisk in the middle column. Run conda info with specifiers for numpy version and Python version. This is often useful to match 'foo=1.2.3=p圓6*' because recent builds have attached the hash of the build at the end of the Python version string, making the exact match unpredictable.ĭetermine the dependencies of the package numpy 1.13.1 with Python 3.6.0 on your current platform. You may use the * wildcard within the match pattern. You can narrow your query further with, e.g.: $ conda info cytoolz=0.8.2=p圓6_0 As this package has been built for a variety of Python versions, a number of packages will be reported on. The syntax for specifying just one version is a little bit complex, but prefix notation is allowed here (just as you would with conda install).įor example, running conda info cytoolz=0.8.2 will report on all available package versions. The conda info command reports a variety of details about a specific package. How to find dependencies for a package version? $ conda search conda-forge::numpy conda search 'numpy' #Search for a package on a specific channel You could spell that as: $ conda install 'bar-lib>1.3.4,=1.12' The latest version available (perhaps even 1.5 or 2.0 have come out), but stillĪvoiding versions 1.1 through 1.3.4. Maybe the bug above was fixed in 1.3.5, and you would like either Inequality comparisons to select candidate versions (still resolving dependencyĬonsistency). Install either bar-lib versions 1.0, 1.4 or 1.4.1b2, but definitely Powerful comparison operations to narrow versions. You’ll use prefix-notation to specify the package version(s) to install. Well with: $ conda install foo-lib=14.3.2 Narrow the installation down to an exact PATCH level, you can specify that as You could spell that as: $ conda install foo-lib=13 May want a particular major version, and prefer conda to select the latestĬompatible MINOR version as well as PATCH level. You could spell that as: $ conda install foo-lib=12.3 For example, you might want a MAJOR and MINOR version, but want conda to select the most up-to-date PATCH version within that series. Your most common pattern will probably be prefix notation, using semantic versioning. How to install a specific version of a package?Ĭonda allows you to install software versions in several flexible ways. The following command lists all the installed packages. That is, packages you didn’t install explicitly get installed for you to resolve another package’s dependencies. $ conda -Vīecause conda installs packages automatically, it’s hard to know which package versions are actually on your system. Run a command to determine what version of conda you have installed. You can download the Anaconda Distribution from the official site. With over 15 million users worldwide, it is the industry standard for developing, testing, and training on a single machine. The open-source Anaconda Distribution is the easiest way to perform Python/R data science and machine learning on Linux, Windows, and Mac OS X. Notice that conda supports Python, R, Scala and Julia but we will focus on Python in this post. It is very important when we are working on a project to be reproducible and for that reason, we want to be able to share our working environment with our colleagues, or each project to be in a different environment. This post is a gentle introduction about Anaconda Environments which is like the “ Docker” of the Machine Learning projects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |