Anaconda包查找,conda自定义本地channel作为python package源进行离线安装,离线创建环境

 http://user.qzone.qq.com/892054726/blog/1467193413
参考链接:http://conda.pydata.org/docs/custom-channels.html
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 包放在各个平台的文件夹下:
 

下图是从 在线Linux服务器Anaconda2\pkgs拷贝到离线服务器pkgs文件夹下的linux-64目录后的结果:
 



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里进行设置:

channels :  
  -   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


 
离线创建自定义环境
 







  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值