New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import metview #19
Comments
Hi @Tsironisa, I think you've probably installed the Metview Python bindings through pip (pip install metview) but have not installed the binaries. If you're in a conda environment, you need to additionally do either this: I hope this helps! |
Thank you for your time |
This has been open for a while without comment, so I'll close it - please feel free to open another issue if you still have problems! |
@iainrussell I believe I have discovered that this problem is due to something else besides not installing the binaries. I am trying to run metview on Ubuntu 20.04.2.0, not through Anaconda. My first step was to install the community binary with apt-get, then install the Python bindings through pip. Both of those completed successfully. However when I try to import the metview package in python (same as what the user above posted) I get the same error as them. However they left out the crucial part. This is the full error text:
Its not timing out because the binaries aren't installed, its timing out because its trying to start them from a path that doesn't exist. When I go into the directory and look I can get as far as /usr/share/metview, but inside of that there is a folder called app-defaults, but not a folder called share. It seems like the "share/metview" part of the path was duplicated for some reason, but doesn't exist on the filesystem. So my next step was to dig into the python bindings and figure out where the path was defined, and it turned out not to be a problem with the python bindings at all. I traced trough the bindings to the line that was calling the metview startup command "metview" and tried running that manually in the console, which returned the following error:
So I began digging through the metview startup script in that location and found the line of code where the path duplication occurs. But the problem is I don't understand why, and I am hesitant to truncate it and mess with things I don't understand. The duplication occurs on line 541 and 542:
The value of $INSTALLDIR is already "usr/share/metview", so when that is concatenated onto it the path becomes "usr/share/metview/share/metview". But I don't understand what the share variable is for, or if it would be okay to simply remove that concatenation and set it equal to $METVIEW_DIR. Any insight you have is appreciated, I know this was a very long comment on a closed post but I feel like I am running into a legitimate installation bug, or I have a fundamental misunderstanding of how this works. Thank you! |
Hi @eyneill777 , Thanks for the extra information. OK, I've installed an Ubuntu virtual machine and installed the community-built Metview. I can see there are some issues there! The issues really come because in places we assume that our software packages are installed completely in one place. But on Ubuntu, they have been split, e.g. into metview and metview-data, which are parts of the same package, but are installed into different places. I can see that we can make some small changes on the Metview side that would almost make it work, but the Ubuntu package maintainer will likely have to make a change as well. But in the meantime, I can show you how I got it to work (I only tested the user interface so far, not Python). Here are the changes I made to the metview startup script:
And this is the change I made to the script '/usr/lib/x86_64-linux-gnu/metview/metview_create_user_dir' (simply commented out a line - in fact it is looking for files that should be there in a normal installation, but I can make the next version more forgiving!)
I hope this helps you to get further! Whilst I cannot guarantee that the next Ubuntu release will work out of the box, it should at least be easier to patch :) Best regards, |
Oh, and also in metview_create_user_dir I changed
to
|
Thanks for the quick response! I was able to get it to work for what I needed (grib functions through python) late last night and forgot to post an update. If you would like I can post the file with the edits I made but it seems like you know what needs to happen and my edits are probably far too hacky to be useful. Let me know if you want it though. Thanks again! |
Thanks for letting me know! I've made some changes on our side, but I think that other changes will be needed from the Ubuntu package maintainer. I'll see if I can help make that happen. |
Thanks for this post. I solved the problem thanks to this, but with more global changes thak I think can meke it work better: Also, the line: The rest of changes are the same as @iainrussell propossed: Around line 850: Hope this helps other people and also to improve the package. |
Hello, |
Hi i am new to metview.
i installed latest metview release,anacoda and insteall metview 1.5.
but i cant import metview at jupiter
i type
import metview as mv
but i get
Exception: Command "metview" did not respond within 8 seconds. This timeout is configurable by setting environment variable METVIEW_PYTHON_START_TIMEOUT in seconds. At least Metview 5 is required, so please ensure it is in your PATH, as earlier versions will not work with the Python interface.
any help would be appreciated cause i am quite new to this
The text was updated successfully, but these errors were encountered: