Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

Unable to use Paddle Library

Open DeepanChakravarti opened this issue 3 years ago • 2 comments

请提出你的问题 Please ask your question

While importing Paddle library from paddle OCR getting an error since we do not have permission to create path in Home directory on analysis noticed that within common.py the below code snippet is causing the issue. Is there an alternate way to inject the path via a wrapper.

site-packages/paddle/dataset/common.py

HOME = os.path.expanduser('~')
DATA_HOME = os.path.join(HOME, '.cache', 'paddle', 'dataset')

Error Logs as follows [ERROR] OSError: [Errno 30] Read-only file system: '/home/sbx_user1051' Traceback (most recent call last): File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 843, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed from paddleocr import PaddleOCR File "/ABCD/xyz/paddleocr/__init__.py", line 14, in <module> from .paddleocr import * File "/ABCD/xyz/paddleocr/paddleocr.py", line 21, in <module> import paddle File "/ABCD/xyz/paddle/__init__.py", line 71, in <module> import paddle.dataset # noqa: F401 File "/ABCD/xyz/paddle/dataset/__init__.py", line 18, in <module> import paddle.dataset.mnist # noqa: F401 File "/ABCD/xyz/paddle/dataset/mnist.py", line 23, in <module> import paddle.dataset.common File "/ABCD/xyz/paddle/dataset/common.py", line 50, in <module> must_mkdirs(DATA_HOME) File "/ABCD/xyz/paddle/dataset/common.py", line 43, in must_mkdirs os.makedirs(DATA_HOME) File "/usr/local/lib/python3.8/os.py", line 213, in makedirs makedirs(head, exist_ok=exist_ok) File "/usr/local/lib/python3.8/os.py", line 213, in makedirs makedirs(head, exist_ok=exist_ok) File "/usr/local/lib/python3.8/os.py", line 213, in makedirs makedirs(head, exist_ok=exist_ok) File "/usr/local/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode)

DeepanChakravarti avatar Sep 20 '22 11:09 DeepanChakravarti

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

paddle-bot[bot] avatar Sep 20 '22 11:09 paddle-bot[bot]

Sorry, as far as I know, there is no good way to solve this problem. Would you like to run paddle in a docker in which you will have write permission to ${HOME} ?

yt605155624 avatar Sep 20 '22 12:09 yt605155624

seems this has been fixed by #45229 Another workaround is edit site-packages/paddle/dataset/common.py locally to change this path.

jzhang533 avatar Sep 22 '22 08:09 jzhang533