CommonsBuild/tec-rewards

Error when running the main script

Closed this issue · 3 comments

These are the messages I've encountered after installing all the requirements and run the main script python rad_main.py -p parameters.json

Black is not installed, parameters wont be formatted
Executing: 100%|████████████████████████████████| 26/26 [00:12<00:00,  2.13cell/s]
Black is not installed, parameters wont be formatted
Executing: 100%|████████████████████████████████| 52/52 [00:30<00:00,  1.73cell/s]
[NbConvertApp] WARNING | Config option `template_path` not recognized by `HTMLExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
Traceback (most recent call last):
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/bin/jupyter-nbconvert", line 8, in <module>
    sys.exit(main())
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/jupyter_core/application.py", line 264, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/traitlets/config/application.py", line 846, in launch_instance
    app.start()
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/nbconvert/nbconvertapp.py", line 369, in start
    self.convert_notebooks()
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/nbconvert/nbconvertapp.py", line 536, in convert_notebooks
    self.exporter = cls(config=self.config)
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/nbconvert/exporters/templateexporter.py", line 332, in __init__
    super().__init__(config=config, **kw)
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 118, in __init__
    self._init_preprocessors()
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/nbconvert/exporters/templateexporter.py", line 498, in _init_preprocessors
    super()._init_preprocessors()
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 275, in _init_preprocessors
    self.register_preprocessor(preprocessor, enabled=True)
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 236, in register_preprocessor
    preprocessor_cls = import_item(preprocessor)
  File "/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/traitlets/utils/importstring.py", line 30, in import_item
    module = __import__(package, fromlist=[obj])
ModuleNotFoundError: No module named 'jupyter_contrib_nbextensions'
Traceback (most recent call last):
  File "/Volumes/GoogleDrive/My Drive/CurrentProj/general_magic/tec-rewards/rad_main.py", line 114, in <module>
    os.rename(html_report_origin, html_report_destination)
FileNotFoundError: [Errno 2] No such file or directory: './distribution_results/round_x/results/output_notebooks/output_praiseAnalysis_test.html' -> './distribution_results/round_x/results/reports/praiseAnalysis_test_Report.html'

It seems nbconvert is missing something... That then triggers the FileNotFound because it didn't generate the origin HTML file. try "pip install nbconvert" or "conda install nbconvert" to see if it solves it. If not, maybe this thread can help? ipython-contrib/jupyter_contrib_nbextensions#1115

for one error fix, need to add "jupyter_contrib_nbextensions" in the requirement. so that ModuleNotFoundError disappear. but still face the FileNotFoundError.

Black is not installed, parameters wont be formatted
Executing: 100%|████████████████████████████████| 26/26 [00:06<00:00,  4.08cell/s]
Black is not installed, parameters wont be formatted
Executing: 100%|████████████████████████████████| 52/52 [00:25<00:00,  2.04cell/s]
[NbConvertApp] Converting notebook ./distribution_results/round_x/results/output_notebooks/output_praiseAnalysis_test.ipynb to html
/Users/zhiweili/opt/anaconda3/envs/rad_env/lib/python3.9/site-packages/nbconvert/filters/widgetsdatatypefilter.py:69: UserWarning: Your element with mimetype(s) dict_keys([]) is not able to be represented.
  warn("Your element with mimetype(s) {mimetypes}"
[NbConvertApp] Writing 9494693 bytes to distribution_results/round_x/results/output_notebooks/output_praiseAnalysis_test.html
Traceback (most recent call last):
  File "/Volumes/GoogleDrive/My Drive/CurrentProj/general_magic/tec-rewards/rad_main.py", line 89, in <module>
    for notebook in os.listdir(ANALYSIS_NOTEBOOK_FOLDER):
FileNotFoundError: [Errno 2] No such file or directory: './analysis_tools/notebooks/sourcecred/'
(rad_env) zhiweili@C02ZR26HMD6Q tec-rewards % pip show jupyter_contrib_nbextensions

Edited the main script to skip the reward systems without an analysis notebook provided.