http://conda.pydata.org/docs/config.html#channel-locations-channels
安装HappyBase等Python包
默认的channel中没有happybase,需要从anaconda查找。
接下来使用conda-forge中的happybase安装(指定channel 为conda-forge):
接下来再安装PostgreSQL的包:
如果网络连接有问题,可以 添加一个清华大学的TUNA镜像源:
https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
conda config --set show_channel_urls yes
查看.condarc文件的内容,已经加入的清华的源:
查找包,可以看到把各个源的包都列了出来:
自定义本地channel
Channels are the path that conda takes to look for packages, and the easiest way to use and manage custom channels is to use a private or public repository on Anaconda.org , formerly known as Binstar.org. If you designate your Anaconda.org repository as private, then only you, and those you grant access, can access your private repository.
If you do not wish to upload your packages to the internet, however, you can build a custom repository served either through a web server, or locally using a file:// url.
1. Organize packages into platform subdirectories
将python 包放在各个平台的文件夹下:
2. 在各个子目录运行conda index
conda index linux-64
我们只运行linux目录。运行完成后,会在每个目录下产生一个文件repodata.json
3. 测试
运行如下命令,显示本地可用包:
conda search -c file://opt/channel/ --override-channels
Note: the –override-channels is to be sure conda only searches your specified channel and no other channels, such as default channels or any other channels you may have listed in your .condarc file.
除了每次指定本地源的方法外,还可以在用户根目录下的配置文件.condarc里进行设置:
- file://opt/channel/
- defaults
# Show channel URLs when displaying what is going to be downloaded and # in 'conda list'.
The default is False.
show_channel_urls : True
离线创建自定义环境