Project

General

Profile

CDO wsl, error libQt5Core.so.5

Added by U. Cordier over 2 years ago

Hello,

I would like to be able to install cdo on Windows with WSL.

I followed the following tutorial to install WSL:https://lecrabeinfo.net/installer-wsl-windows-subsystem-for-linux-sur-windows-10.html

I then did "sudo apt install cdo" and the installation seems to work.

Unfortunately, when I do cdo -V, it returns the following error message:
cdo: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

What to do to solve this problem?

Thank you in advance for your help !


Replies (18)

RE: CDO wsl, error libQt5Core.so.5 - Added by Estanislao Gavilan over 2 years ago

Hi Cordier,
It seems there is a problem with your paths or you have a library missing (ie.e libQt5core). Have your tried to installing using Cygwin64? It is a straight forward process. I must say that I only use cdo for simple stuff in windows such as cat, correct datetime, etc. I have encountered some issues using the regrid functions. That is why I have also installed cdo in a virtual ubuntu machine.
Regards,

Estanislao

RE: CDO wsl, error libQt5Core.so.5 - Added by U. Cordier over 2 years ago

Good evening !

I tried Cygwin the first time, unfortunately it only partially worked. So I was recommended to install a Linux virtual machine, which I did, I tried VirtualBox which does not work at all on my machine and I switched to vmware(Ubuntu) which works perfectly except for the file transfer to Windows no longer works, so I have to use the cloud which is not practical.
Someone else recommended WSL to me which is apparently very fast but there is the problem that I described to you.

You say there is a missing library. Do you know how to install it separately?

Otherwise I can try again to install a virtual machine on another PC.
What virtual machine software are you using and what version of Ubuntu?

The cdo tool is really good when you can use it, it would be so much better if there is a Windows software.

RE: CDO wsl, error libQt5Core.so.5 - Added by Karin Meier-Fleischer over 2 years ago

Hi,

can you install miniconda in WSL? I'm not a Windows user but WSL should be able to install it and than it is easy to install cdo as well:

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh
conda install -c conda-forge cdo

RE: CDO wsl, error libQt5Core.so.5 - Added by Estanislao Gavilan over 2 years ago

Hi Cordier,

I use Virtual box with ubuntu 22.04 because the default cdo version for ubuntu 22 is 2.0.5. You can install cdo in ubuntu using the typical command (ie. sudo apt-get install cdo). About your library problem.. you need to check if that library is installed in wsl. I found this on internet "https://superuser.com/questions/1347723/arch-on-wsl-libqt5core-so-5-not-found-despite-being-installed". Take a look it might give you a lead about the problem.

RE: CDO wsl, error libQt5Core.so.5 - Added by U. Cordier over 2 years ago

Hi

Apparently there is a problem, yet no error message was displayed during the installation.

@DESKTOP-NV8S7LF:~$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
--2022-09-19 17:55:27--  https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Resolving repo.anaconda.com (repo.anaconda.com)... 2606:4700::6810:8303, 2606:4700::6810:8203, 104.16.130.3, ...
Connecting to repo.anaconda.com (repo.anaconda.com)|2606:4700::6810:8303|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 76607678 (73M) [application/x-sh]
Saving to: ‘Miniconda3-latest-Linux-x86_64.sh’

Miniconda3-latest-Linux-x86_6 100%[=================================================>]  73.06M  1.55MB/s    in 49s

2022-09-19 17:56:17 (1.48 MB/s) - ‘Miniconda3-latest-Linux-x86_64.sh’ saved [76607678/76607678]

@DESKTOP-NV8S7LF:~$ sh Miniconda3-latest-Linux-X86_64.sh
sh: 0: cannot open Miniconda3-latest-Linux-X86_64.sh: No such file
@DESKTOP-NV8S7LF:~$ conda install -c conda-forge cdo
conda: command not found

For the library libqt5core I followed the solution proposed by the link but it failed...

RE: CDO wsl, error libQt5Core.so.5 - Added by Estanislao Gavilan over 2 years ago

Hi Cordier,

that error means that the file Miniconda3-latest-Linux-x86_64.sh is not in your local directory or does not have the permissions. Therefore, you cannot install miniconda. The last error means that the conda command does not exit because you have not installed it. Firstly, you need to start typing "ls -l" in your terminal. This command will list the files in your local directory. Depending on the output you need to do one thing or the other.

First case the file is there:
If the file is there, ls l will output the permissions of that file (e.g -rwx-----). Sometimes, the downloaded file does not have the executable permissions (ie. there are not x). If that is the case try to type "chmod 755 Miniconda3-latest-Linux-X86_64.sh" or "sudo chmod 755 Miniconda3-latest-Linux-X86_64.sh" in case of error related to perimssions.
Now if you press again ls -ltr you will see something like this
-rwxr-xr-x Miniconda3-latest-Linux-X86_64.sh

Then you can try to type "sh Miniconda3-latest-Linux-X86_64.sh" etc..

Second case the file is not in your local directory:

If the file does not appear upon pressing ls -l means that wsl has downloaded the file in a different subfolder. You need to find it. Type this in your home directory

find ./* -type f -name Miniconda3-latest-Linux-x86_64.sh

if you do not know where is your your home directory. You can type this

find ~/* -type f -name Miniconda3-latest-Linux-x86_64.sh

These command will tell you where is you file (something like /blabla/blabla/../Miniconda3-latest-Linux-x86_64.sh). Now, you can move your file to your local folder

mv /blabla/blabla/../Miniconda3-latest-Linux-x86_64.sh ./

Lastly, you repeat the process explained in the first case because you do not know if you have the permissions to run the executable file.

I hope this help.

Kind regards,

Estanislao

RE: CDO wsl, error libQt5Core.so.5 - Added by U. Cordier about 2 years ago

Thanks for your help !

The problem is that it finds the file when I do "ls -l" but then when I try to modify the permissions it says that it cannot access it. So it's case 1 but unsolvable (at least not in the same way).

@DESKTOP-NV8S7LF:~$ ls -l
total 74880
-rw-r--r-- 1 linux-wsl linux-wsl 76607678 May 16 22:01 Miniconda3-latest-Linux-x86_64.sh
@DESKTOP-NV8S7LF:~$ sudo chmod 755 Miniconda3-latest-Linux-X86_64.sh
[sudo] password for linux-wsl:
chmod: cannot access 'Miniconda3-latest-Linux-X86_64.sh': No such file or directory
@DESKTOP-NV8S7LF:~$ chmod 755 Miniconda3-latest-Linux-X86_64.sh
chmod: cannot access 'Miniconda3-latest-Linux-X86_64.sh': No such file or directory
@DESKTOP-NV8S7LF:~$

RE: CDO wsl, error libQt5Core.so.5 - Added by Estanislao Gavilan about 2 years ago

Hi Cordier,

It seems that wsl does not allow you to change the permissions of your file. I have installed wsl in my computer and I do not have problems to change the permissions, so I am not sure why you cannot do it. You could try to update wsl or run wsl as administrator that might helps. I am still really surprised that yoou were not able to create a virtual machine using virtualbox. I have never experienced problems before.

Kind regards,

Estanislao

RE: CDO wsl, error libQt5Core.so.5 - Added by U. Cordier about 2 years ago

Hello,

It doesn't work better that way :(

So I will install VirtualBox on my other PC, if you say it works.

RE: CDO wsl, error libQt5Core.so.5 - Added by Estanislao Gavilan about 2 years ago

hi Cordier,

do not give in!!! lets check one last thing, can you tell me..:
your windows version, wsl version.
how did you install wsl? I mean did you download a third party for wsl? or you went to the windows powershell/cmd and type "wsl --install?
lastly how do you open your wsl?

Regards,

Estanislao

RE: CDO wsl, error libQt5Core.so.5 - Added by Estanislao Gavilan about 2 years ago

Also check where is your home directory using the command pwd

@DESKTOP-NV8S7LF:~$ pwd

RE: CDO wsl, error libQt5Core.so.5 - Added by U. Cordier about 2 years ago

Windows version: windows family 21H2, build: 19044.2006
Wsl version: I tried to put the 2 but apparently it does not work

I installed by following exactly this tutorial (French), with Powershell (without typing wsl --install it seems to me)
https://lecrabeinfo.net/installer-wsl-windows-subsystem-for-linux-sur-windows-10.html

I open wsl by searching for Ubuntu in the search bar and double click (or possibly as administrator but that didn't change anything).

@DESKTOP-NV8S7LF:~$ pwd
/home/linux-wsl
PS C:\Users\name> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         1
PS C:\Users\name> wsl --set-default-version 2
For more information on key differences with WSL 2, visit https://aka.ms/wsl2
The operation is a success.
PS C:\Users\name> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         1

RE: CDO wsl, error libQt5Core.so.5 - Added by Estanislao Gavilan about 2 years ago

Hi Cordier,

I think the command "wsl --set-default-version" only works for new installations. You need to use the command "wsl --set-version Ubuntu 2". Make sure than your ubuntu is stopped before doing this.

Lets see how it goes

Regards,

Estanis

RE: CDO wsl, error libQt5Core.so.5 - Added by U. Cordier about 2 years ago

It didn't work either.

PS C:\Users\name> wsl --set-version Ubuntu 2
The conversion is in progress. This may take a few minutes...
For more information on key differences with WSL 2, visit https://aka.ms/wsl2
Enable Windows Virtual Machine Platform feature and make sure virtualization is enabled in BIOS.
For more information, visit https://aka.ms/wsl2-install
PS C:\Users\name> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Stopped         1

I found this miraculous tutorial to install cdo in wsl . https://dquesadacr.github.io/cdo_climate_modelling/#/

So I followed the steps exactly and installed that on another computer. And CDO works perfectly! I tried selname and the output file was correct.
When I do wsl -l -v , ubuntu is correctly marked as version 2.

But why doesn't it work like I did? It's a mystery...
You have an idea.

RE: CDO wsl, error libQt5Core.so.5 - Added by Estanislao Gavilan about 2 years ago

Hi Cordier,

I am not windows developer so I am not sure why. I have some suspicions. If you look for problems related with wsl and linux permissions on internet, some of the solutions say that wsl 1 had some problems that wsl 2 corrected. If fact there is a way to fix wsl 1, but you need to add a conf file in your main library path (ie. /). I did not tell you this because you can easily break your wsl mahcine by doing this. I have played a lot in virtual box machines and I broke them many times after playing with the library directory. Now about the problem of changing the version of wsl, I have no idea. In fact you saw that after using the standard method to install wsl (wsl -install), you did not have any problem. I am really happy to hear that you were able to fix it.

Kind regards,

Estanislao

RE: CDO wsl, error libQt5Core.so.5 - Added by U. Cordier about 2 years ago

Thank you for these details and for your help!

I'm really glad the issue is resolved too!

I've used cdo in wsl a bit, and it seems to work really well, some things that didn't work on a virtual machine (vmware), now works fine with cdo on wsl.
One example among many:
I wanted to concatenate 2 sub-packets of different weather data (but at the same deadline)

cat surface-parameters1.grib2 surface-parameters2.grib2 > new.grib2

cdo sinfov new.grib2 was returning an error message, now the output file is fully functional.

If ever a Windows user like me asks you again how to use cdo on his machine, it might be a good idea to recommend the tutorial to him because it is really good and easy to apply.

Best regards,

U.Cordier

RE: CDO wsl, error libQt5Core.so.5 - Added by Estanislao Gavilan about 2 years ago

Hi Cordier,

you are totally right. It seems wsl is really convinient for windows users. I think that the wiki section already includes a section about wsl. However, it will be good to remind the next users the importance of wsl2 over wsl1.

Kind regards,

Estanislao

RE: CDO wsl, error libQt5Core.so.5 - Added by Ralf Mueller about 2 years ago

U. Cordier wrote in RE: CDO wsl, error libQt5Core.so.5:

It didn't work either.

[...]

I found this miraculous tutorial to install cdo in wsl . https://dquesadacr.github.io/cdo_climate_modelling/#/

Thanks a lot for this link - I added it to our documentation about windows usage.

cheers
ralf

    (1-18/18)