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

SRW import fails in OASYS windows installation #9

Closed
jureyherrera opened this issue Nov 9, 2021 · 5 comments
Closed

SRW import fails in OASYS windows installation #9

jureyherrera opened this issue Nov 9, 2021 · 5 comments

Comments

@jureyherrera
Copy link

Hello, I have and issue that appeared suddenly, when launching OASYS1.2 in windows 10, it fails to import SRW with the following message:

Error importing 'orangecontrib.srw.menu.ow_srw_tools_menu'
Traceback (most recent call last):
File "C:...\Miniconda3\lib\site-packages\oasys\canvas\discovery.py", line 36, in omenus_from_package
menu_module = discovery.asmodule(name)
File "C:...\Miniconda3\lib\site-packages\orangecanvas\registry\discovery.py", line 505, in asmodule
return import(module, fromlist=[""])
File "C:...\AppData\Roaming\Python\Python37\site-packages\orangecontrib\srw\menu\ow_srw_tools_menu.py", line 7, in
from wofrysrw.propagator.propagators2D.srw_fresnel_native import SRW_APPLICATION
File "C:...\AppData\Roaming\Python\Python37\site-packages\wofrysrw\propagator\propagators2D\srw_fresnel_native.py", line 7, in
from wofrysrw.beamline.srw_beamline import Where
File "C:...\AppData\Roaming\Python\Python37\site-packages\wofrysrw\beamline\srw_beamline.py", line 5, in
from wofrysrw.beamline.optical_elements.srw_optical_element import SRWOpticalElementDisplacement
File "C:...\AppData\Roaming\Python\Python37\site-packages\wofrysrw\beamline\optical_elements\srw_optical_element.py", line 7, in
from wofrysrw.propagator.wavefront2D.srw_wavefront import WavefrontPropagationParameters, WavefrontPropagationOptionalParameters
File "C:...\AppData\Roaming\Python\Python37\site-packages\wofrysrw\propagator\wavefront2D\srw_wavefront.py", line 1, in
from oasys_srw.srwlib import srwl, SRWLWfr, SRWLRadMesh, SRWLStokes, array as srw_array
File "C:...\AppData\Roaming\Python\Python37\site-packages\oasys_srw\srwlib.py", line 6, in
import srwlpy as srwl
ImportError: DLL load failed: The specified module could not be found.
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
Failed to import SRW
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
SRW is not available

I have the same problem in two different PCs (Win10), and the same happened to another OASYS windows user.

Thank you in advance for your attention.

Kind regards, J

@lucarebuffi
Copy link
Member

Your environment looks messed up. The location for the installed libraries is wrong, and it should be ...\Miniconda3...\site-packages

it means that it is installing the libraries in the site-packages of another python, where SRW is not supposed to run. We distribute it precompiled for the specific version of Miniconda we use to install Oasys. I believe you should change the PATH somehow, to allow Miniconda finding the right location to install the libraries via pip. Then I believe it must be done in the script that start Oasys. I'll dig into it and then it would be better to reinstall.

@jureyherrera
Copy link
Author

Yes, you are right, OASYS should use the env in Miniconda3, but I don't know when OASYS started to look for this other environment. BTW, I have tried to uninstall everything and reinstall, but same issue persist.

@lucarebuffi
Copy link
Member

lucarebuffi commented Nov 9, 2021

Reinstalling won't work until the issue of conflicting environments is fixed

@lucarebuffi
Copy link
Member

Juan do you use zoom? try to find me with the username lrebuffi@anl.gov

@lucarebuffi
Copy link
Member

Ok, here what we found (for public record):

  • uninstall OASYS1-SRW from Oasys (Add-ons form)

  • open a Miniconda3 prompt

  • type: python -m pip uninstall oasys-srwpy

  • reinstall it manually from the prompt, typing: python -m pip install oasys-srwpy (--upgrade, optional)

  • install OASYS1-SRW from Oasys (Add-ons form)

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

No branches or pull requests

2 participants