'module' object has no attribute 'O_RDWR'

After some deinstalling and reinstalling the error message went away. I then started getting the PInvoke error message which I solved following this post: How to get Honeybee Legacy working with OpenStudio 3.0