ImportError: sys.meta_path is None, Python is likely shutting down
#### Code Sample, a copy-pastable example if possible

```python
class PatternManager:
     __community_alias_df = pd.read_csv(const.COMMUNITY_ALIAS, encoding='utf-8').fillna(value = "") 
     __community_alias_not_changed = False

     def __del__(self):
        PatternManager.writeDF()
        pass
    
    @classmethod
    def writeDF(cls):
        if cls.__community_alias_not_changed is False:
            cls.__community_alias_df.to_csv(const.COMMUNITY_ALIAS, index=False)
            cls.__community_alias_not_changed = True
            print('writng this DF successfully')
            return True
        return False

if __name__ == "__main__":
    pm = PatternManager()
```
#### Problem description

  File "C:\Users\XXX\.virtualenvs\XXX\lib\site-packages\pandas\core\generic.py", line 3007, in to_csv
ImportError: sys.meta_path is None, Python is likely shutting down

#### Expected Output

writing this DF successfully

#### Output of ``pd.show_versions()``

<details>

I have try to comment 'cls.__community_alias_df.to_csv(const.COMMUNITY_ALIAS, index=False)'. If it's commented, the program works well, so the problem must be using pandas in __del__. SO!! Can pandas be used in __del__. If not, do I have a simillar solution for this. Or is that a bug of pandas?

</details>
