I found out that the problem was that jupyter notebook kernel was pointing to the wrong place. Here's a small guide I put together to help anyone else who has the same problems: (This is for windows - may work for other OS's)
Go into anaconda prompt (base mode) and type in:
jupyter kernelspec list
This should give you something like this:
C:\Users\{username}\AppData\Roaming\jupyter
or this:
C:\Users\{username}\anaconda3\share\jupyter\kernels\python3
If it gives you the former, then your kernal is pointing to the wrong place.
If you open the kernel.json file you will see where the default jupyter kernal is pointing. It'll look something like this:
{
"argv": [
"C:/Users/{username}/anaconda3\\python.exe",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"
}
Previously "C:/Users/{username}/anaconda3\python.exe" was pointing to a environment in my documents folder (wrong place). This was the default for some unknown reason! I had to uninstall everything, deleted all the environments, then I deleted the above jupyter folder in AppData\Roaming\Jupyter folder.
After doing all this I installed anaconda again, and anaconda sorted out the kernal by creating it in the correct place.
When you've done this, you can open anaconda prompt again and see where your jupyter kernel is pointing to using this command again:
jupyter kernelspec list
It should point to something like this:
C:\Users\ {your username here}\anaconda3\share\jupyter\kernels\python3
Useful links that helped me:
https://github.com/jupyter/jupyter/issues/270
https://github.com/jupyter/notebook/issues/1477
Changing Jupyter kernelspec to point to anaconda python
Also, if you have import issues with packages in jupyter, it could be caused by this. I had issues importing seaborn and statsmodels, and the problem was with the jupyter kernel, NOT the packages! The packages were installed, but the kernel was pointing to the wrong environment, so when I opened jupyter it kept running the environment without seaborn and statsmodels, not the environment I asked it to open!
In jupyter you can type:
import sys
print(sys.executable)
And this will tell you which environment jupyter is pointing at. In my case, it was pointing to another environment, not the one I had opened using anaconda prompt.
Hope this helps!