question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

psutil._exceptions.AccessDenied: psutil.AccessDenied

See original GitHub issue

I’m trying to use standordCoreNLP and getting an error:

from stanfordcorenlp import StanfordCoreNLP
..
..

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/_psosx.py", line 330, in wrapper
    return fun(self, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/_psosx.py", line 515, in connections
    rawlist = cext.proc_connections(self.pid, families, types)
PermissionError: [Errno 1] Operation not permitted
..
..

During handling of the above exception, another exception occurred:
nlp = StanfordCoreNLP("/Users/NLP_models/stanford-corenlp-full-2018-01-31")
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/stanfordcorenlp/corenlp.py", line 79, in __init__
    if port_candidate not in [conn.laddr[1] for conn in psutil.net_connections()]:
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/__init__.py", line 2108, in net_connections
    return _psplatform.net_connections(kind)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/_psosx.py", line 249, in net_connections
    cons = Process(pid).connections(kind)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/_psosx.py", line 335, in wrapper
    raise AccessDenied(self.pid, self._name)
psutil._exceptions.AccessDenied: psutil.AccessDenied (pid=13041)

I tried to follow suggestions here: https://github.com/ContinuumIO/anaconda-issues/issues/6006 But it didn’t work - any idea?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:25 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
Lyntencommented, Mar 7, 2018

You have to run your code as root. Please refer to How to run a script as root on Mac OS X? Let me know if you still have problems.

12reactions
heppyttcommented, May 23, 2018

代码里面需要调式,怎么处理这个问题呢?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting 'psutil.AccessDenied (pid=6836)' error using psutil
AccessDenied : psutil.AccessDenied (pid=6836) Process finished with exit code 1. am I doing something wrong with this simple code? or is ...
Read more >
psutil.AccessDenied (pid=7868) · Issue #1774 - GitHub
I'm trying to kill a process (zoom.exe) with psutil. However, I'm getting an error psutil.AccessDenied . I have all the permissions to do...
Read more >
AccessDenied in psutil - Florianrein's Blog
In this QQ-QA, I am going to show you how to handle AccessDenied errors with psutil, a process monitoring package for the Python...
Read more >
psutil documentation — psutil 5.9.5 documentation
The psutil documentation you're reading is distributed as a single HTML page. ... prepared to catch NoSuchProcess and AccessDenied exceptions. hash builtin ...
Read more >
Python psutil 模块,AccessDenied() 实例源码 - 编程字典
Python psutil 模块,AccessDenied() 实例源码. 我们从Python开源项目中,提取了 ... AccessDenied, psutil. ... """Decorator to Ignore AccessDenied exceptions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found