-
Notifications
You must be signed in to change notification settings - Fork 23
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
Import Error on Windows 10 #14
Comments
Hi Raul, Whenever I've faced similar issues its because the compiler used for the install is different or can't be found when running mistree. Are you using the same environment? P.S. I've not used mistree on windows before so I won't be able to test anything if it is windows specific but I will try to chase down this problem. Best, Krishna |
Hi Krishna, Everything is running in anaconda. Best, |
Hi Raul, I appreciate it. It might be worth checking if the fortran files have actually compiled. So please check if you can find the compiled version of 'utility_random_walk.f90' in your directory ~\anaconda3\lib\site-packages\mistree\levy_flight\ which is called by the same name with a '.so' extension (perhaps different on windows) . If you can't then this maybe an issue with f2py on windows. This issue posted here may be relevant to the problem you're seeing. best, Krishna |
Hi Krishna, I have not been able to resolve the issue after trying several times to re-install MinGW (64-bit). Best, |
Hi Raul, Glad it's working now. I will suggest windows users clone the repository in the documentation. Many thanks, Krishna |
PS. I've now added this instruction on the README file on github and the documentation page. |
Hi there, I've also tried the steps Raul went through, including reinstalling 64-bit MinGW. Nothing seems to work, even installing by cloning the repo. I still get the same error in the original post. |
Hi @CurtisTD, could you check
|
Hi again, I checked and the error indeed comes from the cloned repo, as well as when I use the one installed with pip. It also seems to compile the Fortran files correctly, which are compiled as a .pyd file. Is the expected outcome? |
I'm not too sure, as I've never used windows for python. Could you try reinstalling in the cloned repo and type the following: python setup.py build If it hasn't been installed correctly the last command will return errors. |
Gotcha, tried those commands and was still given the same import error as mentioned in the original post. |
To clarify did you see the import error after running python setup.py test? |
That is correct |
Hi Krishna, I have the same problem with dll. "DLL load failed while importing utility_random_walk: The specified module could not be found." I have tried the suggestions above now it installs the package but I get the error when importing it. |
Have you solved this ? |
Hi @RAJUL555, unfortunately no. I don't have a windows machine to test these errors on and have no experience with python on windows. However I've been looking around about this error and it appears this is a path error and for whatever reason the fortran compiled files are not being added to your path. You can test this by tying to import utility_random_walk inside mistree/levy_flight where it is located. This would mean going to the folder mistree/levy_flight, launching python and importing utility_random_walk. If this works, then it is just a path issue and not an installation issue. A quick fix that might work is to add mistree to your path before launching python. There are three fortran files in total, utility_random_walk.f90, utility_mst.f90 and utility_density.f90 (the latter of which are in the mst folder in mistree) so I think you'd need to add two paths one to the levy_flight folder and another to the mst folder in mistree. Let me know if you make any progress. |
Hi all, I see that the issue is still open. I have stumbled across the same issue on Windows 11 Pro (Python 3.8.1) and, after several failed attempts, I was able to solve the problem by referring to the following thread: |
@vsquicciarini it has been a while since you commented, but just to say that your solution of pasting the three .dll files to relevant folders worked for me too. I had been debugging for hours lol. Thanks a bunch! |
Thank you @vsquicciarini,I have solved this problem using your method. |
Hi Krishna,
I am not able to import mistree with my windows 10 machine.
I get the following ImportError:
import mistree
ImportError Traceback (most recent call last)
in
7 import random
8 from jupyterthemes import jtplot
----> 9 import mistree as mist
10
11
~\anaconda3\lib\site-packages\mistree_init_.py in
9
10 # levy flight distributions
---> 11 from .levy_flight.levy_flight import get_random_flight
12 from .levy_flight.levy_flight import get_levy_flight
13 from .levy_flight.levy_flight import get_adjusted_levy_flight
~\anaconda3\lib\site-packages\mistree\levy_flight_init_.py in
----> 1 from .levy_flight import get_random_flight
2 from .levy_flight import get_levy_flight
3 from .levy_flight import get_adjusted_levy_flight
~\anaconda3\lib\site-packages\mistree\levy_flight\levy_flight.py in
3
4 import numpy as np
----> 5 from . import utility_random_walk as random_walk
6
7
ImportError: DLL load failed: The specified module could not be found.
I have tried to follow the solution suggested in here: https://stackoverflow.com/questions/20201868/importerror-dll-load-failed-the-specified-module-could-not-be-found but no dice.
Not sure if it is a dependency issue or a windows 10 issue, but any help is appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: