nteract/papermill

ImportError: cannot import name 'GitWildMatchPatternError' from 'pathspec.patterns.gitwildmatch'

开放

#639 创建于 2021年10月28日

 (2 条评论) (7 个反应) (0 位负责人)Python (402 个派生)batch import
bughelp wanted

仓库指标

星标
 (5,381 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

🐛 Bug

I used to run papermill without any issues, but I recently updated some packages and I'm now having this specific issue: ImportError: cannot import name 'GitWildMatchPatternError' from 'pathspec.patterns.gitwildmatch'

I'm still learning python but I seem to understand there is some issue with the interpreter of the parameters dictionary. I tried making a simple notebook with just one parameter, but I'm still having the error: pm.execute_notebook('C:/Users/adifili/JupyterMinian/papermillCall.ipynb', 'C:/Users/adifili/JupyterMinian/papermillCallOutput.ipynb', parameters= dict(folder = "D:/Temporary/"), kernel_name='minian')

Any help is greatly appreciated. This is the full error:

ImportError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_16868/8756588.py in ----> 1 pm.execute_notebook('C:/Users/adifili/JupyterMinian/papermillCall.ipynb', 2 'C:/Users/adifili/JupyterMinian/papermillCallOutput.ipynb', 3 parameters= dict(folder = "D:/Temporary/"), kernel_name='minian')

C:\Anaconda\envs\minian\lib\site-packages\papermill\execute.py in execute_notebook(input_path, output_path, parameters, engine_name, request_save_on_cell_execute, prepare_only, kernel_name, language, progress_bar, log_output, stdout_file, stderr_file, start_timeout, report_mode, cwd, **engine_kwargs) 92 # Parameterize the Notebook. 93 if parameters: ---> 94 nb = parameterize_notebook( 95 nb, parameters, report_mode, kernel_name=kernel_name, language=language 96 )

C:\Anaconda\envs\minian\lib\site-packages\papermill\parameterize.py in parameterize_notebook(nb, parameters, report_mode, comment, kernel_name, language) 81 82 # Generate parameter content based on the kernel_name ---> 83 param_content = translate_parameters(kernel_name, language, parameters, comment) 84 85 newcell = nbformat.v4.new_code_cell(source=param_content)

C:\Anaconda\envs\minian\lib\site-packages\papermill\translators.py in translate_parameters(kernel_name, language, parameters, comment) 555 556 def translate_parameters(kernel_name, language, parameters, comment='Parameters'): --> 557 return papermill_translators.find_translator(kernel_name, language).codify(parameters, comment)

C:\Anaconda\envs\minian\lib\site-packages\papermill\translators.py in codify(cls, parameters, comment) 187 if sys.version_info >= (3, 6): 188 # Put content through the Black Python code formatter --> 189 import black 190 191 fm = black.FileMode(string_normalization=False)

C:\Anaconda\envs\minian\lib\site-packages\black_init_.py in 10 import os 11 from pathlib import Path ---> 12 from pathspec.patterns.gitwildmatch import GitWildMatchPatternError 13 import regex as re 14 import signal

ImportError: cannot import name 'GitWildMatchPatternError' from 'pathspec.patterns.gitwildmatch' (C:\Anaconda\envs\minian\lib\site-packages\pathspec\patterns\gitwildmatch.py)

贡献者指南