Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation error on Windows 10 #160

Closed
arfogg opened this issue Apr 19, 2022 · 13 comments
Closed

installation error on Windows 10 #160

arfogg opened this issue Apr 19, 2022 · 13 comments
Labels
installation Problems with the Installation of the pyunicorn package, especially windows. maintenance something should be improved or is outdated
Milestone

Comments

@arfogg
Copy link

arfogg commented Apr 19, 2022

Hi,
Thanks for providing this very useful python package. I am having trouble installing it.
My system is Windows 10 x64

Following the install instructions on your github homepage leads me to this error:

pyunicorn-master>pip install .
...
Building wheels for collected packages: pyunicorn
  Building wheel for pyunicorn (pyproject.toml) ... error
  error: subprocess-exited-with-error
 ...
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyunicorn
Failed to build pyunicorn
ERROR: Could not build wheels for pyunicorn, which is required to install pyproject.toml-based projects

I have also tried to follow through the steps outlined in another issue: #127
which gives me this error:

pyunicorn_whl>pip install pyunicorn-0.6.1-cp37-cp37m-win_amd64.whl
ERROR: pyunicorn-0.6.1-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.

please could you help me to solve this, so I can install pyunicorn.

sorry for the open and close below - I didn't realise some keyboard shortcuts!

Alexandra Fogg

@arfogg arfogg closed this as completed Apr 19, 2022
@arfogg arfogg reopened this Apr 19, 2022
@ntfrgl
Copy link
Member

ntfrgl commented Apr 19, 2022

Hi @arfogg,

It seems like the second approach won't work for you, because that wheel was built for a different CPU architecture.

Regarding the first (correct) approach, the output you've provided doesn't contain enough information for me to identify the source of your problem. Please make sure to install the latest version of Microsoft C++ Build Tools, as suggested in a related issue. In case the problem remains, please run pip install -vvv . to get more detailed output, and post the full error message here - except, of course, any sensitive information there might be.

@arfogg
Copy link
Author

arfogg commented Apr 20, 2022

Hi @ntfrgl ,

Thanks for getting back to me so quickly!

I have updated my version of C++ build tools, it now reads in the developer command prompt as:

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30143 for x86
Copyright (C) Microsoft Corporation.  All rights reserved. 

In conda I ran pip install -vvv ., and attach the full output and error here.
pyunicorn_install_error.txt

my version of pip is: 22.0.4

i'm grateful for any suggestions on what to try next!

Alexandra

ntfrgl added a commit that referenced this issue Apr 21, 2022
- Related issues: #159, #160
- Avoid variable length arrays (C99 not supported by VS)
- Avoid compiler args not supported by VS
- Turn on some Cython safety checks
- Remove some implicit C type casts
- Update installation instructions
@ntfrgl
Copy link
Member

ntfrgl commented Apr 21, 2022

Thanks for your installation report!

We're now facing some minor issues with Microsoft VS, which were previously avoided by relying on GCC for compiling the Cython/C extensions. With the commit above, I've hopefully resolved the errors showing up in your report, although there might be some more lurking behind. Since I don't have access to a Windows machine, may I kindly ask you to try installing again from the newest commit? It might take us a few more iterations until we surface all the Windows-specific issues, but I would like to resolve them.

@arfogg
Copy link
Author

arfogg commented Apr 22, 2022

Thanks for looking into this, I'm very happy to be a tester for any Windows-specific issues!

I'm not 100% sure I have installed via the new commit, but this is the process I did:

Found the new commit (by clicking on the commit and then "Browse files"):
https://github.com/pik-copan/pyunicorn/tree/79ded90816f49274ab6ac91febe50e4dad7b710a

Clicked "Code" and "Download ZIP"

And then, once the zipped files are extracted, I installed as before, using pip install -vvv .

Error and output are similar to before (see text file
pyunicorn_install_error_after_commit.txt ) - maybe I haven't installed your updates correctly? Please could you let me know how to ensure I have installed the version including your current updates.

Alexandra

@ntfrgl
Copy link
Member

ntfrgl commented May 3, 2022

Update: Yes, your process was correct, thank you! The other way would be to git clone the repository once onto your computer, and then simply to git pull whenever you'd like to receive updates. Your report shows that we have indeed made progress. The new errors are of the sort I expected, and I hope to get around to addressing them by this weekend.

Brief explanation: As you can see by comparing the outputs before and after my previous commit, the compiler invocation warnings in lines 94-95 (old) are gone, and instead of getting stuck with errors from climate/_ext/src_numerics.c in lines 99-110 (old), the compiler now fails at the next source file, core/_ext/src_numerics.c in lines 149-150 (new).

@arfogg
Copy link
Author

arfogg commented May 6, 2022

Thanks for getting back to me!
I will keep an eye out for your next update, and be sure to test it out.

Alexandra

@lenas95 lenas95 closed this as completed May 17, 2022
@mixue-t
Copy link

mixue-t commented Feb 24, 2023

Hi, I am facing the same issues as above. Is there a solution for this now? Super keen on using this toolbox!

ntfrgl added a commit that referenced this issue Jun 27, 2023
- Builds on: 79ded90
- Related issues: #159, #160
- Resolves issue: #165
- Eliminate `{s|d}rand48()` calls via overdue Cythonizing
- Avoid some more C99 variable length arrays
- Reference more detailed Windows installation instructions
ntfrgl added a commit that referenced this issue Jun 27, 2023
- Builds on: 3dab5bf
- Related issue: #160
- Turn on & address some Cython compiler warnings
- Force explicit C type conversions
@ntfrgl
Copy link
Member

ntfrgl commented Jun 27, 2023

I am reopening this issue, as it seems to have been closed without confirming a resolution.

@arfogg, please accept our apologies for a lasting lack of resources in addressing this issue. I hope that you have found a workaround for your needs, but would be delighted if you gave this package another chance.

The commits above address all the issues which were visible so far in the installation logs on Windows. @fkuehlein, @zugnachpankow, @mixue-t, may I kindly ask you to attempt a fresh installation on Windows by following the updated instructions in the README?

@ntfrgl ntfrgl reopened this Jun 27, 2023
@ntfrgl ntfrgl added the installation Problems with the Installation of the pyunicorn package, especially windows. label Jun 27, 2023
This was referenced Jun 27, 2023
@linh-hk
Copy link

linh-hk commented Jun 27, 2023

Hi,

I also had error while installing. Which is

numerics.obj : error LNK2001: unresolved external symbol drand48

and tried with all the previous methods, including the installation of Microsoft C++ Build Tools in issue #159. It did not work.

It seems that drand48 and erand48 are not included in the VC if I downloaded as the video said.
Eventually, I just installed Visual Studio code and install the C/C++ Extensions from there and the problem was magically solved.

I just record this here if anyone has the same issue.
Thanks.

@ntfrgl
Copy link
Member

ntfrgl commented Jun 27, 2023

Hi @linh-hk, thank you for reporting your situation.

We're currently in the process of removing the last barriers to the installation on Windows using MSVC. Because drand48() is not defined in MSVC, my latest commits above (16 hours ago) circumvented this call, and several other known problems. Therefore it seems more likely that your issues were actually resolved either by using the most recent code, or by using a different compiler than MSVC.

Do I understand correctly that the Windows installation is now fully functional for you? May I kindly ask you to retry a fresh installation and to provide the entire output of pip install -vvv ., as was done in a comment above? This would be very helpful in assessing the situation.

@linh-hk
Copy link

linh-hk commented Jul 9, 2023

Hi @ntfrgl , sorry for the late reply ... I didn't check the notification...

I successfully install the package on a Window instance on was ec2. I think the issue is solved. When I import the library, it gets me:
pyunicorn: Package netCDF4 could not be loaded. Some functionality in class Data might not be available!
pyunicorn: Package netCDF4 could not be loaded. Some functionality in class NetCDFDictionary might not be available!
(also reported here )

I believe this error is not exclusive to installation on Windows because when I import pyunicorn in Ubuntu it reported the same. I did not have to use any functions that depends on netCDF4 but tried to make it go away by separately install netcdf4 using conda. Please fix it anyway.

Thanks.

ntfrgl added a commit that referenced this issue Jul 10, 2023
- Previously: optional dependency `netcdf4`
- Both libraries provide the `NetCDF4.Dataset` API,
  but `h5netcdf` has a more lightweight Conda installation.
- Alternative solution: remove `core.data.Data` and
  `core.netcdf_dictionary.NetCDFDictionary` from `core.__init__`
- Related issue: #160
@ntfrgl
Copy link
Member

ntfrgl commented Jul 10, 2023

Thank you once more, @linh-hk! I am glad to hear that the installation is working for you.

I have addressed those import warnings in the commit above.

@ntfrgl
Copy link
Member

ntfrgl commented Jul 15, 2023

We had several more reports of successful installations on Windows, hence this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Problems with the Installation of the pyunicorn package, especially windows. maintenance something should be improved or is outdated
Projects
None yet
Development

No branches or pull requests

5 participants