Issue
Jupyter-notebook
performance started degrading about a week ago. This morning it crashed completely, and when re-launched, the following error was thrown:
Uncaught exception GET /api/contents?type=directory&_=1697599475367 (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/contents?type=directory&_=1697599475367', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tornado/web.py", line 1786, in _execute
result = await result
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tornado/gen.py", line 234, in wrapper
yielded = ctx_run(next, result)
^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/notebook/services/contents/handlers.py", line 111, in get
model = yield gen.maybe_future(self.contents_manager.get(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/notebook/services/contents/filemanager.py", line 431, in get
model = self._dir_model(path, content=content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/notebook/services/contents/filemanager.py", line 337, in _dir_model
if self.should_list(name) and not is_file_hidden(os_path, stat_res=st):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/notebook/utils.py", line 146, in is_file_hidden_posix
stat_res = os.stat(abs_path)
^^^^^^^^^^^^^^^^^
NotADirectoryError: [Errno 20] Not a directory: '/Users/name/python'
The file its referencing is a Python alias that when opened returns The operation can’t be completed because the original item for “python” can’t be found.
Scripts ran through the Python3.11.5 IDLE work properly. Apache Airflow works as intended.There seem to be no other discernible issues.
I've also tried replacing the corrupted alias referenced above to point to a new, working version of python and that didn't work.
I ran brew update && brew doctor && brew install jupyter
, and the issue persisted, albeit the error message was slightly different: Unknown error checking if file '/Users/name/python' is hidden
Solution
For any folks who encounter this issue in the future:
Somehow manually removing and updating the aliased python file did not work, but doing so via the Terminal did.
Remove broken alias
rm -r /Users/name/python
Symlink
ln -s /Library/Frameworks/Python.framework/Versions/3.11/python /Users/name/python
Answered By - Jkiefn1
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.