Perhaps a bit late to this discussion, but I just had the same problem, but I think I found a different solution, for those who do not want to modify the lgpio.py file.
The problem in lgpio is that it is trying to open a "named pipe", not a file. It uses this pipe to communicate with other processes. For everything to work as intended, you may want to allow it to create that pipe. The issue is that the directory that it tries to make this pipe is not a location it is allowed to write the file. You want it to write the file in /tmp.
Here is what worked for me:
This will allow the lgpio processes to work correctly. For me the i2c process now functions correctly.
Cheers!
The problem in lgpio is that it is trying to open a "named pipe", not a file. It uses this pipe to communicate with other processes. For everything to work as intended, you may want to allow it to create that pipe. The issue is that the directory that it tries to make this pipe is not a location it is allowed to write the file. You want it to write the file in /tmp.
Here is what worked for me:
- Check if in /tmp there is a file called ".lgd-nfy0" (Do "ls -al /tmp") If the file is there, delete it, since it may have the wrong ownership or permissions.
- Set the environment variable "LG_WD" to "/tmp" for every bash process. Best way to do this is to create a file in /etc/profile.d/ called lgpio.sh, which sets the variable. (Do "sudo nano /etc/profile.d/lgpio.sh", then in the editor window type "export LG_WD=/tmp", then save the file with control-o, followed by return, then close the window with control-x
- Reboot.
This will allow the lgpio processes to work correctly. For me the i2c process now functions correctly.
Cheers!

