从Google Datalab安装conda软件包 [英] Install conda package from Google Datalab

查看:189
本文介绍了从Google Datalab安装conda软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在Google Datalab笔记本中使用ospc taxcalc软件包的方法.此软件包必须通过conda安装.

I'm looking to use the ospc taxcalc package in a Google Datalab notebook. This package must be installed via conda.

Datalab默认情况下没有conda,因此此方法(来自 https://stackoverflow.com/a/33176085/1840471 )失败:

Datalab doesn't have conda by default, so this method (from https://stackoverflow.com/a/33176085/1840471) fails:

%%bash
conda install -c ospc taxcalc

通过pip安装也不起作用:

%%bash
pip install conda
conda install -c ospc taxcalc

错误:您用于conda的安装方法(可能是pip install condaeasy_install conda)与使用conda作为应用程序不兼容.如果您打算将conda作为独立应用程序安装,则当前支持的安装方法包括Anaconda安装程序和miniconda安装程序.您可以从 https://conda.io/miniconda.html 下载miniconda安装程序.

ERROR: The install method you used for conda--probably either pip install conda or easy_install conda--is not compatible with using conda as an application. If your intention is to install conda as a standalone application, currently supported install methods include the Anaconda installer and the miniconda installer. You can download the miniconda installer from https://conda.io/miniconda.html.

在该URL之后,我尝试了以下操作:

Following that URL, I tried this:

%%bash
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
bash Miniconda2-latest-Linux-x86_64.sh

wget可以工作,但是bash安装命令只是保持"Running ..."(运行)状态,看起来很永久.

wget works, but the bash command to install just kept in "Running..." state for seeming perpetuity.

这似乎是由于conda安装程序提示多次击键来审查许可证,然后提示yes指示接受许可证条款.因此,conda的静默模式安装看起来很有希望:

This seems to be due to the conda installer prompting for several Enter keystrokes to review the license, and then for a yes indicating acceptance of the license terms. So conda's silent mode installation looked promising:

%%bash
bash Miniconda2-latest-Linux-x86_64.sh -u -b -p $HOME/miniconda

这会产生以下警告:

警告:您当前设置了PYTHONPATH环境变量.在Miniconda2中运行Python解释器时,这可能会导致意外的行为.为了获得最佳结果,请验证您的PYTHONPATH仅指向与Miniconda2中的Python解释器兼容的软件包目录:/content/miniconda

WARNING: You currently have a PYTHONPATH environment variable set. This may cause unexpected behavior when running the Python interpreter in Miniconda2. For best results, please verify that your PYTHONPATH only points to directories of packages that are compatible with the Python interpreter in Miniconda2: /content/miniconda

并且不提供conda命令:

%%bash
conda install -c ospc taxcalc

bash:第1行:conda:找不到命令

bash: line 1: conda: command not found

推荐答案

跟踪此工作的github问题尚未解决- https://github.com/googledatalab/datalab/issues/1376

There is a pending github issue tracking this work - https://github.com/googledatalab/datalab/issues/1376

我相信我们将需要安装conda并将其用于python,pip和所有其他python软件包,在此期间,可能无法将两种python环境混合使用.但是,对conda有更多经验的人可能不知道.

I believe we will need to install conda and use that for python, pip and all other python packages, and in the interim it may not be possible to mix the two python environments. However someone with more experience with conda might know otherwise.

这篇关于从Google Datalab安装conda软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆