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

PermissionError: [Errno 13] Permission denied: '_psposix.py' #2275

Closed
magick93 opened this issue Jul 6, 2023 · 1 comment
Closed

PermissionError: [Errno 13] Permission denied: '_psposix.py' #2275

magick93 opened this issue Jul 6, 2023 · 1 comment

Comments

@magick93
Copy link

magick93 commented Jul 6, 2023

Summary

  • OS: Ubuntu 23:04
  • Architecture: 64bit
    • Psutil version: 5.9.5
  • Python version: Python 3.10.0
  • Type: core

Description

I'm trying to run a jupyter notebook using python 3.10 and when trying to connect to the kernel I'm getting this error:

PermissionError: [Errno 13] Permission denied: '_psposix.py'... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd097cc609b13305c559618ec78a438abc56230b9381f827f22d070313b9a1f3777./bin/python3.10./bin/python3.10.-m#ipykernel_launcher
    > Interpreter Id = /bin/python3.10
    > at ChildProcess.<anonymous> (~/.vscode/extensions/ms-toolsai.jupyter-2023.5.1101742258-linux-x64/out/extension.node.js:24:92741)
    > stdErr = Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "~/.local/lib/python3.10/site-packages/ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "~/.local/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 51, in <module>
    from .ipkernel import IPythonKernel
  File "~/.local/lib/python3.10/site-packages/ipykernel/ipkernel.py", line 17, in <module>
    from .comm import CommManager
  File "~/.local/lib/python3.10/site-packages/ipykernel/comm/__init__.py", line 1, in <module>
    from .comm import *  # noqa
  File "~/.local/lib/python3.10/site-packages/ipykernel/comm/comm.py", line 12, in <module>
    from ipykernel.kernelbase import Kernel
  File "~/.local/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 35, in <module>
    import psutil
  File "~/git/yestech/legalease/apps/ai_content/psutil.py", line 42, in <module>
    main()
  File "~/git/yestech/legalease/apps/ai_content/psutil.py", line 39, in main
    rmpath(abspath)
  File "~/git/yestech/legalease/apps/ai_content/psutil.py", line 25, in rmpath
    shutil.rmtree(path)
  File "/usr/lib/python3.10/shutil.py", line 724, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib/python3.10/shutil.py", line 680, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/usr/lib/python3.10/shutil.py", line 678, in _rmtree_safe_fd
    os.unlink(entry.name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: '_psposix.py'
@giampaolo
Copy link
Owner

That error does not come from psutil. It comes from ~/git/yestech/legalease/apps/ai_content/psutil.py (a module called psutil.py) which gets permission error because it cannot delete a file.

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

No branches or pull requests

2 participants