Skip to content
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

snippets manager keeps leftover trash after being uninstalled... Cannot get rid of errors from Elyra days... #252

Open
richlysakowski opened this issue Apr 20, 2023 · 1 comment

Comments

@richlysakowski
Copy link

richlysakowski commented Apr 20, 2023

Describe the bug

I want to love this extension, but its still got Elyra disease. The first time I ever installed it in the original Elyra format it corrupted my system permanently, eventually requiring me to remove and re-install Anaconda.

Sometimes it works and other times it works for a while and then breaks (and leaves the following errors at the bottom of this post). I have installed it at least 10 times in different conda environments over the past 4 years and about 4-5 times it ends up getting corrupted for some reason I have not been able to determine.

This current installation has been throwing the same error (below) for months now. Tonight (again) I tried to eradicate it, and after uninstalling it completely using the recommended command "jupyter labextension uninstall jupyterlab-code-snippets", the error still persists. The uninstall command finishes as though it succeeded. I even tried "pip uninstall jupyterlab-code-snippets", which says that it no longer exists.

It shows up after removing it and restarting the server a few times. I thought all traces of an extension are supposed to disappear after they are uninstalled?

Where do I remove this from the Jupyter "System Defaults" configuration file?

####################
Configuration settings:

(base) C:\Windows\system32>jupyter --paths --json
{"runtime": ["C:\Users\PowerUser\AppData\Roaming\jupyter\runtime"], "config": ["C:\Users\PowerUser\.jupyter", "C:\Users\PowerUser\AppData\Roaming\Python\etc\jupyter", "C:\ProgramData\Anaconda3\etc\jupyter", "C:\ProgramData\jupyter"], "data": ["C:\Users\PowerUser\AppData\Roaming\jupyter", "C:\Users\PowerUser\AppData\Roaming\Python\share\jupyter", "C:\ProgramData\Anaconda3\share\jupyter", "C:\ProgramData\jupyter"]}

(base) C:\Windows\system32>

#####################################

(base) C:\Windows\system32>jupyter --version
Selected Jupyter core packages...
IPython : 8.12.0
ipykernel : 6.22.0
ipywidgets : 8.0.6
jupyter_client : 8.2.0
jupyter_core : 5.3.0
jupyter_server : 2.5.0
jupyterlab : 3.5.3
nbclient : 0.7.3
nbconvert : 7.3.1
nbformat : 5.8.0
notebook : 6.5.4
qtconsole : 5.4.2
traitlets : 5.9.0

Python 3.9.16
Windows 10 Professional

Browsers: Firefox
Chrome
Edge Version 112.0.1722.48 (Official build) (64-bit) (latest.)
#######################################
image

LabApp] Failed validating settings (jupyterlab-code-snippets:snippets): Additional properties are not allowed ('snippetPreviewFontSize' was unexpected)

Failed validating 'additionalProperties' in schema:
    {'additionalProperties': False,
     'definitions': {'snippet': {'properties': {'code': {'type': 'array'},
                                                'description': {'type': 'string'},
                                                'id': {'type': 'number'},
                                                'language': {'type': 'string'},
                                                'name': {'type': 'string'},
                                                'tags': {'type': 'array'}},
                                 'required': ['id', 'name', 'language'],
                                 'type': 'object'}},
     'description': 'Code Snippet Manager Settings',
     'jupyter.lab.setting-icon': 'custom-ui-components:codeSnippetIcon',
     'jupyter.lab.setting-icon-label': 'Code Snippet',
     'jupyter.lab.shortcuts': [{'command': 'codeSnippet:save-as-snippet',
                                'keys': ['Accel Shift A'],
                                'selector': '.jp-Notebook'},
                               {'command': 'codeSnippet:save-as-snippet',
                                'keys': ['Accel Shift A'],
                                'selector': '.jp-FileEditor'}],
     'properties': {'snippets': {'default': [{'code': ['import '
                                                       'matplotlib.pyplot '
                                                       'as plt',
                                                       'import numpy as np',
                                                       '',
                                                       'x = np.linspace(0, '
                                                       '10, 100)',
                                                       '',
                                                       'plt.plot(x, '
                                                       'np.sin(x))',
                                                       'plt.plot(x, '
                                                       'np.cos(x))',
                                                       '',
                                                       'plt.show()'],
                                              'description': 'Plotting '
                                                             'code for '
                                                             'sine graph '
                                                             'using '
                                                             'matplotlib.',
                                              'id': 0,
                                              'language': 'Python',
                                              'name': 'Plotting_sine',
                                              'tags': ['plot']},
                                             {'code': ['import numpy as np',
                                                       'import scipy',
                                                       'import pandas as '
                                                       'pd',
                                                       'import '
                                                       'matplotlib.pyplot '
                                                       'as plt',
                                                       'import seaborn as '
                                                       'sns'],
                                              'description': 'Import '
                                                             'useful '
                                                             'packages for '
                                                             'data '
                                                             'analytics',
                                              'id': 1,
                                              'language': 'Python',
                                              'name': 'Importing packages '
                                                      'for data analytics',
                                              'tags': ['data analytics']},
                                             {'code': ['import keras',
                                                       'import sklearn',
                                                       'import torch',
                                                       'import tensorflow '
                                                       'as tf'],
                                              'description': 'Import '
                                                             'useful '
                                                             'packages for '
                                                             'machine '
                                                             'learning',
                                              'id': 2,
                                              'language': 'Python',
                                              'name': 'Importing packages '
                                                      'for machine '
                                                      'learning',
                                              'tags': ['machine '
                                                       'learning']}],
                                 'description': 'The list of snippets.',
                                 'items': {'$ref': '#/definitions/snippet'},
                                 'title': 'Code Snippets',
                                 'type': 'array'}},
     'title': 'Code Snippet Manager',
     'type': 'object',
     'version': '1.0.0'}

On instance:
    {'snippetPreviewFontSize': 3}

[W 2023-04-20 01:56:21.155 LabApp] Failed validating settings (jupyterlab-code-snippets:snippets): Additional properties are not allowed ('snippetPreviewFontSize' was unexpected)

Failed validating 'additionalProperties' in schema:
    {'additionalProperties': False,
     'definitions': {'snippet': {'properties': {'code': {'type': 'array'},
                                                'description': {'type': 'string'},
                                                'id': {'type': 'number'},
                                                'language': {'type': 'string'},
                                                'name': {'type': 'string'},
                                                'tags': {'type': 'array'}},
                                 'required': ['id', 'name', 'language'],
                                 'type': 'object'}},
     'description': 'Code Snippet Manager Settings',
     'jupyter.lab.setting-icon': 'custom-ui-components:codeSnippetIcon',
     'jupyter.lab.setting-icon-label': 'Code Snippet',
     'jupyter.lab.shortcuts': [{'command': 'codeSnippet:save-as-snippet',
                                'keys': ['Accel Shift A'],
                                'selector': '.jp-Notebook'},
                               {'command': 'codeSnippet:save-as-snippet',
                                'keys': ['Accel Shift A'],
                                'selector': '.jp-FileEditor'}],
     'properties': {'snippets': {'default': [{'code': ['import '
                                                       'matplotlib.pyplot '
                                                       'as plt',
                                                       'import numpy as np',
                                                       '',
                                                       'x = np.linspace(0, '
                                                       '10, 100)',
                                                       '',
                                                       'plt.plot(x, '
                                                       'np.sin(x))',
                                                       'plt.plot(x, '
                                                       'np.cos(x))',
                                                       '',
                                                       'plt.show()'],
                                              'description': 'Plotting '
                                                             'code for '
                                                             'sine graph '
                                                             'using '
                                                             'matplotlib.',
                                              'id': 0,
                                              'language': 'Python',
                                              'name': 'Plotting_sine',
                                              'tags': ['plot']},
                                             {'code': ['import numpy as np',
                                                       'import scipy',
                                                       'import pandas as '
                                                       'pd',
                                                       'import '
                                                       'matplotlib.pyplot '
                                                       'as plt',
                                                       'import seaborn as '
                                                       'sns'],
                                              'description': 'Import '
                                                             'useful '
                                                             'packages for '
                                                             'data '
                                                             'analytics',
                                              'id': 1,
                                              'language': 'Python',
                                              'name': 'Importing packages '
                                                      'for data analytics',
                                              'tags': ['data analytics']},
                                             {'code': ['import keras',
                                                       'import sklearn',
                                                       'import torch',
                                                       'import tensorflow '
                                                       'as tf'],
                                              'description': 'Import '
                                                             'useful '
                                                             'packages for '
                                                             'machine '
                                                             'learning',
                                              'id': 2,
                                              'language': 'Python',
                                              'name': 'Importing packages '
                                                      'for machine '
                                                      'learning',
                                              'tags': ['machine '
                                                       'learning']}],
                                 'description': 'The list of snippets.',
                                 'items': {'$ref': '#/definitions/snippet'},
                                 'title': 'Code Snippets',
                                 'type': 'array'}},
     'title': 'Code Snippet Manager',
     'type': 'object',
     'version': '1.0.0'}

On instance:
    {'snippetPreviewFontSize': 3}

[I 2023-04-20 01:56:22.887 LabApp] Build is up to date
[W 2023-04-20 01:56:29.766 LabApp] Failed validating settings (jupyterlab-code-snippets:snippets): Additional properties are not allowed ('snippetPreviewFontSize' was unexpected)

Failed validating 'additionalProperties' in schema:
    {'additionalProperties': False,
     'definitions': {'snippet': {'properties': {'code': {'type': 'array'},
                                                'description': {'type': 'string'},
                                                'id': {'type': 'number'},
                                                'language': {'type': 'string'},
                                                'name': {'type': 'string'},
                                                'tags': {'type': 'array'}},
                                 'required': ['id', 'name', 'language'],
                                 'type': 'object'}},
     'description': 'Code Snippet Manager Settings',
     'jupyter.lab.setting-icon': 'custom-ui-components:codeSnippetIcon',
     'jupyter.lab.setting-icon-label': 'Code Snippet',
     'jupyter.lab.shortcuts': [{'command': 'codeSnippet:save-as-snippet',
                                'keys': ['Accel Shift A'],
                                'selector': '.jp-Notebook'},
                               {'command': 'codeSnippet:save-as-snippet',
                                'keys': ['Accel Shift A'],
                                'selector': '.jp-FileEditor'}],
     'properties': {'snippets': {'default': [{'code': ['import '
                                                       'matplotlib.pyplot '
                                                       'as plt',
                                                       'import numpy as np',
                                                       '',
                                                       'x = np.linspace(0, '
                                                       '10, 100)',
                                                       '',
                                                       'plt.plot(x, '
                                                       'np.sin(x))',
                                                       'plt.plot(x, '
                                                       'np.cos(x))',
                                                       '',
                                                       'plt.show()'],
                                              'description': 'Plotting '
                                                             'code for '
                                                             'sine graph '
                                                             'using '
                                                             'matplotlib.',
                                              'id': 0,
                                              'language': 'Python',
                                              'name': 'Plotting_sine',
                                              'tags': ['plot']},
                                             {'code': ['import numpy as np',
                                                       'import scipy',
                                                       'import pandas as '
                                                       'pd',
                                                       'import '
                                                       'matplotlib.pyplot '
                                                       'as plt',
                                                       'import seaborn as '
                                                       'sns'],
                                              'description': 'Import '
                                                             'useful '
                                                             'packages for '
                                                             'data '
                                                             'analytics',
                                              'id': 1,
                                              'language': 'Python',
                                              'name': 'Importing packages '
                                                      'for data analytics',
                                              'tags': ['data analytics']},
                                             {'code': ['import keras',
                                                       'import sklearn',
                                                       'import torch',
                                                       'import tensorflow '
                                                       'as tf'],
                                              'description': 'Import '
                                                             'useful '
                                                             'packages for '
                                                             'machine '
                                                             'learning',
                                              'id': 2,
                                              'language': 'Python',
                                              'name': 'Importing packages '
                                                      'for machine '
                                                      'learning',
                                              'tags': ['machine '
                                                       'learning']}],
                                 'description': 'The list of snippets.',
                                 'items': {'$ref': '#/definitions/snippet'},
                                 'title': 'Code Snippets',
                                 'type': 'array'}},
     'title': 'Code Snippet Manager',
     'type': 'object',
     'version': '1.0.0'}

On instance:
    {'snippetPreviewFontSize': 3}

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@richlysakowski
Copy link
Author

Found a solution in this post. You must remove the extra file leftover from a previous installation. The user-settings directory had a very old snippets config folder and file in it. Deleting that removed it from the Jupyter GUI.

See below from: jupyterlab/jupyterlab#4126

"there are probably stale settings files from a previous install (the editor settings JSON structure did change recently). You may find them in $HOME/.jupyter/lab/user-settings "

########################################################
server complains about additional properties not allowed #4126
########################################################
Closed

michaelaye opened this issue on Mar 6, 2018 · 3 comments
Comments
@michaelaye
michaelaye commented on Mar 6, 2018
I get this output in the terminal where I launched the jupyterlab server:

[W 11:26:11.545 LabApp] Additional properties are not allowed ('lineWrap' was unexpected)

Failed validating 'additionalProperties' in schema:
    {'additionalProperties': False,
     'definitions': {'editorConfig': {'additionalProperties': False,
                                      'properties': {'autoClosingBrackets': {'type': 'boolean'},
                                                     'insertSpaces': {'type': 'boolean'},
                                                     'lineNumbers': {'type': 'boolean'},
                                                     'lineWrap': {'type': 'boolean'},
                                                     'matchBrackets': {'type': 'boolean'},
                                                     'readOnly': {'type': 'boolean'},
                                                     'tabSize': {'type': 'number'}},
                                      'type': 'object'}},
     'description': 'Text editor settings.',
     'jupyter.lab.setting-icon-class': 'jp-TextEditorIcon',
     'jupyter.lab.setting-icon-label': 'Editor',
     'properties': {'editorConfig': {'$ref': '#/definitions/editorConfig',
                                     'default': {'autoClosingBrackets': True,
                                                 'insertSpaces': True,
                                                 'lineNumbers': True,
                                                 'lineWrap': True,
                                                 'matchBrackets': True,
                                                 'readOnly': False,
                                                 'tabSize': 4},
                                     'description': 'The configuration for '
                                                    'all text editors.',
                                     'title': 'Editor Configuration'}},
     'title': 'Text Editor',
     'type': 'object'}

On instance:
    {'lineWrap': True}

and when I look at the jupyterlab advanced settings editor, I see that it's set to True, but as you can see from the screenshot, that's what the settings came with, I didn't change anything, so what's this about?
screenshot 2018-03-06 11 28 43

Note that I previously installed alpha versions of j-lab, could this be a setting stored in non-conda folders that don't get wiped during a conda reinstall (which I do regularly for having a clean reproducible environment)?

j-lab version: 0.31.11-py36_1 conda-forge

ian-r-rose commented [on Mar 6, 2018](

jupyterlab/jupyterlab#4126 (comment))

Hi @michaelaye, I suspect you are right: there are probably stale settings files from a previous install (the editor settings JSON structure did change recently). You may find them in $HOME/.jupyter/lab/user-settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant