I am defining a logger and periodically exporting the content to a blob. I’ve been using this for some time with DBR 10.4/python 3.8 without any issue. However we’ve moved to DBR 15.2/python 3.11, and now the logger function is working as expected. But when I’m trying to read and export it it’s throwing the following error:
FileNotFoundError: [Errno 2] No such file or directory
I additionally tried to specify a log folder and use the logpath + filename to create the log and read it. Although the logs are created but iIt’s still throwing the same error. After getting the error if I run os.listdir(logpath) I don’t see the missing logfile in the list. But if I run %sh ls -als logpath I can see the ‘missing’ log file listed. If I run os.listdir(logpath) again, the missing logfiles appear in the list.
I’ve also tried the following in both environment: (print(os.popen("id").read())) (print(os.popen(r"/Workspace/Users/arnab.banerjee@nielseniq.com/log").read()))
For both env, I’m getting uid=0(root) gid=0(root) groups=0(root) for the first command. But for the second command I’m getting blank in 3.8 env & /bin/sh: 1: /logpath: Permission denied in 3.11 respectively.
so you moved from Python v3.8 to v3.11. Note that when you move between different Python versions, all packages that you had (installed) in a previous version do not automatically migrate to the new version. They are two independent versions with their own unique PATHs installed on your system. If you want to continue using previously installed packages, you can do either of the following:
Re-install the packages to your new PATH via pip.
Append the PATH directory of where the required packages are currently located to the new Python v3.11 PATH directory.
Since I’m running these in databricks cluster, all required packages are needed to be installed at every instance. So I’m re-installing every package with updated compatible version in this v3.11 run and not using any of the old packages. And I’m not missing any package from the v3.8 run. At least not the basic required ones.