-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathAnaconda Document;Note=Erxin.txt
200 lines (138 loc) · 6.56 KB
/
Anaconda Document;Note=Erxin.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
Anaconda Document;Note=Erxin
# Reference
- website
https://docs.anaconda.com/anaconda/
- components
+ navigator, GUI
$ anaconda-navigator
+ conda, is for command line
basics:
$ conda info
$ conda update conda
$ conda install <package-name>
run a package
$ package-name
update any installed package
$ conda update <package-name>
get help
$ command-name --help
$ conda install --help
using environment:
$ conda create ---name <environment-name> python=<version such as 3.5>
$ activate <env-name> // window
$ source activate <env-name> //linux
$ conda env list
$ conda create --clone <env-name> --name <new-env-name>
$ conda list //list all package in current env
$ conda list --revisions
$ conda install --revision # //restore environment to a previous revision
$ conda env remove --name <env-name>
$ conda create --name <env-name> biopython // stack command create a new environment
finding conda package:
$ conda search <package-name>
all the avaliable package list https://docs.anaconda.com/anaconda/packages/pkg-docs
install and update package
$ conda install <package-name>
$ conda install --name <env-name> <package-name>
$ conda update <package-name>
$ conda install --channel <channel-name> <package-name>
$ pip install <package-name> //install package from pypi into current env
$ conda remove --name <env-name> <package-list>
managing multiple versions of python
$ conda create --name <env-name> python=<version>
specifying version numbers
fuzzy numpy=1.11
exact numpy==1.11
greater than or equal to "numpy>=1.11"
OR "numpy=1.11.1|1.11.3"
AND "numpy>=1.8,<2"
# Conda
- overview
- directory structure, anaconda or miniconda was installed into
/opt/Anaconda #Linux
C:\Anaconda #Windows
/pkgs, Also referred to as PKGS_DIR. This directory contains decompressed packages, ready to be linked in conda environments.
The following subdirectories comprise the default Anaconda environment:
/bin
/include
/lib
/share
- conda environments, You can also share your environment with someone by giving them a copy of your environment.yaml file.
- download
+ anaconda, https://www.anaconda.com/download/
+ miniconda, https://conda.io/miniconda.html
+ enterprise, https://www.anaconda.com/enterprise/
- anaconda or miniconda
+ Anaconda if you:
Are new to conda or Python.
Like the convenience of having Python and over 150 scientific packages automatically installed at once.
Have the time and disk space—a few minutes and 300 MB.
Do not want to individually install each of the packages you want to use.
+ Miniconda
Miniconda if you:
Do not mind installing each of the packages you want to use individually.
Do not have time or disk space to install over 150 packages at once.
Want fast access to Python and the conda commands and you wish to sort out the other programs later.
- update conda
Open your Anaconda Prompt from the start menu.
Navigate to the anaconda directory.
Run conda update conda.
- silent install miniconda
start /wait "" Miniconda4-latest-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\Miniconda3
# Configuration
- using the .condarc conda configuration file, The conda configuration file, .condarc, is an optional runtime configuration file that allows advanced users to configure various aspects of conda
.condarc configuration file follows simple YAML syntax.
- sample .condarc file link
https://conda.io/docs/user-guide/configuration/sample-condarc.html
- set configuration options, edit the .condarc file directly or use the conda config --set command
- You can change this by modifying the channel_alias as described in Set a channel alias (channel_alias).
- always yes for install
always_yes: True
- default channels
| default_channels:
| - <anaconda_dot_org_username>
| - http://some.custom/channel
| - file:///some/local/directory
- proxy setting
proxy_servers:
http: http://user:[email protected]:8080
https: https://user:[email protected]:8080
- enable tab completion
$ conda install argcomplete
- disable SSL verification
Using conda with SSL is strongly recommended, but it is possible to disable SSL and it may be necessary to disable SSL in certain cases.
Some corporate environments use proxy services that use Man-In-The-Middle (MITM) attacks to sniff encrypted traffic. These services can interfere with SSL connections such as those used by conda and pip to download packages from repositories such as PyPI.
# Tutorials
- building conda packages with conda skeleton, how to quickly build a conda package for a Python module that is already available on PyPI.
- Pyinstrument is a Python statistical profiler that records the whole call stack once each millisecond
- The conda skeleton command picks up the PyPI package metadata and prepares the conda build recipe. The final step is to build the package itself and install it into your conda environment.
$ conda skeleton pypi pyinstrument
three files are collectively referred to as the “conda build recipe”:
meta.yaml—Contains all the metadata in the recipe. Only the package name and package version sections are required—everything else is optional.
bld.bat—Windows commands to build the package.
build.sh—macOS and Linux commands to build the package.
- converting conda pacakge for other platforms have built a package for your current platform with conda build, you can convert it for use on other platforms with the conda convert command
osx-64.
linux-32.
linux-64.
win-32.
win-64.
all.
$ conda convert -f --platform all C:\Users\jsmith\Miniconda\conda-bld\win-64\pyinstrument-0.13.1-py27_0.tar.bz2
-o outputdir\
- optional uploading packages to anaconda.org
# Bokeh
- reference
https://bokeh.pydata.org/en/latest/
- Bokeh is an interactive visualization library
# Dask
- reference
https://dask.pydata.org/en/latest/
- Dask uses existing Python APIs and data structures to make it easy to switch between Numpy, Pandas, Scikit-learn to their Dask-powered equivalents.
- Dask provides advanced parallelism for analytics, enabling performance at scale for the tools you love
# MKL optimizations
MKL Optimizations
- reference
https://docs.anaconda.com/mkl-optimizations/
- introduction
Developed specifically for science, engineering, and financial computations, Intel™ Math Kernel Library (MKL) is a set of threaded and vectorized math routines that work to accelerate various math functions and applications. Anaconda has packaged MKL-powered binary versions of some of the most popular numerical/scientific Python libraries into MKL Optimizations for improved performance.