Skip to content

Invalid regular expression logging error occurs when file paths contain special characters #18829

Closed

Description

@MXA404

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

before the jupyter notebook was working fine and the python interpreter are listed in the interpreters but now i can't find them and each time i run a jupyter notebook an error window shows up which contains Python is not installed i install it again but still not working the only kernel on notebook is python 3 and it does not work at all

can you please help

VS Code Version

the last version downloaded and updated

Jupyter Extension Version

last version for extension from vs code

Jupyter logs

No response

Coding Language and Runtime Version

python

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

No response

Activity

  1. added
    bug
    on Mar 30, 2022
  2. rchiodo commented on Mar 30, 2022

    @rchiodo

    Thanks for the issue.

    Can you go to this pane:

    image

    And pick the 'Jupyter' tab and the 'Python' tab and upload the contents of both of them?

    We use the python extension to detect python on your machine, so hopefully its output will show why it thinks there's no python installed.

  3. MXA404 commented on Mar 30, 2022

    @MXA404
    Author

    I tried running the jupyter notebook but nothing come up except the windows * usually, when using only the python file it works fine but when i run the jupyter notebook it does not work

    image

  4. rchiodo commented on Mar 30, 2022

    @rchiodo

    Thanks.

    Those output logs should tell us why. From your screen shot I suspect the python extension is failing to find python too.

  5. MXA404 commented on Mar 30, 2022

    @MXA404
    Author

    so how can I fix it?

  6. rchiodo commented on Mar 30, 2022

    @rchiodo

    You need to send us the logs. Then we might be able to tell you how to fix it.

    Logs are here:

    image

    And here:
    image

    Just copy the contents of those two panes into a comment in this issue. It should say something about what is going wrong.

  7. MXA404 commented on Mar 30, 2022

    @MXA404
    Author

    jupyter:

    Visual Studio Code (1.65.2, undefined, desktop)
    Jupyter Extension Version: 2022.2.1030672458.
    Python Extension Version: 2022.2.1924087327.
    User belongs to experiment group 'jupyterTest'
    User belongs to experiment group 'jupyterEnhancedDataViewer'
    Info 22:49:22: ZMQ install verified.
    Info 22:49:24: Experiment status for python is {"enabled":true,"optInto":[],"optOutFrom":[]}
    Warn 22:49:24: Unable to create a controller for jupyter-notebook without an active interpreter.
    Info 22:49:27: Find preferred kernel for c:\Users\alshe\Downloads\scanCONTROL-Windows-SDK-4-1\scanCONTROL Windows SDK 4.1\C++ SDK (+python bindings)\python_bindings\examples\ScreenO3d.ipynb with metadata {"language_info":{"name":"python"},"orig_nbformat":4} & preferred interpreter 
    Info 22:49:27: Notebook Closed c:\Users\alshe\Downloads\scanCONTROL-Windows-SDK-4-1\scanCONTROL Windows SDK 4.1\C++ SDK (+python bindings)\python_bindings\examples\ScreenO3d.ipynb
    

    python:

    Experiment 'pythonaacf' is active
    Experiment 'pythonTensorboardExperiment' is active
    Experiment 'pythonSurveyNotification' is active
    Experiment 'PythonPyTorchProfiler' is active
    Experiment 'pythonDeprecatePythonPath' is active
    Experiment 'pythonInterpreterInfoPinned' is active
    [ERROR 2022-2-30 22:49:24.403]: [SyntaxError: Invalid regular expression: /c:(\\|/)Users(\\|/)alshe(\\|/)Downloads(\\|/)scanCONTROL-Windows-SDK-4-1(\\|/)scanCONTROL Windows SDK 4.1(\\|/)C++ SDK (+python bindings)(\\|/)python_bindings(\\|/)examples/: Nothing to repeat
    	at new RegExp (<anonymous>)
    	at h (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314759)
    	at d.getDisplayCommands (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314538)
    	at d.logProcess (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314276)
    	at s.emit (events.js:315:20)
    	at shellExec (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:33373)
    	at Object.t.shellExecute (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:24:74737)
    	at async Object.t.getInterpreterInfo (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:31805)
    	at async c.p [as workerFunc] (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:5037)
    	at async start (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:29626)]
    [ERROR 2022-2-30 22:49:24.407]: [SyntaxError: Invalid regular expression: /c:(\\|/)Users(\\|/)alshe(\\|/)Downloads(\\|/)scanCONTROL-Windows-SDK-4-1(\\|/)scanCONTROL Windows SDK 4.1(\\|/)C++ SDK (+python bindings)(\\|/)python_bindings(\\|/)examples/: Nothing to repeat
    	at new RegExp (<anonymous>)
    	at h (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314759)
    	at d.getDisplayCommands (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314538)
    	at d.logProcess (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314276)
    	at s.emit (events.js:315:20)
    	at shellExec (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:33373)
    	at Object.t.shellExecute (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:24:74737)
    	at async Object.t.getInterpreterInfo (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:31805)
    	at async c.p [as workerFunc] (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:5037)
    	at async start (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:29626)]
    [ERROR 2022-2-30 22:49:27.213]: [SyntaxError: Invalid regular expression: /c:(\\|/)Users(\\|/)alshe(\\|/)Downloads(\\|/)scanCONTROL-Windows-SDK-4-1(\\|/)scanCONTROL Windows SDK 4.1(\\|/)C++ SDK (+python bindings)(\\|/)python_bindings(\\|/)examples/: Nothing to repeat
    	at new RegExp (<anonymous>)
    	at h (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314759)
    	at d.getDisplayCommands (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314538)
    	at d.logProcess (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314276)
    	at s.emit (events.js:315:20)
    	at shellExec (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:33373)
    	at Object.t.shellExecute (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:24:74737)
    	at processTicksAndRejections (internal/process/task_queues.js:93:5)
    	at async Object.t.getInterpreterInfo (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:31805)
    	at async c.p [as workerFunc] (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:5037)
    	at async start (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:29626)]
    [ERROR 2022-2-30 22:49:27.214]: [SyntaxError: Invalid regular expression: /c:(\\|/)Users(\\|/)alshe(\\|/)Downloads(\\|/)scanCONTROL-Windows-SDK-4-1(\\|/)scanCONTROL Windows SDK 4.1(\\|/)C++ SDK (+python bindings)(\\|/)python_bindings(\\|/)examples/: Nothing to repeat
    	at new RegExp (<anonymous>)
    	at h (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314759)
    	at d.getDisplayCommands (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314538)
    	at d.logProcess (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314276)
    	at s.emit (events.js:315:20)
    	at shellExec (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:33373)
    	at Object.t.shellExecute (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:24:74737)
    	at processTicksAndRejections (internal/process/task_queues.js:93:5)
    	at async Object.t.getInterpreterInfo (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:31805)
    	at async c.p [as workerFunc] (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:5037)
    	at async start (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:29626)]
    [ERROR 2022-2-30 22:49:27.215]: [SyntaxError: Invalid regular expression: /c:(\\|/)Users(\\|/)alshe(\\|/)Downloads(\\|/)scanCONTROL-Windows-SDK-4-1(\\|/)scanCONTROL Windows SDK 4.1(\\|/)C++ SDK (+python bindings)(\\|/)python_bindings(\\|/)examples/: Nothing to repeat
    	at new RegExp (<anonymous>)
    	at h (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314759)
    	at d.getDisplayCommands (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314538)
    	at d.logProcess (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:314276)
    	at s.emit (events.js:315:20)
    	at shellExec (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:33373)
    	at Object.t.shellExecute (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:24:74737)
    	at processTicksAndRejections (internal/process/task_queues.js:93:5)
    	at async Object.t.getInterpreterInfo (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:31805)
    	at async c.p [as workerFunc] (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:52:5037)
    	at async start (c:\Users\alshe\.vscode\extensions\ms-python.python-2022.2.1924087327\out\client\extension.js:104:29626)]
    Starting Pylance language server.
    Diagnostic Code: InvalidPythonInterpreterDiagnostic, Message: No Python interpreter is selected. You need to select a Python interpreter to enable features such as IntelliSense, linting, and debugging.
    
  8. rchiodo commented on Mar 31, 2022

    @rchiodo

    Thanks. This looks like a problem with a regular expression in the python extension. I'm transferring your issue there.

  9. removed
    bug
    on Mar 31, 2022
  10. removed their assignment
    on Mar 31, 2022
  11. added
    triage-needed
    on Mar 31, 2022
  12. jose-jordan commented on Apr 3, 2022

    @jose-jordan

    Thanks.

    Those output logs should tell us why. From your screen shot I suspect the python extension is failing to find python too.

    am also need help sir

  13. 7 remaining items

  14. sunyinqi0508 commented on Apr 6, 2022

    @sunyinqi0508

    I had the same issue with the extension versions from 2022. And I simply fell back to the 2021.12 version of this extension and it seems to work just fine.

  15. karrtikr commented on Apr 6, 2022

    @karrtikr

    Hi all, could you please try installing https://github.com/microsoft/vscode-python/suites/5947251954/artifacts/203903588 and see if it helps? You can use Extension: Install from VSIX command to install it.

  16. added
    info-needed
    on Apr 6, 2022
  17. sunyinqi0508 commented on Apr 7, 2022

    @sunyinqi0508

    Hi all, could you please try installing https://github.com/microsoft/vscode-python/suites/5947251954/artifacts/203903588 and see if it helps? You can use Extension: Install from VSIX command to install it.

    Unfortunately, this new version doesn't seem to work for me.

    I think it's caused by the special characters in the project path. To be specific, we all seem to have ++ in the project path which is probably the cause of this issue.

    Here is my log:
    image

  18. sunyinqi0508 commented on Apr 7, 2022

    @sunyinqi0508

    Hi all, could you please try installing https://github.com/microsoft/vscode-python/suites/5947251954/artifacts/203903588 and see if it helps? You can use Extension: Install from VSIX command to install it.

    Unfortunately, this new version doesn't seem to work for me.

    I think it's caused by the special characters in the project path. To be specific, we all seem to have ++ in the project path which is probably the cause of this issue.

    Here is my log: image

    I managed to fix this issue for my settings. Please check #18878 for my patch.

  19. added
    regression
    and removed
    info-needed
    investigating
    on Apr 7, 2022
  20. changed the title [-]python is not installed[/-] [+]Invalid regular expression logging error occurs when file paths contain special characters[/+] on Apr 8, 2022
  21. locked as resolved and limited conversation to collaborators on May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsbuggood first issueregressionverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions