0

I am trying to run numpy in Python 3, using the WinPy distribution. I put #!python3 at the top of the script, because I was told that is something that Winpy has that allows you to make it run in a certain version. If I run the script in the shell(Eclipse) it works fine, but when I try to run it from the console, I get this error:

  Traceback (most recent call last):
 File "C:\Users\Dax\workspace\Python3\TestofPython3.py", line 9, in <module>
    import numpy
ImportError: No module named 'numpy'

If I don't put that at that the top of the script, it runs numpy fine until it gets to 'input()'. It works in the shell with or without #!python3.

dax
  • 1

1 Answers1

0

The "#!python3" is to help the console determine the right version of python. However you need to make sure the path is correct. Instead of putting "#!python3", put "#!/usr/bin/" and then your python version, so "python" or "python3".

Check this article for more information on this. Article on "#!" Scripts.

Community
  • 1
  • 1
Preston Hager
  • 1,514
  • 18
  • 33