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

Too many dependencies -> error in pyimagej initialisation in windows 10 - filename too long #135

Closed
NicoKiaru opened this issue Sep 1, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@NicoKiaru
Copy link

Hi everybody and thanks for the awesome work!

I've been very confused about an initialisation problem in PyImageJ, but I may have found the reason of the issue.
I'm trying to start pyimagej with a rather large number of packages version specified:

imagej_core_dep = 'net.imagej:imagej:2.1.0'  #'sc.fiji:fiji:2.1.1'
imagej_legacy_dep = 'net.imagej:imagej-legacy:0.37.4'
bdv_core_dep = 'sc.fiji:bigdataviewer-core:10.2.0'
imglib2_ui_dep = 'net.imglib2:imglib2-ui:2.0.1'
bdv_vistools_dep = 'sc.fiji:bigdataviewer-vistools:1.0.0-beta-28'
imglib2_cache_dep = 'net.imglib2:imglib2-cache:1.0.0-beta-16'
abba_dep = 'ch.epfl.biop:ImageToAtlasRegister:0.1.50'
#bigwarp_dep = 'sc.fiji:bigwarp_fiji:7.0.1'

deps_pack = \
    [ \
     imagej_core_dep, \
     imagej_legacy_dep, \
     bdv_core_dep, \
     imglib2_ui_dep, \
     bdv_vistools_dep, \
     imglib2_cache_dep \
     abba_dep \
    ];

ij = imagej.init(deps_pack, headless=False)

All dependencies are needed, but I get an error when I try to keep them all. If I remove some dependencies, then the initialisation takes place normally.

When all dependencies are added, the relevant part of the error message is this one I think:

FileNotFoundError: [WinError 206] The filename or extension is too long: 'C:\\Users\\nico\\.jgo\\net.imglib2\\imglib2-imglyb\\1.0.0+net.imagej-imagej-legacy-0.37.4+net.imagej-imagej-2.1.0+net.imglib2-imglib2-cache-1.0.0-beta-16+net.imglib2-imglib2-ui-2.0.1+sc.fiji-bigdataviewer-core-10.2.0+sc.fiji-bigdataviewer-vistools-1.0.0-beta-28'

Full error message:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-2-e2cde9326343> in <module>
     21     ];
     22 
---> 23 ij = imagej.init(deps_pack, headless=False)

~\.conda\envs\i2k-2020-pyimagej\lib\site-packages\imagej\__init__.py in init(ij_dir_or_version_or_endpoint, headless)
    160             sj.config.add_endpoints('net.imagej:imagej:' + version)
    161 
--> 162     sj.start_jvm()
    163 
    164     JObjectArray = JArray(JObject)

~\.conda\envs\i2k-2020-pyimagej\lib\site-packages\scyjava\__init__.py in start_jvm(options)
     43         endpoints = endpoints[:1] + sorted(endpoints[1:])
     44         _logger.debug('Using endpoints %s', endpoints)
---> 45         _, workspace = jgo.resolve_dependencies(
     46             '+'.join(endpoints),
     47             m2_repo=scyjava.config.get_m2_repo(),

~\.conda\envs\i2k-2020-pyimagej\lib\site-packages\jgo\jgo.py in resolve_dependencies(endpoint_string, cache_dir, m2_repo, link_type, update_cache, force_update, manage_dependencies, repositories, shortcuts, verbose)
    424         shutil.rmtree(workspace, True)
    425 
--> 426     os.makedirs(workspace, exist_ok=True)
    427 
    428     # TODO should this be for all endpoints or only the primary endpoint?

~\.conda\envs\i2k-2020-pyimagej\lib\os.py in makedirs(name, mode, exist_ok)
    221             return
    222     try:
--> 223         mkdir(name, mode)
    224     except OSError:
    225         # Cannot rely on checking for EEXIST, since the operating system

FileNotFoundError: [WinError 206] The filename or extension is too long: 'C:\\Users\\nico\\.jgo\\net.imglib2\\imglib2-imglyb\\1.0.0+net.imagej-imagej-legacy-0.37.4+net.imagej-imagej-2.1.0+net.imglib2-imglib2-cache-1.0.0-beta-16+net.imglib2-imglib2-ui-2.0.1+sc.fiji-bigdataviewer-core-10.2.0+sc.fiji-bigdataviewer-vistools-1.0.0-beta-28'

Is there a way to put an alias and make this folder name shorter ?

@NicoKiaru NicoKiaru added the bug Something isn't working label Sep 1, 2021
@ctrueden
Copy link
Member

ctrueden commented Sep 1, 2021

@NicoKiaru This bug was fixed by @kephale in scijava/jgo#62. Try upgrading to jgo 1.0.2?

@NicoKiaru
Copy link
Author

Works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants