module '__main__' has no attribute '__spec__'
- 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
Assessment
This issue has not been assessed yet.