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.

pyocd need sudo to work

See original GitHub issue

Hi,

Simply running pyocd-gdbserver on terminal gives me

Traceback (most recent call last):    
  File "/usr/bin/pyocd-gdbserver", line 5, in <module>    
    from pkg_resources import load_entry_point    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2927, in <module>    
    @_call_aside    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2913, in _call_aside    
    f(*args, **kwargs)    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set    
    add_activation_listener(lambda dist: dist.activate())    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 956, in subscribe    
    callback(dist)    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2952, in <lambda>    
    add_activation_listener(lambda dist: dist.activate())    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2513, in activate    
    for pkg in self._get_metadata('namespace_packages.txt'):    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2503, in _get_metadata    
    for line in self.get_metadata_lines(name):    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1477, in get_metadata_lines    
    return yield_lines(self.get_metadata(name))    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1469, in get_metadata    
    return self._get(self._fn(self.egg_info, name))    
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1580, in _get    
    with open(path, 'rb') as stream:    
IOError: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/protobuf-3.0.0b3-py2.7.egg/EGG-INFO/namespace_packages.tx

Same case with pyocd-tool, sudo pyocd-tool --version is 0.1.dev24

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
flitcommented, Aug 17, 2016

You shouldn’t need root permissions for any of the pyOCD tools on any system (OS X, Linux, Windows).

It looks to me like pkg_resources from setuptools is trying to init, but you have the protobuf package installed with root access only. This is not directly related to pyOCD.

0reactions
c1728p9commented, Oct 25, 2016

@aurabindo can you confirm that sudo is no longer needed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pyocd need sudo to work · Issue #259 - GitHub
Hi, Simply running pyocd-gdbserver on terminal gives me Traceback (most recent call last): File "/usr/bin/pyocd-gdbserver", line 5, ...
Read more >
Installing - pyOCD
You have a few options here: Install with pipx. Run the command in a virtualenv local to a specific project working set. Under...
Read more >
How to program boards with pyOCD - Tal Klinger - Medium
You're in the right place, this guide will walk you through on how use pyOCD, earse, flash and reset device. Once you'll control...
Read more >
Re: pyOCD Debug Launch error - NXP Community
This looks like a pyOCD issue, I've filed an issue at their github page pyocd binaries need sudo to work · Issue #259...
Read more >
Debugging from GDB using pyOCD! - Mbed
Quick overview. Use python to control your mbed platform ... Use GDB to debug your mbed projects ... Have fun with pyOCD!
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