Assumption: you want to work on / use software that has both:
e.g.
libxml
; When working on a Py + non-Py project we want:
numpy
1.12 sh miniconda-latest.sh
on macOS / Linux)~/miniconda3
) PATH
conda
can be found on your $PATH
:
export PATH="$HOME/miniconda3/bin:$PATH"
[will@acai ~]$ conda --version
conda 4.3.13
[will@acai ~]$ which python
/home/will/miniconda3/bin/python
[will@acai ~]$ python --version
Python 3.6.0 :: Continuum Analytics, Inc.
Small number of pkgs installed in root env:
[will@acai ~]$ conda list
# packages in environment at /home/will/miniconda3:
#
cffi 1.9.1 py36_0
conda 4.3.11 py36_0
conda-env 2.6.0 0
cryptography 1.7.1 py36_0
idna 2.2 py36_0
libffi 3.2.1 1
openssl 1.0.2k 0
pip 9.0.1 py36_1
pyasn1 0.1.9 py36_0
pycosat 0.6.1 py36_1
pycparser 2.17 py36_0
pyopenssl 16.2.0 py36_0
python 3.6.0 0
readline 6.2 2
requests 2.12.4 py36_0
ruamel_yaml 0.11.14 py36_1
setuptools 27.2.0 py36_0
six 1.10.0 py36_0
sqlite 3.13.0 0
tk 8.5.18 0
wheel 0.29.0 py36_0
xz 5.2.2 1
yaml 0.1.6 0
zlib 1.2.8 3
NB requests
is Python, zlib
is compiled shared library!
Best to create a new environment (distinct from the root) per project. Need a name and some pkgs (optionally with version nums and build nums):
[will@acai ~]$ conda create --name room101 python=3.5 beautifulsoup4
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /home/will/miniconda3/envs/room101:
The following NEW packages will be INSTALLED:
beautifulsoup4: 4.5.3-py35_0
openssl: 1.0.2k-1
pip: 9.0.1-py35_1
python: 3.5.3-1
readline: 6.2-2
setuptools: 27.2.0-py35_0
sqlite: 3.13.0-0
tk: 8.5.18-0
wheel: 0.29.0-py35_0
xz: 5.2.2-1
zlib: 1.2.8-3
...
source activate room101
source
' on Windows)
(room101) [will@acai ~]$ which python
/home/will/miniconda3/envs/room101/bin/python
(room101) [will@acai ~]$ python --version
Python 3.5.3 :: Continuum Analytics, Inc.
numpy
package using conda install PKGNAME
beautifulsoup4
package using conda remove PKGNAME
conda list
.
mock
testing tool using pip then re-run conda list
(room101) [will@acai ~]$ conda create --name piratical_fun r-base r-yaml
...
(room101) [will@acai ~]$ source activate piratical_fun
...
(piratical_fun) [will@acai ~]$ which R
/home/will/miniconda3/envs/piratical_fun/bin/R
(piratical_fun) [will@acai ~]$ R
...
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
...
> print("Arr!")
[1] "Arr!"
Okay, let's deactivate and delete our R environment:"But we're supposed to be talking about Python!"
(piratical_fun) [will@acai ~]$ source deactivate
[will@acai ~]$ conda env remove --name piratical_fun
[will@acai ~]$ rm -rf /home/will/miniconda3/envs/piratical_fun
[will@acai ~]$ source activate room101
(room101) [will@acai ~]$ conda env export > environment.yml
[will@thecloud ~]$ conda env create --name my-room101
WARNING: the list of packages is not just those explicitly installed. It can include OS-specific dependency packages so (unedited) environment files may not be as portable as you'd hope.
conda env export
to create and inspect an environment file
for the room101 environment
.
$ conda create --name room102 --clone room101
$PYTHON setup.py install
meta.yml
file containing package metadataconda build
can compile/bundle packages and optionally upload them to a repository.
joblib
: a small Py package matplotlib
: a large Py package that depends on some non-Py packages make
: a small C program conda install -c conda-forge mynewpkg
Thanks for listening!