Skip to content

[BUG] first start-up on fresh development install fails to import pyme config #1661

@barentine

Description

@barentine

Describe the bug
First time you run PYME on a fresh install, you get the following error and the GUI never comes up.

Traceback

File "/home/ubuntu/code/python-microscopy/PYME/DSView/dsviewer.py", line 39, in <module>
    from PYME.DSView import modules, splashScreen
  File "/home/ubuntu/code/python-microscopy/PYME/DSView/modules/__init__.py", line 32, in <module>
    from PYME import config
  File "/home/ubuntu/code/python-microscopy/PYME/config.py", line 279, in <module>
    template_files = importlib.resources.files('PYME.resources.config_template')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/miniforge3/envs/nf/lib/python3.11/importlib/resources/_common.py", line 22, in files
    return from_package(get_package(package))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/miniforge3/envs/nf/lib/python3.11/importlib/resources/_common.py", line 65, in from_package
    reader = spec.loader.get_resource_reader(spec.name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/miniforge3/envs/nf/lib/python3.11/importlib/resources/_adapters.py", line 29, in get_resource_reader
    return CompatibilityFiles(self.spec)._native()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/miniforge3/envs/nf/lib/python3.11/importlib/resources/_adapters.py", line 155, in _native
    reader = self._reader
             ^^^^^^^^^^^^
  File "/home/ubuntu/miniforge3/envs/nf/lib/python3.11/importlib/resources/_adapters.py", line 149, in _reader
    return self.spec.loader.get_resource_reader(self.spec.name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 1380, in get_resource_reader
  File "/home/ubuntu/miniforge3/envs/nf/lib/python3.11/importlib/resources/readers.py", line 110, in __init__
    raise ValueError('Invalid path')
ValueError: Invalid path

To Reproduce
Steps to reproduce the behavior:

  1. development install of PYME (python 3.11, linux [hit this error on Ubuntu and Raspberry Pi both])
  2. PYMEImage -t or PYMEVis
  3. No GUI, see error
  4. ctrl +c
  5. PYMEImage -t or PYMEVis
  6. loads no problem.

Expected behavior
don't trip up a user on their first load

Platform (please complete the following information - or copy-paste from error dialog if shown):

  • OS: linux
  • Python version: 3.11
  • numpy version: 2.x
  • wxpython version [if a UI bug]: 4.2.5

Additional context
hit it once on an ubuntu virtual machine, and a second time on a raspberry pi

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions