tsutterley / gravity-toolkit

Python tools for obtaining and working with data from the GRACE and GRACE Follow-On missions
https://gravity-toolkit.readthedocs.io
MIT License
31 stars 19 forks source link

Windows 10, Conda-Based installation #64

Closed EldrML closed 2 years ago

EldrML commented 2 years ago

Hi there,

I am using VS Code in Windows 10, and when I run the setup.py file, I end up with the following issue regarding what looks like decoding problems? I am somewhat inexperienced with Python, so any help would be great.

../read-GRACE-harmonics/setup.py install
Traceback (most recent call last):
  File "..\read-GRACE-harmonics\setup.py", line 10, in <module>
    long_description = fh.read()
  File "C:\_Miniconda3\envs\gracefo\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 3118: character maps to <undefined>
tsutterley commented 2 years ago

hey @EldrML I think you can use miniconda to build the environment needed

conda env create -f .binder/environment.yml

I can try to spin up a windows VM if you run into trouble

EldrML commented 2 years ago

hey @EldrML I think you can use miniconda to build the environment needed

conda env create -f .binder/environment.yml

I can try to spin up a windows VM if you run into trouble

It turns out that this seemed to be an encoding issue that was resolved by changing this line to be with open("README.rst", "r", encoding='utf8') as fh:

However, in testing, I ran into another Windows-based issue: the numpy.float128 type is not supported in windows numpy. I was able to resolve it by changing all np.float128 references in the codebase to np.longdouble and reinstalling gravity-toolkit

After that, I have been able to get all except 2 of the tests to pass, this test, which I believe requires me to input my PODAAC credentials (haven't done that yet), and this test, which I think is a similar encoding issue as the setup.py issue, but I haven't found where the encoding is going awry yet.

I also had to install GDAL separately, as I was getting a warning about it not being installed, but I'm not sure if that is an issue.

Thank you for your help, and I hope this helps a little bit too--windows is weird. I can also spin these off into their own issues if that would help you

tsutterley commented 2 years ago

Alright I'll try to get these things fixed! :+1:

tsutterley commented 2 years ago

hey @EldrML That helped a lot. I just merged a PR with these fixes. I reworked my github actions PR workflow to add a windows build. So (at the very least) things compile on windows and can pass the same tests I run on linux and mac. Let me know if you run into any more problems. I can add more tests to make sure more things run consistently between operating systems.

EldrML commented 2 years ago

Happy to help! For now, I have gotten what I need (great software btw), but I will let you know if I run into any more issues in the f future.