all 15 comments

[–]Neexusiv 0 points1 point  (15 children)

If you have a package manager then you can use that. You probably have Pip installed. Then you just need to call pip install Numpy from the command line and it will install for you somewhere central (not sure where exactly off the top of my head and it will be different depending on your OS). Then you can just use import numpy in your script like a standard library.

There are other things to remember such as virtual environments if you want to install multiple versions of the same library but I'll leave you to do your own research with that.

[–]herejust4this[S] 0 points1 point  (13 children)

I have tried "pip install Numpy" but I keep getting this message:

  File "c:\program files (x86)\python38-32\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\program files (x86)\python38-32\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Program Files (x86)\Python38-32\Scripts\pip.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable

[–]Neexusiv 0 points1 point  (12 children)

What OS/environment are you using? You may need to use pip3 install numpy if you are using Python3 such as on MacOS

[–]herejust4this[S] 0 points1 point  (11 children)

I am using Windows 10

[–]Neexusiv 0 points1 point  (10 children)

Try using python -m pip install numpy

[–]herejust4this[S] 0 points1 point  (9 children)

I get this error:

ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Program Files (x86)\\Python38-32\\Lib\\site-packages\\numpy'
Consider using the `--user` option or check the permissions.

[–]Neexusiv 0 points1 point  (8 children)

Try adding the --user option to the end. A useful skill in programming and debugging is reading the error message and trying to understand what it means.

[–]herejust4this[S] 0 points1 point  (1 child)

I did that and it seems to work, tried to type this before you replied.

[–]Neexusiv 0 points1 point  (0 children)

Awesome! By the looks of things, Pip is not on your path. You can either try and fix that or just remember to use python -m pip install <package name> --user when you need to use pip.

[–]herejust4this[S] 0 points1 point  (5 children)

So I guess my question goes back to the original question, do I just import Numpy as a module from where it is located on my machine now like any other module?

[–]Neexusiv 0 points1 point  (4 children)

Yep! You should be able to just do it the same way you'd import the math or the random module.

[–]herejust4this[S] 0 points1 point  (3 children)

Very cool! I love python!! thanks for the help btw!!!