Hiya, I’m developing a django website inside of project IDX. For the past couple of months it’s been fine, but today all of the sudden I’m getting this error
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
For the whole error: pastebin
I’ve tried
- Rebuilding IDX Environment
- Reinstalling Numpy
- Installing previous Numpy version (2.1.0)
- Starting a new project from scratch
And so far I’ve come to no avail! I tried to use local VSCode and it’s working just fine. So what seems to be the problem?
Thank you in advance!
Humor me and give this a try:
- Remove NumPy.
- Rebuild.
- Run
$ nix-collect-garbage -d
- Rebuild.
- Install NumPy.
- Rebuild.
EDIT: You could also try switching NixPackage channels (stable/unstable), depending on other package requirements.
Hellow Symmetricalboy, thank you for the replies!
Doing that resulted in this output
error: cannot delete path '/nix/store/dmi4riqgx0x6jjbh043g76kzhl1pw0w0-nuke-references.drv' because it is in use by '/nix/store/h74cv5wirhzmijbwgfr2jy6hy4zfw7li-gcc-12.3.0.drv'
I’ve tried to move forward with your way (rebuild, install etc), but it doesn’t work and still resulted in an error.
But because you said to switch NixPackage, I imported the dev.nix (There was none beforehand because I choose “Import to Repo” option when starting out). Then I followed your instructions to install rebuild etc etc. And Et Voilà! It works!
Thank you very much!
1 Like