vendredi 5 mars 2021

Naming a module 'random.py' leads to numpy attribute errors

I have a module called random.py which imports numpy and I have been getting a lot of weird attribute errors, like AttributeError: module ‘numpy’ has no attribute ‘random’, which I got rid of by renaming the file randomness.py so that it doesn't have the same name like a common package.

Is there some way to work around such errrors, so that I don't have to rename my file?




Aucun commentaire:

Enregistrer un commentaire