-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notebook to HTML script #543
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #543 +/- ##
=======================================
Coverage 99.68% 99.68%
=======================================
Files 14 14
Lines 3097 3097
Branches 467 467
=======================================
Hits 3087 3087
Misses 4 4
Partials 6 6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks great but I had dependency issues running it.
I am getting this error:
Traceback (most recent call last):
File ".../pycm/Otherfiles/notebook_to_html.py", line 11, in <module>
from jupyter_contrib_nbextensions.nbconvert_support import TocExporter
File ".../pycm/.venv/lib/python3.10/site-packages/jupyter_contrib_nbextensions/nbconvert_support/__init__.py", line 5, in <module>
from .collapsible_headings import ExporterCollapsibleHeadings
File ".../pycm/.venv/lib/python3.10/site-packages/jupyter_contrib_nbextensions/nbconvert_support/collapsible_headings.py", line 6, in <module>
from notebook.services.config import ConfigManager
ModuleNotFoundError: No module named 'notebook.services'
I installed the earliest version of libraries but it didn't work. You can see my pip freeze
here:
anyio==4.4.0
appnope==0.1.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
art==6.2
asttokens==2.4.1
async-lru==2.0.4
attrs==23.2.0
Babel==2.15.0
bandit==1.7.9
beautifulsoup4==4.12.3
bleach==6.1.0
certifi==2024.7.4
cffi==1.16.0
charset-normalizer==3.3.2
comm==0.2.2
contourpy==1.2.1
coverage==7.6.0
cycler==0.12.1
debugpy==1.8.2
decorator==5.1.1
defusedxml==0.7.1
exceptiongroup==1.2.2
executing==2.0.1
fastjsonschema==2.20.0
fonttools==4.53.1
fqdn==1.5.1
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
iniconfig==2.0.0
ipykernel==6.29.5
ipython==8.26.0
ipython-genutils==0.2.0
ipywidgets==8.1.3
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.4
json5==0.9.25
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.10.0
jupyter-highlight-selected-word==0.2.0
jupyter-lsp==2.2.5
jupyter_client==8.6.2
jupyter_contrib_core==0.4.2
jupyter_contrib_nbextensions==0.7.0
jupyter_core==5.7.2
jupyter_nbextensions_configurator==0.6.4
jupyter_server==2.14.2
jupyter_server_terminals==0.5.3
jupyterlab==4.2.4
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.3
jupyterlab_widgets==3.0.11
kiwisolver==1.4.5
lxml==5.2.2
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.9.1
matplotlib-inline==0.1.7
mdurl==0.1.2
mistune==3.0.2
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
notebook==7.2.1
notebook_shim==0.2.4
numpy==2.0.0
overrides==7.7.0
packaging==24.1
pandas==2.2.2
pandocfilters==1.5.1
parso==0.8.4
pbr==6.0.0
pexpect==4.9.0
pillow==10.4.0
platformdirs==4.2.2
pluggy==1.5.0
prometheus_client==0.20.0
prompt_toolkit==3.0.47
psutil==6.0.0
ptyprocess==0.7.0
pure_eval==0.2.3
pycm @ file:///Users/sadra/OpenSource/pycm
pycparser==2.22
pydocstyle==6.3.0
Pygments==2.18.0
pyparsing==3.1.2
pytest==8.3.2
pytest-cov==5.0.0
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pytz==2024.1
PyYAML==6.0.1
pyzmq==26.0.3
qtconsole==5.5.2
QtPy==2.4.1
referencing==0.35.1
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rich==13.7.1
rpds-py==0.19.1
seaborn==0.13.2
Send2Trash==1.8.3
six==1.16.0
sniffio==1.3.1
snowballstemmer==2.2.0
soupsieve==2.5
stack-data==0.6.3
stevedore==5.2.0
terminado==0.18.1
tinycss2==1.3.0
tomli==2.0.1
tornado==6.4.1
traitlets==5.9.0
types-python-dateutil==2.9.0.20240316
typing_extensions==4.12.2
tzdata==2024.1
uri-template==1.3.0
urllib3==2.2.2
vulture==2.11
wcwidth==0.2.13
webcolors==24.6.0
webencodings==0.5.1
websocket-client==1.8.0
widgetsnbextension==4.0.11
I searched for the solution and this link's suggestion with the most likes, pip install --upgrade notebook==6.4.12
, worked finally.
Maybe it's better to specify the requirement for this somewhere.
@sadrasabouri |
@sadrasabouri I couldn't reproduce this issue, and I think it's also related to a version difference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good, but again trying to run it I got: (Both in Python 3.10 and Python 3.12)
Traceback (most recent call last):
File ".../pycm/Otherfiles/notebook_to_html.py", line 7, in <module>
import nbformat
File ".../pycm/.venv/lib/python3.10/site-packages/nbformat/__init__.py", line 14, in <module>
from . import v1
File ".../pycm/.venv/lib/python3.10/site-packages/nbformat/v1/__init__.py", line 19, in <module>
from .nbjson import reads as reads_json, writes as writes_json
File ".../pycm/.venv/lib/python3.10/site-packages/nbformat/v1/nbjson.py", line 19, in <module>
from base64 import encodestring
ImportError: cannot import name 'encodestring' from 'base64' (/opt/homebrew/Cellar/[email protected]/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/base64.py)
Maybe that's a problem with my operating system (rn it's MacOS)
@sadrasabouri Could you please install |
It fixed it and there is another one now:
|
@sadrasabouri |
OK, I tried that and it gave me another error.
I searched it and apparently it's an issue regarding to Python version. I tried Python 3.10 and 3.12 both failed. |
@sadrasabouri Yeah, you are right. There are some backward compatibility issues. We will fix them later. I've made changes to Please re-review 🔥 |
Still not working. I got this on Python 3.9 (this time on Ubuntu):
Also I we should add following lines to
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a comment, still not working.
@sadrasabouri Added in 3445b8e |
@sadrasabouri |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, so we'll fix it later.
Reference Issues/PRs
#497
What does this implement/fix? Explain your changes.
doc_to_html.bat
-->notebook_to_html.py
RELEASE.md
updatedAny other comments?