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.

PermissionError encoding/lib/cpu/lock

See original GitHub issue
  • Installing system-wide Pytorch-Encoding I got the next error.
  • Commands

sudo -H pip3 install --upgrade --no-cache-dir torch-encoding python3 >>> import torch >>> import encoding

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/site-packages/encoding/__init__.py", line 13, in <module>
from . import nn, functions, dilated, parallel, utils, models, datasets
File "/usr/local/lib/python3.5/site-packages/encoding/nn/__init__.py", line 12, in <module>
from .encoding import *
File "/usr/local/lib/python3.5/site-packages/encoding/nn/encoding.py", line 18, in <module>
from ..functions import scaledL2, aggregate
File "/usr/local/lib/python3.5/site-packages/encoding/functions/__init__.py", line 2, in <module>
from .encoding import *
File "/usr/local/lib/python3.5/site-packages/encoding/functions/encoding.py", line 13, in <module>
from .. import lib
File "/usr/local/lib/python3.5/site-packages/encoding/lib/__init__.py", line 12, in <module>
], build_directory=cpu_path, verbose=False)
File "/usr/local/lib/python3.5/site-packages/torch/utils/cpp_extension.py", line 476, in load
if baton.try_acquire():
File "/usr/local/lib/python3.5/site-packages/torch/utils/file_baton.py", line 29, in try_acquire
self.fd = os.open(self.lock_file_path, os.O_CREAT | os.O_EXCL)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/site-packages/encoding/lib/cpu/lock'

If you need more information please let me know it.

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zhanghang1989commented, Jun 16, 2018

I see the problem. It is because you were using ‘sudo pip install’ and the files are post compiled after installation.

  1. A hacky way you can try is writing a file hacky.py with import encoding, and run
sudo python hacky.py
  1. The best way to do it is to install with anaconda without sudo command
0reactions
wlj567commented, Dec 2, 2021

好的,谢谢您的回复

Read more comments on GitHub >

github_iconTop Results From Across the Web

with open(result.csv , a, newline=, encoding='utf-8') as f
Permission denied means you are not allowed to access a file. But why this happens? This is because a file has 3 access...
Read more >
os — Miscellaneous operating system interfaces
The file system encoding must guarantee to successfully decode all bytes below 128. If the file system encoding fails to provide this guarantee,...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
o.lock to be removed" displayed by libtool in infinite loop (e.g. ... "thread.c permission error when starting vdr"" status:RESOLVED resolution:OBSOLETE ...
Read more >
Python - IOError: [Errno 13] Permission denied
Check if you are implementing the code inside a could drive like box, dropbox etc. If you copy the files you are trying...
Read more >
Bug #1953720 “OSError: [Errno 30] Read-only file system: '/var/c...”
1) due to an encoding error, pyzor is throwing an exception. 2) /usr/lib/python3/dist-packages/apport_python_hook.py is the exception handler invoked ...
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