我想使用 pip 安装 papermill[s3]。回溯中指示的命令是:pip install papermill[s3]。但是,当我运行命令时:pip3 install papermill[s3],我得到以下回溯:
zsh: no matches found: papermill[s3]
Run Code Online (Sandbox Code Playgroud)
我尝试浏览文档,但它们声明了完全相同的语法。
来源:https : //github.com/interact/papermill
更新:当我进入bash而不是zsh终端时,我可以安装相同的。
我想在 kubernetes 集群上部署 jupyter 笔记本。按照官方文档(https://zero-to-jupyterhub.readthedocs.io/en/latest/setup-jupyterhub.html),我运行了以下命令:
# Suggested values: advanced users of Kubernetes and Helm should feel
# free to use different values.
RELEASE=jhub
NAMESPACE=jhub
helm upgrade --install $RELEASE jupyterhub/jupyterhub \
--namespace $NAMESPACE \
--version=0.8.2 \
--values jupyter-hub-config.yaml
Run Code Online (Sandbox Code Playgroud)
文档中提到的配置文件在哪里jupyter-hub-config.yaml,包含由命令生成的令牌openssl rand -hex 32
。
运行上述命令时,出现以下错误:
Error: release jhub failed: persistentvolumeclaims "hub-db-dir" is forbidden: Internal error occurred: 8 default StorageClasses were found
Run Code Online (Sandbox Code Playgroud)
我尝试研究各种安装方法,jhub但没有人能指出这种方法的任何差异,我会认为这里会导致错误。
该命令的o/pkubectl get storageclass是:
NAME PROVISIONER AGE
aviral-worker-volume (default) kubernetes.io/aws-ebs 14d
default …Run Code Online (Sandbox Code Playgroud) 我想使用 Presto 创建一个 Hive 表,其中数据存储在 S3 上的 csv 文件中。
我已将文件上传到 S3,并且我确信 Presto 能够连接到存储桶。
现在,当我发出create table命令时,我在查询表时将所有值(行)都设为 NULL。
我尝试研究类似的问题,但结果发现 Presto 在 Stackoverflow 上并不那么出名。
文件中的一些行是:
PassengerId,Survived,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked
1,0,3,"Braund, Mr. Owen Harris",male,22,1,0,A/5 21171,7.25,,S
2,1,1,"Cumings, Mrs. John Bradley (Florence Briggs Thayer)",female,38,1,0,PC 17599,71.2833,C85,C
3,1,3,"Heikkinen, Miss. Laina",female,26,0,0,STON/O2. 3101282,7.925,,S
4,1,1,"Futrelle, Mrs. Jacques Heath (Lily May Peel)",female,35,1,0,113803,53.1,C123,S
5,0,3,"Allen, Mr. William Henry",male,35,0,0,373450,8.05,,S
6,0,3,"Moran, Mr. James",male,,0,0,330877,8.4583,,Q
7,0,1,"McCarthy, Mr. Timothy J",male,54,0,0,17463,51.8625,E46,S
8,0,3,"Palsson, Master. Gosta Leonard",male,2,3,1,349909,21.075,,S
9,1,3,"Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)",female,27,0,2,347742,11.1333,,S
10,1,2,"Nasser, Mrs. Nicholas (Adele Achem)",female,14,1,0,237736,30.0708,,C
11,1,3,"Sandstrom, Miss. Marguerite Rut",female,4,1,1,PP …Run Code Online (Sandbox Code Playgroud) 我想安装一个特定的库,其中包含需求中的几个模块。其中两个是sasl和sasl-thrift。我在安装它们时遇到错误,它们setup.py失败了。
我尝试通过错误并意识到gcc未安装在 docker 容器中,所以我安装了它。即使在那之后,我也遇到了同样的错误并且无法理解它。我还阅读了类似的问题,其中发现了 的用法,PyPy但我无法从它们中关联或推断出任何进一步的步骤。
我安装库的命令是:
python3 -m pip install git+https://github.com/my_org/my_lib.git@jupyter-notebooks-v1#egg=athena
Run Code Online (Sandbox Code Playgroud)
需求文件是:
# If your are using it with airflow.
apache-airflow[celery,postgres,hive,password,crypto]==1.10.3
# This file contain all the requirements to run dag and athena
tzlocal==1.5.1
urllib3==1.21.1
oauthlib==3.0.0
requests==2.18.4
coloredlogs==5.2
pymongo==3.6.1
fs==0.5.4
minio==4.0.6
sasl==0.2.1
thrift-sasl==0.3.0
boto3==1.9.115
botocore==1.12.115
mongoengine==0.17.0
haikunator==2.1.0
pycryptodome==3.7.3
pandas==0.24.2
pyarrow==0.12.1
CMRESHandler==1.0.0
elasticsearch==7.0.0
Run Code Online (Sandbox Code Playgroud)
安装库时的错误是:
Found existing installation: oauthlib 3.0.1
Uninstalling oauthlib-3.0.1:
Successfully uninstalled oauthlib-3.0.1
Running setup.py install for fs ... done …Run Code Online (Sandbox Code Playgroud) 我的目标是从 git 构建容器映像,但仅限于特定分支。为此,在 my 中build.yaml,我必须指定 git 分支的 uri:
spec:
output:
to:
kind: ImageStreamTag
name: superset-custom-exporter:latest
source:
git:
uri: https://gitlab.cee.domain.com/repo-org/repo-name.git
type: Git
Run Code Online (Sandbox Code Playgroud)
这将获取主分支,但是,我想要该superset-custom-exporter分支。我怎么做?
我尝试通过网络和命令测试某些URL [1] git clone,但都失败了。
#浏览Rust 官方书籍的泛型类型章节,我注意到我们必须如下定义泛型函数:
fn largest<T>(list: &[T]) -> T {
我的疑问是:为什么<T>要在 后面添加largest?我们不会对非泛型函数执行此操作,例如:fn largest(list: &[i32]) -> i32。
我想根据另一列的值创建一个新列,其中有某些条件要为新列中分配的值进行评估。
我阅读了一些涉及但无法推断出最佳(有效)Pythonic 方式的问题和答案(Numpy np.where multiple condition)np.where()。
示例数据框是:
period
0 JAN16
1 YTD JAN16
Run Code Online (Sandbox Code Playgroud)
我想period_type在以下条件下为列分配值:如果期间以 x 开头(其中 x 是列表中的任何元素 -> ['JAN', 'FEB', 'MAR', 'APR', 'MAY', ' JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']), 然后 period_type = 'month', else, period_type = period.split(0)
我希望数据框是:
period period_type
0 JAN16 month
1 JAN16 YTD
Run Code Online (Sandbox Code Playgroud)
我无法在我的代码中应用任何逻辑:
df.loc[df['c1'] == 'Value', 'c2'] = 10
Run Code Online (Sandbox Code Playgroud)
或者:
df['c2'] = np.where(df.c1 == 8,'X',df.c3)
Run Code Online (Sandbox Code Playgroud) 我正在使用一个hex!只接受字符串文字的宏。我有一个从函数返回并存储在变量中的值。我无法对值进行硬编码并调用此函数。那么,如何hex!使用变量调用宏?
这是我的工作代码:
let account: AccountId32 = hex_literal::hex!["d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"].into();
Run Code Online (Sandbox Code Playgroud)
这是我面临错误的代码:
let account_id = "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d";
let account: AccountId32 = hex_literal::hex!(&account_id).into();
Run Code Online (Sandbox Code Playgroud)
错误是:
let account: AccountId32 = hex_literal::hex!["d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"].into();
Run Code Online (Sandbox Code Playgroud)
hex!宏的所有示例仅使用字符串文字来演示它。