You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I think there are some minor changes to do that hopefully may help others in the future and a problem for which I haven't found the solution. All I did for these errors to occur was to test the "Example 1: Basic functions introduction" from the website of opticspy.
• If you have the message No module named 'aperture' , the problem comes from the version installed, you installed the python 2 version and are using it as a python 3.
-- "pip install" installed the Python 2 version. I don't know how it works but it may need to be updated.
-- on http://opticspy.org/, the link to download it is also for Python2 (even though in this case it's more obvious that it's 2)
Solution → clone the repo on git and run python setup.py install (or replace python by python3 if you have python 2 as default).
• No module named 'lens'
Solution → go into opticspy/ray_tracing/codev.py and replace import lens by from . import lens.
• No module named glass
Solution → go into the file from which you installed if you cloned and in ray_tracing/ you should find a folder glass_database. Copy it and paste it where opticspy has been installed (it should be written on the error message)
• Now this is the error for which I didn't find the solution. When trying to trace the rays with draw.draw_system(New_Lens), the error local variable 'verts' referenced before assignment is returned. The source of the problem is the following. It's in /opticspy/ray_tracing/draw.py in draw_surface(r, x0, d1, d2).
I tried to rename it and reassign a value before in case there was a problem with a global variable which had the same name but it doesn't seems to be it.
I hope this message belongs here, isn't too long and will be helpful for some !
The text was updated successfully, but these errors were encountered:
I had a similar problem. When prompting dict_list = trace.trace_draw_ray(New_Lens) draw.draw_system(New_Lens)
I got the error AttributeError: module 'trace' has no attribute 'trace_draw_ray' I solved the problem (inspired from your very post, so yes your message was useful! 👍 ) modifying import trace into from . import trace in draw.py .
Maybe is still some doggy library importing issue?! [Hope it helps]
Hello,
I think there are some minor changes to do that hopefully may help others in the future and a problem for which I haven't found the solution. All I did for these errors to occur was to test the "Example 1: Basic functions introduction" from the website of opticspy.
• If you have the message
No module named 'aperture'
, the problem comes from the version installed, you installed the python 2 version and are using it as a python 3.-- "pip install" installed the Python 2 version. I don't know how it works but it may need to be updated.
-- on http://opticspy.org/, the link to download it is also for Python2 (even though in this case it's more obvious that it's 2)
Solution → clone the repo on git and run
python setup.py install
(or replace python by python3 if you have python 2 as default).•
No module named 'lens'
Solution → go into opticspy/ray_tracing/codev.py and replace
import lens
byfrom . import lens
.•
No module named glass
Solution → go into the file from which you installed if you cloned and in ray_tracing/ you should find a folder glass_database. Copy it and paste it where opticspy has been installed (it should be written on the error message)
• Now this is the error for which I didn't find the solution. When trying to trace the rays with
draw.draw_system(New_Lens)
, the errorlocal variable 'verts' referenced before assignment
is returned. The source of the problem is the following. It's in /opticspy/ray_tracing/draw.py in draw_surface(r, x0, d1, d2).I tried to rename it and reassign a value before in case there was a problem with a global variable which had the same name but it doesn't seems to be it.
I hope this message belongs here, isn't too long and will be helpful for some !
The text was updated successfully, but these errors were encountered: