qlib icon indicating copy to clipboard operation
qlib copied to clipboard

'PosixPath' object has no attribute 'endswith' when init with nfs server

Open jingmouren opened this issue 2 years ago • 7 comments

🐛 Bug Description

Follow qlib-server ReadMe to init import qlib ONLINE_CONFIG = {***} qlib.init(**ONLINE_CONFIG)

get this error 'PosixPath' object has no attribute 'endswith' qlib/init.py", line 66, in init _mount_nfs_uri(provider_uri, C.dpm.get_data_uri(_freq), C["auto_mount"]) qlib/init.py", line 116, in _mount_nfs_uri _mount_path = mount_path[:-1] if mount_path.endswith("/") else mount_path AttributeError: 'PosixPath' object has no attribute 'endswith'

How to solve?

jingmouren avatar May 17 '22 07:05 jingmouren

另外, init.py的149行 os.popen("dpkg -l | grep nfs-common") 只适合ubuntu或者debian;centos就没法用?

jingmouren avatar May 30 '22 08:05 jingmouren

Thanks for giving issue. For the first issue, what's your Python's version? Qlib need Python 3.6+. For the second one, we plan to support more systems in the future to make Qlib more robust. Also, we will very appreciate if you could contribute a PR to solve this for Qlib!

lzh222333 avatar Jun 08 '22 02:06 lzh222333

Thanks for giving issue. For the first issue, what's your Python's version? Qlib need Python 3.6+. For the second one, we plan to support more systems in the future to make Qlib more robust. Also, we will very appreciate if you could contribute a PR to solve this for Qlib!

我用的python37

jingmouren avatar Jun 08 '22 04:06 jingmouren

方便加个dir(mount_path)看一下它具体都有哪些方法吗?理论上PosixPath在3.6后就有endswith方法了

lzh222333 avatar Jun 08 '22 14:06 lzh222333

呃 tmp = PosixPath('/tmp') dir(tmp) 里头没有endswith

jingmouren avatar Jun 09 '22 02:06 jingmouren

@jingmouren Can your issue be fixed by this PR? https://github.com/microsoft/qlib/pull/1129

you-n-g avatar Jun 14 '22 13:06 you-n-g

Can your issue be fixed by this PR? #1129

转成str不报这错了。但接着的错误是 warning: unrecognized config flask_server 和 flask_port mount.nfs: connection refused

BadNamespaceError: / is not a connected namespace

jingmouren avatar Jun 15 '22 02:06 jingmouren

Can your issue be fixed by this PR? #1129

转成str不报这错了。但接着的错误是 warning: unrecognized config flask_server 和 flask_port mount.nfs: connection refused

BadNamespaceError: / is not a connected namespace

请问您后来问题解决了吗

LUS8806 avatar Oct 27 '22 14:10 LUS8806

这个nfs server的使用并没走通啊

请问您后来问题解决了吗

我也是同样的问题,看了好几个版本的PosixPath,都没有endswith啊。什么情况。。。

LUS8806 avatar Oct 28 '22 02:10 LUS8806

PosixPath的物件可以轉成str str(path)即可

ChiahungTai avatar Oct 28 '22 08:10 ChiahungTai

嗯,这个ISSUE涉及的PosixPath轉成str就解决了

但nfs server的使用还没走通

需要设置mount到一个空目录,还是到一个有qlib数据的目录?mount上去之后还有哪些数据放置操作? 如果mount到空目录的话,数据如何初始传过去?如果mount到有qlib数据的目录,mount成功后,好像那个目录显示的内容也就变了

jingmouren avatar Nov 03 '22 10:11 jingmouren