MHKiT-Software / MHKiT-MATLAB

MHKiT-MATLAB provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
15 stars 23 forks source link

MHKiT-Matlab installation issues #49

Closed ssolson closed 3 years ago

ssolson commented 3 years ago

Rebecca, I am having some trouble getting MHKiT-Matlab going. I have followed the installation instructions but no luck.

Pip show image mhkit-python in on origin master branch mhkit-matlab is on the origin master as well

Add-On Manager shows the toolbox installed correctly image

I am using python 3.8 with matlab 2020b (this was working before).

If I call the circular command I get an error with h5py. image

rpauly18 commented 3 years ago

This is the same error as https://github.com/MHKiT-Software/MHKiT-MATLAB/issues/46 . I am looking into it.

ssolson commented 3 years ago

Rebecca this is the same error however this is using a Matlab supported version of python (e.g. 3.8). T-osu was using 3.9 which is not supported by MATLAB. I suggest we solve this issue and I closed the other one.

rpauly18 commented 3 years ago

I have not been able to replicate the error. I am using Matlab 2020b and python 3.8. Same MHKiT package versions as you. What is your h5py version? I am on 2.10.0

ssolson commented 3 years ago

Yes 2.10.0 as well

rpauly18 commented 3 years ago

Only other things I can think of right now are do you have the latest update for 2020b? I believe they are on update 4. Or, after Googling the issue, it might be resolved by uninstalling and reinstalling h5py- worth a shot.

ssolson commented 3 years ago

Update 4 did not fix the issue. I will attempt uninstalling h5py

ssolson commented 3 years ago

Uninstall and reinstalling h5py does not.

MHKiT does need h5py to run so just leaving it uninstalled does not work.

Reading online this seems to be an issue with MATLAB and h5py. The solutions I have read are to use a different file format than h5py.

rpauly18 commented 3 years ago

Using a different file format is not going to be possible for the WPTO hindcast dataset. It is interesting that I am not having the issue with MATLAB and h5py. Any possibility operating system is playing a role?

ssolson commented 3 years ago

ohh Yes apologies. Above should Read MATLAB, Windows, and h5py

rpauly18 commented 3 years ago

@t-osu Thank you for your patience as we work through this issue. In the meantime, for using MHkiT-Matlab I recommend you uninstall MHkiT-Python from your cloned version and do a regular pip install of MHKiT-Python (See option one in the installation instructions

t-osu commented 3 years ago

Just wanted to update. I uninstalled python 3.9 and installed 3.7 and also followed the recommendation of using pip to install MHKiT-Python. The same issue arises, unfortunately. Python works great, but matlab is reporting the same error as #46. Following @rpauly18 requests, here was the output from pip list:

Package Version Location


certifi 2020.12.5 chardet 4.0.0 cycler 0.10.0 fatpack 0.6.2 idna 2.10 Jinja2 2.11.3 joblib 1.0.1 kiwisolver 1.3.1 lxml 4.6.2 MarkupSafe 1.1.1 matplotlib 3.3.4 mhkit 0.3.1 mhkit-python-utils 0.2.0 c:\users\eecs\documents\matlab\mhkit-matlab numpy 1.20.1 pandas 1.2.2 pecos 0.1.9 Pillow 8.1.0 pip 19.0.3 pyparsing 2.4.7 python-dateutil 2.8.1 pytz 2021.1 requests 2.25.1 scikit-learn 0.24.1 scipy 1.6.0 setuptools 40.8.0 six 1.15.0 threadpoolctl 2.1.0 urllib3 1.26.3

rpauly18 commented 3 years ago

@t-osu just to make sure we have covered all our bases, did you restart Matlab after changing your MHKiT-Python install?

ssolson commented 3 years ago

😬soo I am getting a DLL error from Matplot lib when I revert to the pip install mhkit and reinstall everything. Hopefully, I can revert Matplotlib to a previous version to fix this.

ssolson commented 3 years ago

I have gotten around this original issue using this suggestion: https://www.mathworks.com/matlabcentral/answers/427187-problem-with-python-numpy#answer_425009

I did this for my python installation and not an environment as described in the linked answer. This created a different issue with Matplotlib that I am chasing down now though.

ssolson commented 3 years ago

Apologies. The issue was with my underlying matplotlib. I needed to reinstall matplotlib (I checked that error also came up in Python) but I can now successfully use MHKiT Matlab. I will do a clean install now and get back to you on the steps.

ssolson commented 3 years ago

To get MHKiT Matlab to run in Windows:

pip uninstall mhkit pip install mhkit open Matlab, close and reopen if already open double click mhkit.mltbx to reinstall the toolbox Check with circular(30) should return 30 image