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

capytaine with miniconda on Windows 10 #1

Closed
sdillenburg opened this issue Nov 14, 2018 · 27 comments
Closed

capytaine with miniconda on Windows 10 #1

sdillenburg opened this issue Nov 14, 2018 · 27 comments

Comments

@sdillenburg
Copy link
Contributor

sdillenburg commented Nov 14, 2018

Hi all,

When installing capytaine on Windows 10, I get the following error message:

`Microsoft Windows [Version 10.0.17134.345]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\XXX>conda install attrs numpy scipy pandas xarray matplotlib vtk
Solving environment: done

# All requested packages already installed.


C:\Users\XXX>conda install -c mancellin capytaine
Solving environment: done

# All requested packages already installed.
 
 
C:\Users\XXX>python
Python 3.6.7 |Anaconda, Inc.| (default, Oct 28 2018, 19:44:12) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import capytaine
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\XXX\Miniconda3\lib\site-packages\capytaine\__init__.py", line 23, in <module>
    from capytaine.Nemoh import Nemoh
  File "C:\Users\XXX\Miniconda3\lib\site-packages\capytaine\Nemoh.py", line 24, in <module>
    from capytaine.tools.exponential_decomposition import find_best_exponential_decomposition
  File "C:\Users\XXX\Miniconda3\lib\site-packages\capytaine\tools\exponential_decomposition.py", line 15, in <module>
    import capytaine.NemohCore as NemohCore
ImportError: DLL load failed: The specified module could not be found.
@mancellin
Copy link
Collaborator

Hi,

Yeah, there is a problem with the packaging of the precompiled Fortran extension on Windows and I haven't had the time to investigate it yet.

Sorry about that. I'll try to fix it as soon as possible.

In the mean time, the Linux version of the package should work. Or you can try to compile it yourself (https://ancell.in/capytaine/latest/developer_manual/installation.html).

@mancellin
Copy link
Collaborator

I investigated the problem a bit:

The compiled dll for NemohCore (.pyd file) can be found in the anaconda package.
The error message must be for one of its dependencies.

According to Dependency walker, there is among them libpython which can be installed with

conda install libpython

There is also libgfortran. It can be found with the compiler (mingw-w64) but I'm not sure how to distribute it to users without asking them to install the full compiler.

Dependency walker also mentions a lot of dll for Windows API. Hopefully, the build is not too platform specific.

To be continued...

@mancellin
Copy link
Collaborator

To @sdillenburg or whoever else is reading this thread:

Would you mind downloading this anaconda package https://ancell.in/tmp/capytaine-0.5.1-py36h39e3cac_0.tar.bz2, installing it with conda install capytaine-0.5.1-py36h39e3cac_0.tar.bz2and letting me know if it works on your computer?

It has been build on another system and I'd like to check if it changes anything...

@sdillenburg
Copy link
Contributor Author

Sorry for the late reply. The installation files attached to the previous post yield the same error.

@mancellin
Copy link
Collaborator

Thanks for your help.
For the record, do you have a 32 or 64-bits version of Windows?

@sdillenburg
Copy link
Contributor Author

I have tested it on two different 64-bit machines (both running Windows 10)

@mancellin
Copy link
Collaborator

Not much new, the Windows version is still broken.

But Windows user might be interested to know that the Linux version of Capytaine on conda seems to work fine using the Windows Subsystem for Linux. There are a couple of tutorials online on how to install conda in WSL and how to set up the graphical display. This is the recommended way to use Capytaine on Windows at the moment...

@CNwave
Copy link

CNwave commented Mar 21, 2019

Dear Mancellin,

After some tests, the LINUX package on Windows Subsystem like VMWARE is not working for animation features due to the subsystem softwares not supporting high version of OPGL. When animation functions are called, the kernel died and hard to restart. I have tests on 3 PCs and all give the same problems.
I try to dig and found actually there is a solution at https://www.mesa3d.org/vmware-guest.html
the mesa3D. However, the building produres are too long and tricky. I tried but not work. But it may worth a try for someone good.

@mancellin
Copy link
Collaborator

@CNwave
Thank you for your feedback. Did the other features of the code work fine?

For the animation, maybe you can try to call Animation.save without Animation.run in order to save the animation in a file without displaying it on screen. I don't know if OpenGL is required in this case.

@sofair
Copy link

sofair commented May 31, 2019

I have strawberry perl installed, which provides the gnu compiler tools in PATH:

`Microsoft Windows [Version 10.0.17763.503]
(c) 2018 Microsoft Corporation. All rights Reserved.

C:\Users\xxx>where perl
C:\Strawberry\perl\bin\perl.exe

C:\Users\xxx>where gcc
C:\Strawberry\c\bin\gcc.exe

C:\Users\xxx>where gfortran
C:\Strawberry\c\bin\gfortran.exe

C:\Users\xxx>`

I can build and run capytaine from the source. after installing all dependencies by conda install "numpy>=1.15,<1.17" attrs scipy matplotlib pandas xarray vtk

Download the capytaine source, build using python setup.py --compiler mingw32, then install it python setup.py install

the python version i'm using is 3.7.3. actually, capytaine needs 3.6 and above.

@mancellin
Copy link
Collaborator

@sofair Thank you for your feedback. Indeed, the code should work fine as long as you have a Fortran compiler available and you compile it yourself.

The conda community seems to be working on the distribution of compilers for all platforms including Windows, so I have hope that our packaging problem will soon be fixable.

@mancellin
Copy link
Collaborator

I tried again to compile Capytaine with the conda-forge toolchain.
Could someone try to install the new package from conda-forge and let me know if it works on their Windows machine ?

@mancellin
Copy link
Collaborator

mancellin commented Nov 8, 2019

From the few feedback I've received, everything seems to be working on Windows. Feel free to comment and reopen the issue if there is any trouble.

@izabala123
Copy link

Hi Matthieu

I have updated Capytaine in Windows 10 and tried to run an example using the old nemoh.cal format, but I get this error so I suppose it is related with gfortran compiler:
screenshot
In Linux it works well.

@mancellin
Copy link
Collaborator

Yes, it is failing to load the compiled Fortran code.

When you say that you updated Capytaine, do you mean that the previous version from conda-forge you had was working fine? Was does conda list capytaine return?

@izabala123
Copy link

Hello! It returns this:
Screen

@sdillenburg
Copy link
Contributor Author

Maybe the use of Windows Subsystem for Linux (WSL) it is an acceptable workaround?

@izabala123
Copy link

Hello! It returns this:
Screen

I have set gfortran in PATH, but results are the same.
Captura de pantalla 2020-11-13 150705

@mancellin
Copy link
Collaborator

The build in your conda list is a new version compiled by conda-forge a few days ago. (For the interested readers, the list is here.)
If it worked better previously, you can try to reinstall the previous one, compiled 6 months ago, which should be

conda install -c conda-forge capytaine=1.2=py37h7a9867a_1

@izabala123
Copy link

Thank you Matthieu. I have just tried it but the error is repeated.
Now conda list capytaine returns
Captura de pantalla 2020-11-13 165133

@izabala123
Copy link

Maybe the use of Windows Subsystem for Linux (WSL) it is an acceptable workaround?

Thank you sdillenburg. I wanted to run Capytaine from command line as a step to get a separate .exe for Capytaine to be run without python knowledge.

@mancellin
Copy link
Collaborator

Ok. Nobody reported an issue on Windows recently, so unless you are the only one to download the code on Windows in the last months, the issue is probably not with the compiled file itself. (I have no Windows machine with me to try to repeat the error...)
Maybe there is something wrong with your Python environment. Do you mind trying to reinstall Capytaine in a clean installation of Anaconda?

@izabala123
Copy link

I have tried it in other PC with Windows 7 obtaining the same error. I am going to reinstall Python in that computer (I prefer not to smash my install :-) )

@izabala123
Copy link

After an hyper-slow Anaconda reinstall in other PC, I have just run Capytaine from Anaconda Powershell Prompt instead of from a command line in my PC... everything runs!! :-)

@Maselko
Copy link

Maselko commented Jul 16, 2021

I have encountered the similar issue again with error message:

<ipython-input-1-bb325ab7ab4d> in <module>
----> 1 import capytaine

~\Anaconda3\lib\site-packages\capytaine\__init__.py in <module>
     19
     20 from capytaine.bem.problems_and_results import RadiationProblem, DiffractionProblem
---> 21 from capytaine.bem.solver import Nemoh, BEMSolver
     22 from capytaine.bem.engines import BasicMatrixEngine, HierarchicalToeplitzMatrixEngine
     23 from capytaine.green_functions.delhommeau import Delhommeau, XieDelhommeau

~\Anaconda3\lib\site-packages\capytaine\bem\solver.py in <module>
     21 from datetime import datetime
     22
---> 23 from capytaine.green_functions.delhommeau import Delhommeau
     24 from capytaine.bem.engines import BasicMatrixEngine, HierarchicalToeplitzMatrixEngine
     25 from capytaine.io.xarray import problems_from_dataset, assemble_dataset, kochin_data_array

~\Anaconda3\lib\site-packages\capytaine\green_functions\delhommeau.py in <module>
     13
     14 from capytaine.green_functions.abstract_green_function import AbstractGreenFunction
---> 15 import capytaine.green_functions.Delhommeau_f90 as Delhommeau_f90
     16 import capytaine.green_functions.XieDelhommeau_f90 as XieDelhommeau_f90
     17

ImportError: DLL load failed while importing Delhommeau_f90: The specified module could not be found.

after importing. Any ideas how to fix it?
Thank you for your help

@mancellin
Copy link
Collaborator

@Maselko Not sure why the compiled Fortran core of Capytaine could be missing.
Could you tell a bit more about the version of your OS and the version of Capytaine (conda list capytaine)?

@Maselko
Copy link

Maselko commented Jul 21, 2021

I am away from the computer at the moment. I will check as soon as I get back. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants