WISDEM / CCBlade

A blade element momentum method for analyzing wind turbine aerodynamic performance that is robust (guaranteed convergence), fast (superlinear convergence rate), and smooth (continuously differentiable).
Other
45 stars 40 forks source link

CCblade and utf8 codec error #12

Closed frostyduck closed 4 years ago

frostyduck commented 5 years ago

I earlier wrote in ccblade running error in this post. I received the following error from CCblade: ModuleNotFoundError: No module named '_bem'

After that I decided follow the wisdem install instructions very close, that make sure I get CCBlade installed properly. I tryed to install only CommonSE, Airfil Preppy, Akima, and CCBlade (from the Wisdem library).

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 repeated it at other computer and received the same error. I tryed also to change numpy versions (because the error related something with mingw32ccompiler file), but it have not help.

evan-gaertner commented 5 years ago

No module named '_bem' results from an improper compiling of fortran modules, so CCBlade and Akima. This is reflected in the second error where there is a mingw error. I'm surprised you're having so much trouble, so I'm going to see if I can reproduce this. Please share as much information about your system and software versions as possible, especially what version of anaconda and python you're using, 64 vs 32 bit, etc. Also please share the output of 'conda list' from your active conda environment.

frostyduck commented 5 years ago

The information about my system OS Windows (64 bit) Python 3.7.3. Anaconda 3 (version 4.6.14)

I have two conda environments: 1) gwt-devenv, which includes the installed CCblade with the error No module named '_bem' and 2) wisdem-env, which I created regarding the wisdem install instructions (without installed CCblade, because I can not install ccblade because a mingw error).

(wisdem-env) C:\Users\Никита>conda list Name Version Build Channel airfoilprep 0.1.0 dev_0 airfoilprep-py 0.1.0 pypi_0 pypi alabaster 0.7.12 py_0 conda-forge asn1crypto 0.24.0 pypi_0 pypi babel 2.6.0 py_1 conda-forge backcall 0.1.0 py_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.5 py_1 conda-forge backports.shutil_get_terminal_size 1.0.0 py_3 conda-forge backports_abc 0.5 py_1 conda-forge beautifulsoup4 4.7.1 py37_1001 conda-forge blas 1.0 mkl bzip2 1.0.6 hfa6e2cd_1002 conda-forge ca-certificates 2019.3.9 hecc5488_0 conda-forge certifi 2019.03.09 pypi_0 pypi cffi 1.12.3 py37hb32ad35_0 conda-forge chardet 3.0.4 pypi_0 pypi colorama 0.4.1 py_0 conda-forge commonse 0.1.3 dev_0 conda 4.6.14 pypi_0 pypi conda-build 3.17.8 pypi_0 pypi contextlib2 0.5.5 py_2 conda-forge cryptography 2.6.1 py37hb32ad35_0 conda-forge cycler 0.10.0 py_1 conda-forge cython 0.29.7 py37h6538335_0 conda-forge decorator 4.4.0 py_0 conda-forge docutils 0.14 pypi_0 pypi enum34 1.1.6 pypi_0 pypi et-xmlfile 1.0.1 pypi_0 pypi et_xmlfile 1.0.1 py37_1000 conda-forge filelock 3.0.10 py_0 conda-forge freetype 2.10.0 h5db478b_0 conda-forge futures 3.2.0 pypi_0 pypi git 2.21.0 0 conda-forge glob2 0.6 py_0 conda-forge icc_rt 2019.0.0 h0cc432a_1 idna 2.8 pypi_0 pypi imagesize 1.1.0 py_0 conda-forge intel-openmp 2019.3 203 ipaddress 1.0.22 pypi_0 pypi ipython 4.2.1 pypi_0 pypi ipython_genutils 0.2.0 py_1 conda-forge jdcal 1.4.1 py_0 conda-forge jedi 0.13.3 pypi_0 pypi jinja2 2.10.1 py_0 conda-forge jpeg 9c hfa6e2cd_1001 conda-forge kiwisolver 1.0.1 pypi_0 pypi latexcodec 1.0.6 py_0 conda-forge libarchive 3.3.3 h891e933_5 libarchive-c 2.8 pypi_0 pypi libblas 3.8.0 7_mkl conda-forge libcblas 3.8.0 7_mkl conda-forge libiconv 1.15 hfa6e2cd_1005 conda-forge liblapack 3.8.0 7_mkl conda-forge liblief 0.9.0 ha925a31_2 libpng 1.6.37 h7602738_0 conda-forge libpython 2.1 py37_0 libxml2 2.9.9 h9ce36c8_0 conda-forge lz4 2.1.6 pypi_0 pypi lz4-c 1.8.3 he025d50_1001 conda-forge lzo 2.10 hfa6e2cd_1000 conda-forge m2w64-binutils 2.25.1 5 m2w64-bzip2 1.0.6 6 m2w64-crt-git 5.0.0.4636.2595836 2 m2w64-gcc 5.3.0 6 m2w64-gcc-ada 5.3.0 6 m2w64-gcc-fortran 5.3.0 6 m2w64-gcc-libgfortran 5.3.0 6 m2w64-gcc-libs 5.3.0 7 m2w64-gcc-libs-core 5.3.0 7 m2w64-gcc-objc 5.3.0 6 m2w64-gmp 6.1.0 2 m2w64-headers-git 5.0.0.4636.c0ad18a 2 m2w64-isl 0.16.1 2 m2w64-libiconv 1.14 6 m2w64-libmangle-git 5.0.0.4509.2e5a9a2 2 m2w64-libwinpthread-git 5.0.0.4634.697f757 2 m2w64-make 4.1.2351.a80a8b8 2 m2w64-mpc 1.0.3 3 m2w64-mpfr 3.1.4 4 m2w64-pkg-config 0.29.1 2 m2w64-toolchain 5.3.0 7 m2w64-tools-git 5.0.0.4592.90b8472 2 m2w64-windows-default-manifest 6.4 3 m2w64-winpthreads-git 5.0.0.4634.697f757 2 m2w64-zlib 1.2.8 10 make 4.2.1 h301d43c_2004 conda-forge markupsafe 1.1.1 py37hfa6e2cd_0 conda-forge matplotlib 2.0.0 pypi_0 pypi menuinst 1.4.16 py37_0 conda-forge mingw 4.7 1 mkl 2019.3 203 msys2-conda-epoch 20160418 1 networkx 1.11 pypi_0 pypi numpy 1.16.3 py37h873a0b8_0 conda-forge numpydoc 0.9.1 py_0 conda-forge openmdao 1.7.4 pypi_0 pypi openpyxl 2.6.1 py_0 conda-forge openssl 1.1.1b hfa6e2cd_2 conda-forge oset 0.1.3 py_1 conda-forge packaging 19.0 py_0 conda-forge pandas 0.24.2 py37h6538335_0 conda-forge parso 0.4.0 py_0 conda-forge pathlib2 2.3.3 py27_1000 conda-forge pickleshare 0.7.5 pypi_0 pypi pip 19.1 pypi_0 pypi pkginfo 1.5.0.1 py_0 conda-forge prompt_toolkit 2.0.9 py_0 conda-forge psutil 5.6.2 py37hfa6e2cd_0 conda-forge py-lief 0.9.0 py37ha925a31_2 pybtex 0.22.2 py37_0 conda-forge pybtex-docutils 0.2.1 pypi_0 pypi pycosat 0.6.3 pypi_0 pypi pycparser 2.19 pypi_0 pypi pygments 2.3.1 py_0 conda-forge pyopenssl 19.0.0 pypi_0 pypi pyparsing 2.4.0 py_0 conda-forge pyqt 5.9.2 py37h6538335_2 pyreadline 2.1 pypi_0 pypi pysocks 1.6.8 pypi_0 pypi python 3.7.3 hb12ca83_0 conda-forge python-dateutil 2.8.0 py_0 conda-forge python-libarchive-c 2.8 py37_1004 conda-forge pytz 2019.1 py_0 conda-forge pywin32 224 py37hfa6e2cd_1000 conda-forge pyyaml 5.1 pypi_0 pypi qt 5.9.7 hc6833c9_1 conda-forge requests 2.21.0 py37_1000 conda-forge ruamel_yaml 0.15.71 py37hfa6e2cd_1000 conda-forge scandir 1.10.0 pypi_0 pypi scipy 1.2.1 pypi_0 pypi setuptools 41.0.1 pypi_0 pypi simplegeneric 0.8.1 py_1 conda-forge singledispatch 3.4.0.3 py27_1000 conda-forge sip 4.19.8 py37h6538335_1000 conda-forge six 1.12.0 pypi_0 pypi snowballstemmer 1.2.1 py_1 conda-forge soupsieve 1.9.1 py37_0 conda-forge sphinx 1.8.5 pypi_0 pypi sphinxcontrib 1.0 py37_1 sphinxcontrib-applehelp 1.0.1 py_0 conda-forge sphinxcontrib-bibtex 0.4.2 py_0 conda-forge sphinxcontrib-devhelp 1.0.1 py_0 conda-forge sphinxcontrib-htmlhelp 1.0.2 py_0 conda-forge sphinxcontrib-jsmath 1.0.1 py_0 conda-forge sphinxcontrib-qthelp 1.0.2 py_0 conda-forge sphinxcontrib-serializinghtml 1.1.1 py_0 conda-forge sphinxcontrib-websupport 1.1.0 py_1 conda-forge sqlite 3.26.0 hfa6e2cd_1001 conda-forge sqlitedict 1.6.0 pypi_0 pypi swig 3.0.12 2 conda-forge tornado 5.1.1 pypi_0 pypi tqdm 4.31.1 py_0 conda-forge traitlets 4.3.2 pypi_0 pypi typing 3.6.6 pypi_0 pypi urllib3 1.24.2 pypi_0 pypi vc 14.1 h0510ff6_4 vs2015_runtime 14.15.26706 h3a45250_0 wcwidth 0.1.7 py_1 conda-forge wheel 0.33.1 pypi_0 pypi win-inet-pton 1.1.0 pypi_0 pypi win_inet_pton 1.1.0 py37_0 conda-forge wincertstore 0.2 pypi_0 pypi xlrd 1.2.0 py_0 conda-forge xz 5.2.4 h2fa13f4_1001 conda-forge yaml 0.1.7 hfa6e2cd_1001 conda-forge zlib 1.2.11 h2fa13f4_1004 conda-forge zope 1.0 py37_1 zstd 1.3.7 h19160c8_1001 conda-forge

gbarter commented 5 years ago

This seems like an encoding problem I have encountered before. At a command line do: python -c "import sys; print(sys.getdefaultencoding())"

On my computer I get utf-8, but I'm guessing you get something else. In the CCBlade setup.py, I would try deleting the first two lines:

#!/usr/bin/env python #encoding: utf-8

and instead add in:

import sys sys.setdefaultencoding('X')

where X is the string returned by the default encoding query above

frostyduck commented 5 years ago

This seems like an encoding problem I have encountered before. At a command line do: python -c "import sys; print(sys.getdefaultencoding())"

On my computer, I get the sameutf-8

and instead add in:

import sys sys.setdefaultencoding('X')

I did it, but I get the following error: AttributeError: module 'sys' has no attribute 'setdefaultencoding'

gbarter commented 5 years ago

Sorry I forgot one line:

import sys reload(sys) sys.setdefaultencoding('X')

It looks like from your earlier post you may have some Greek characters that python encounters? Is that encoding typically "iso8859-7". You could also give that a whirl. Sorry we don't have a definitive debugging path forward for you on this yet.

evan-gaertner commented 5 years ago

You might also try "utf-16"

frostyduck commented 5 years ago

I'm using Python 3.7.3 and the use of sys.setdefaultencoding() has become a no-op in py3k. I get again the same error. I'm from Russia and maybe some problem in Russian characters. However I tryed also to install WISDEM on computer without Russian characters and I have the same problem.

gbarter commented 5 years ago

Did the akima-module install cleanly for you? That also uses Fortran with the mingw compilers. You can test by doing import akima. Maybe just removing those first two lines in the CCBlade setup.py file would help too, without trying to hard-set the encoding.

frostyduck commented 5 years ago

When I'm trying to install akima, I get the same error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 114: invalid continuation byte

gbarter commented 5 years ago

Well, sorry to hear about that problem as well, but at least that is consistent. What about a C/C++-based module like pBeam or pyFrame3DD?

frostyduck commented 5 years ago

Well, sorry to hear about that problem as well, but at least that is consistent. What about a C/C++-based module like pBeam or pyFrame3DD?

What do you mean? Should I try to install this modules in my conda environment?

gbarter commented 5 years ago

If you wouldn't mind, yes please git clone one of those modules (pBeam or pyFrame3DD) and try to do python setup.py develop in your conda environment. We have been trying to assess if this is a Fortran-specific issue or just any time mingw is called.