papermill icon indicating copy to clipboard operation
papermill copied to clipboard

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

Open aledifil opened this issue 4 years ago • 2 comments

🐛 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)

aledifil avatar Oct 28 '21 11:10 aledifil

Is there any progress?

fujiawei-dev avatar Apr 13 '22 05:04 fujiawei-dev

I think this is due to a version mismatch.

fny avatar Sep 30 '22 13:09 fny