Issue with 'dateutil' and running run_metplus.py #1297
-
Greetings, I am new to METplus and running through the tutorial here: https://dtcenter.org/metplus-practical-session-guide-version-4-0/session-1-metplus-setupgrid-grid/metplus-setup/metplus-user-configuration-settings. Everything has been going fine until I run the command: run_metplus.py And run into the issue: ModuleNotFoundError: No module named 'dateutil' The catch here is that NCO installed this METplus build for the Weather Prediction Center, which includes python. In other words, I do not have permissions to install dateutil for the python3 version currently used by METplus. I do have a local python3 version with dateutil. My question is, is there anyway to point a previously installed METplus to my python3 version without building METplus from scratch locally? I suspect this is not the case, but I wanted to ask first. Thanks, Mike Erickson |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 14 replies
-
Hi Mike, Which machine are you using here? The dateutil Python package is a requirement of the METplus wrappers (See https://metplus.readthedocs.io/en/latest/Users_Guide/installation.html#python-package-requirements) so the package should have be obtained for a successful install of the wrappers. Also, if the MET executables were built with Python embedding enabled, then the version of Python used to install should include the dateutil package. If this is not the case, then they may need to re-install MET. It may also be the case that the version of python3 that is in your path is not the same version used to install. The METplus wrappers can easily be run using different versions of Python. Calling the "run_metplus.py" script directly will use the version of Python3 that is found in the user's path, so adding the bin directory that contains the python3 executable that you need to use to the beginning of the path will ensure that this version is used in this case. Here is an example bash command to prepend a directory to the path:
This assumes that the python3 executable to use is found in the /usr/local/python3/bin directory. You can check which executable is found first in the path by running:
You can also pass the run_metplus.py command as an argument to the version of Python3 that is needed. However, you will likely need to specify the full path to the run_metplus.py script:
Let me know if that helps or if you have any other questions. |
Beta Was this translation helpful? Give feedback.
-
Hi George, Thank you for your quick reply. I am working on a WPC machine. The METv10/METplusv4 install was done by NCO with assistance from your team on our netapp. It is mounted to several WPC machines. I did some modifications to the path variable (note we use csh rather than bash) and things seem to work properly now. However, when I get to here in the tutorial, https://dtcenter.org/metplus-practical-session-guide-version-4-0/session-1-metplus-setupgrid-grid/metplus-setup/metplus-user-configuration-settings, I need to directly modify paths in ${METPLUS_BUILD_BASE}/parm/metplus_config/defaults.conf. I am only able to modify local files, but do not have permissions to modify files on the netapp. Is there anyway to still only use the one build of METplus (where we don't have edit permissions) without installing multiple METplus versions locally? Thank you! Mike |
Beta Was this translation helpful? Give feedback.
-
Thank you George for your reply and I apologize for the delay. I have not had any further issues in the tutorial, except for the python embedding portion of the tutorial last week. When I reach this portion of the tutorial, https://dtcenter.org/metplus-practical-session-guide-version-4-0/session-1-metplus-setupgrid-grid/met-tool-plot-data-plane/python-embedding, I get an error when running: plot_data_plane My entire error is below, but the issue appears to be that the wrong version of python is called (e.g not the one I specified at MET_PYTHON_EXE, but an older version on our WPC netapp). I would like python to be called from /export/hpc-lw-dtbdev5/merickson/anaconda3/bin/python rather than /opt/MET/external/python37/lib/python3.7/site-packages/. Perhaps the MET_PYTHON_EXE variables does not control this? As always, thank you for your help! Mike Input File: '/export/hpc-lw-dtbdev5/merickson/code/python/METplus-4.0.0_Tutorial/data/met_test/data/python/fcst.txt' |
Beta Was this translation helpful? Give feedback.
-
Hi George, I have one follow up question. A coworker of mine was able to get the command to run just fine. We work out of our own local directories (e.g. METPLUS_DATA and MET_PYTHON_EXE point to our own local machines) but we use the same METplus/MET installation at /opt/MET. Please see below for his properly working command/output. I am a bit confused how his can work and mine does not given we use the same MET/METplus build? Please let me know if you have any questions. Thanks again, Mike plot_data_plane I get this as output: DEBUG 1: Opening data file: PYTHON_NUMPY |
Beta Was this translation helpful? Give feedback.
-
Thanks George, I have matched our paths for LD_LIBRARY_PATH, LIBS, and PATH in our .cshrc files and sourced them. Unfortunatetely, I still get the same error. May be a more complicated environmental variable issue on my machine. Thanks, Mike |
Beta Was this translation helpful? Give feedback.
Thanks George,
I have matched our paths for LD_LIBRARY_PATH, LIBS, and PATH in our .cshrc files and sourced them. Unfortunatetely, I still get the same error. May be a more complicated environmental variable issue on my machine.
Thanks,
Mike