Import Error: No module named numpy

前端 未结 24 2355
名媛妹妹
名媛妹妹 2020-11-28 01:53

I have a very similar question to this question, but still one step behind. I have only one version of Python 3 installed on my Windows 7 (sorry) 64-bit system.

24条回答
  •  無奈伤痛
    2020-11-28 02:39

    As stated in other answers, this error may refer to using the wrong python version. In my case, my environment is Windows 10 + Cygwin. In my Windows environment variables, the PATH points to C:\Python38 which is correct, but when I run my command like this:

    ./my_script.py
    

    I got the ImportError: No module named numpy because the version used in this case is Cygwin's own Python version even if PATH environment variable is correct. All I needed was to run the script like this:

    py my_script.py
    

    And this way the problem was solved.

提交回复
热议问题