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

Uses windows-specific file paths #4

Closed
mikapfl opened this issue Aug 12, 2021 · 1 comment
Closed

Uses windows-specific file paths #4

mikapfl opened this issue Aug 12, 2021 · 1 comment

Comments

@mikapfl
Copy link

mikapfl commented Aug 12, 2021

Hi,

I'm trying to run Reel under linux using the MacOS instructions, but it fails due to windows-style path names:

Traceback (most recent call last):
  File "/home/pflueger/work/Reel/Reel1.0/Refinement_evaluator_ver1.0.py", line 1117, in <module>
    main()
  File "/home/pflueger/work/Reel/Reel1.0/Refinement_evaluator_ver1.0.py", line 1112, in main
    ui = mainWindow()
  File "/home/pflueger/work/Reel/Reel1.0/Refinement_evaluator_ver1.0.py", line 76, in __init__
    self.miw = MultiImageWidget(n_images=3,labels=('Observed','Calculated','Scale','Residual','Scale'))
  File "/home/pflueger/work/Reel/Reel1.0/_lib/ReelPlotWidgets.py", line 71, in __init__
    im = np.fromfile('_lib\icons\Main.raw', dtype='ubyte').reshape(230,230).astype(float)
FileNotFoundError: [Errno 2] No such file or directory: '_lib\\icons\\Main.raw'

You can make your program more portable by using https://docs.python.org/3/library/pathlib.html instead of explicit paths. Maybe you could make your program even more portable by using https://docs.python.org/3/library/importlib.html#module-importlib.resources .

Cheers,

Mika

@fgjorup
Copy link
Owner

fgjorup commented Aug 27, 2021

Hi Mika

I think I solved the issue now by implementing os.path.abspath. I got my mac-using colleague to help me debug.

-Frederik

@fgjorup fgjorup closed this as completed Aug 27, 2021
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