yoshida-lab / XenonPy

XenonPy is a Python Software for Materials Informatics
http://xenonpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
131 stars 57 forks source link

import xenonpy permission error #202

Open tonosunn-dn opened 4 years ago

tonosunn-dn commented 4 years ago

When running in the docker container, I get the following error.

import xenonpy Traceback (most recent call last): File "", line 1, in File "/home/user/.local/lib/python3.7/site-packages/xenonpy/init.py", line 66, in init() File "/home/user/.local/lib/python3.7/site-packages/xenonpy/init.py", line 42, in init copyfile(str(Path(file).parent / 'conf.yml'), str(user_cfg_file)) File "/home/user/miniconda/envs/py37/lib/python3.7/shutil.py", line 121, in copyfile with open(dst, 'wb') as fdst: PermissionError: [Errno 13] Permission denied: '/home/user/.xenonpy/conf.yml'

I was able to avoid the error with the following command. sudo chmod 777 -R /home/user/.xenonpy

stewu5 commented 3 years ago

@TsumiNa have we solved this problem yet?

TsumiNa commented 3 years ago

We can't solve this kind of errors. Docker is running in root mode, but for some security reasons, instead of using the root user, we create a normal user and use it in docker. That is why we get PermissionError when docker tries to read some files on the host.

The Linux community recommends that users migrate from Docker to Podman. However, Podman is a Linux-like system-first project and is not as easy to use as Docker on both Mac and Win. I plan to do some tests and preparations for the migration, but it will take a bit more time.