qlib
qlib copied to clipboard
'PosixPath' object has no attribute 'endswith' when init with nfs server
🐛 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?
另外, init.py的149行 os.popen("dpkg -l | grep nfs-common") 只适合ubuntu或者debian;centos就没法用?
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!
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
方便加个dir(mount_path)看一下它具体都有哪些方法吗?理论上PosixPath在3.6后就有endswith方法了
呃 tmp = PosixPath('/tmp') dir(tmp) 里头没有endswith
@jingmouren Can your issue be fixed by this PR? https://github.com/microsoft/qlib/pull/1129
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
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
请问您后来问题解决了吗
这个nfs server的使用并没走通啊
请问您后来问题解决了吗
我也是同样的问题,看了好几个版本的PosixPath,都没有endswith啊。什么情况。。。
PosixPath的物件可以轉成str str(path)即可
嗯,这个ISSUE涉及的PosixPath轉成str就解决了
但nfs server的使用还没走通
需要设置mount到一个空目录,还是到一个有qlib数据的目录?mount上去之后还有哪些数据放置操作? 如果mount到空目录的话,数据如何初始传过去?如果mount到有qlib数据的目录,mount成功后,好像那个目录显示的内容也就变了