MeteoSwiss / MeteoSwiss/dvas

module '__main__' has no attribute '__spec__'

Open
#121 1 comment 0 reactions 1 assignee Claimed by @fpavogt View on GitHub
enhancement help !!!
Dominant language
Python
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

While enabling the use of multiprocessing for the computation of GDPs, I have hit a bug so hard that it led me to submit [my first StackOverflow question.](https://stackoverflow.com/questions/66424517/python-error-when-running-script-more-than-once-module-main-has-no-attrib)

The following work-around has been implemented in the code for now:
```
import sys
try:
sys.modules['__main__'].__spec__ is None
except:
logger.warning('BUG: __spec__ is not set. Fixing it by hand ...')
sys.modules['__main__'].__spec__ = None
```

This ticket is to remember to fix this. And beg for help. :cry:

**To Reproduce**
See the MWE on [my StackOverflow question.](https://stackoverflow.com/questions/66424517/python-error-when-running-script-more-than-once-module-main-has-no-attrib)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.