emerrf / gym-wind-turbine

OpenAI Gym environment which reproduces the behaviour of a wind turbine realistically using CCBlade aeroelastic code
Apache License 2.0
19 stars 5 forks source link

ccblade running error #4

Closed frostyduck closed 5 years ago

frostyduck commented 5 years ago

I want to use gym-wind-turbine package. According recommendations, I have installed using conda the following tools conda create --name gwt-devenv python=3.6.2 scipy=0.18.1 zope.interface=4.4.2 m2w64-gcc-fortran=5.3.0. All packages (which includes ccblade) were installed successfully.

Howewer, whan I try to run import gym_wind_turbine I receive the following error from CCblade:

ModuleNotFoundError: No module named '_bem'

I decided to contact the WISDEM developers (NREL staff). They recommended to follow the wisdem install instructions very close, that make sure I get CCBlade installed properly, and after that install the gym-wind-turbine in that wisdem working environment. They advised to install only CommonSE, Airfoil Preppy, Akima, and CCBlade

However I have met with the following new error in the step 6 (when installing CommonSE, Akima, and CCBlade; Airfoil Preppy was installed successfully):

File "C:\Users\843E~1\AppData\Local\conda\conda\envs\gwt-devenv\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 298, in generate_def if _START.match(dump[i].decode()): UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 114: invalid continuation byte

I have no idea, why it happened, because before it I have installed successfully, for example, ccblade.

emerrf commented 5 years ago

Thanks for trying the environment and raising the issue.

The problem was that the ccblade version used by the gym-wind-turbine relies in a specific numpy.distutils version in order to compile the fortran code. I fixed the numpy version to 1.12.1 and then it worked (see commit: https://github.com/emerrf/CCBlade/commit/b95ad346bbbefe3828d59fdb5e6a1252bc514d1c). To have it working in your machine, remove your current virtual environment (conda env remove -n gwt-devenv) and then follow the installation instructions again from the beginning. Remember that you can test the installation by running ccblade and gwt-run-neutral commands.

Did you contact WISDEM through the forum? If so, do you mind sharing the link? The gym-wind-turbine is not compatible with the official version of ccblade because it wasn't a python package when this environment was developed. At that time, I forked ccblade and converted it into a package so that it could be easily integrated (see https://github.com/WISDEM/CCBlade/pull/7). However, WISDEM continued the development of the code and also transformed it into a package without the PR. At some point, I will have to update gym-wind-turbine with the latest ccblade version, ideally using the official package.

frostyduck commented 5 years ago

Thank you very much for your help! I had finally reached the success!!! Last days of my wanderings, I began to guess that the problem is related something with numpy )).

Yes, I contacted WISDEM through the forum(post1, post2). Of course, I don't mind sharing the link.