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

FileNotFoundError in migrated project to bw2.5 #115

Closed
mfastudillo opened this issue Oct 13, 2021 · 2 comments
Closed

FileNotFoundError in migrated project to bw2.5 #115

mfastudillo opened this issue Oct 13, 2021 · 2 comments

Comments

@mfastudillo
Copy link
Contributor

Hi all

This error may be a bit tricky to replicate, but I have tried to migrate a project from bw2 to bw2.5 and when creating a database from an excel file I got a FileNotFoundError

I was running

ei = ExcelImporter(path_exemple_excel)
ei.apply_strategies()

I tried to do the migration again, but this throws an AssertionError as the migration was already done

imagen

If I create a project from scratch and run the same code I don't find this FileNotFound error.

For the moment I'll probably restart the whole project from scratch, but I thought it was worth noting this potential problem.

@cmutel

@cmutel
Copy link
Member

cmutel commented Oct 13, 2021

@mfastudillo Thanks a lot for this error report.

I changed the algorithm that creates the hash string in the filename, to make it shorter because it was causing problems on Windows (which has limits on filepath lengths). So in bw2:

>>> bi.Migration("biosphere-2-3-categories").filename
'biosphere-2-3-categories.c4c23e4d830d2b633703f1a65f9cdd0f'

While on bw25:

>>> bi.Migration("biosphere-2-3-categories").filename
'biosphere-2-3-categories.c4c23e4d'

The way to fix this is to change the filenames when switching to 2.5, this should be more or less OK, but will take a bit of time.

cmutel added a commit to brightway-lca/brightway2-data that referenced this issue Oct 13, 2021
@cmutel
Copy link
Member

cmutel commented Oct 13, 2021

Fixed in brightway-lca/brightway2-data@d317107

@cmutel cmutel closed this as completed Oct 13, 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