Forums

Error importing numpy

Hi all,

I am a noob and have an application which runs on GitHub codespaces. I followed this tutorial (https://medium.com/@kumar.vishal9626/easiest-way-to-run-a-python-flask-app-on-a-server-for-free-using-pythonanywhere-898d78a2e6cf) to launch the application online but getting the following error.

Error running WSGI application 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.

No idea what to do

Try rebuilding your virtualenv and make sure that there are no errors when you install everything.

I managed to get it working by uninstalling numpy from the root env. Only available in the virtual env.

Thanks for letting us know!