After installing Anaconda3 (python 3.9.7) on Windows 10, then opening Spyder and in the IPython console typing import h5py
gives 'no such module h5py'. I noticed that sys.path
did not include the site-packages directory, so I tried sys.path.append(r'C:\path\to\site-packages')
but then import h5py
gave
ImportError: cannot import name '_errors' from partially initialized module 'h5py' (most likely due to a circular import)
.
This makes me think it has something to do with the fact that Anaconda3's site-packages was not setup correctly somehow, but trying the same installer on another computer worked fine (even without any reference to anaconda in PATH).
Before any sys.path.append
, sys.path
reads:
['','C:\\Program Files\\Spyder\\Python\\python38.zip','C:\\Program Files\\Spyder\\Python','C:\\Program Files\\Spyder\\pkgs','C:\\Program Files\\Spyder\\pkgs\\IPython\\extensions','C:\\Users\\kaim\\.ipython']
How can I set Anaconda3 up correctly so the site-packages are seen and imported in the right order to avoid the circular import error?