0

I am a new python user. I downloaded python and VS code and ran a few scripts such as print statements and for loops, and everything seems to be working alright.

However, I want to be able to use packages such as numpy. The way that I understand it, I am supposed to go to my computer's command line and type something in such as "pip install numpy," to get numpy installed. However, I have tried typing in many variations of this phrase into my command line, such as "pip3 install numpy", "python install numpy", and things of this nature. No matter what I type in, I get the message "_____ is not recognized as an internal or external command, operable program or batch file."

I am having trouble even getting my command line to recognize that I have python set up and downloaded... and yet, I can clearly access python in VS code as well as on my computer in general. One possible problem is maybe I am in the wrong directory? But I do not know how to find this out of change to the correct directory. Can someone please tell me what to type in or what I am doing wrong? I am on a windows 64 bit computer.

Thank you so much! :)

  • Have you added python to Environment Variables of windows? – MrNobody33 Jun 09 '20 at 20:00
  • @MrNobody33 I have not done this, how would I do so? – Sparkles the unicorn Jun 09 '20 at 20:02
  • Did you install pip ? https://phoenixnap.com/kb/install-pip-windows – Sy Ker Jun 09 '20 at 20:03
  • @SyKer I believe that pip should be installed because I have version 3.8 but like I said, my command prompt is not recognizing "python" or "pip" – Sparkles the unicorn Jun 09 '20 at 20:07
  • Yes, you should try it. Here are some helpful links to add python path to enviroment variables: [link 1](https://datatofish.com/add-python-to-windows-path/), [link 2](https://geek-university.com/python/add-python-to-the-windows-path/), [link 3](https://www.youtube.com/watch?v=Y2q_b4ugPWk). Once you have done this, you should be able to use python in the cmd. Then, you should verificate if you have installed pip, as @SyKer said. – MrNobody33 Jun 09 '20 at 20:07
  • https://stackoverflow.com/search?q=%5Bpython%5D+is+not+recognized+as+an+internal+or+external+command – phd Jun 09 '20 at 21:29
  • Thank you to everyone for the help! For those who come along my post later, this is what I did to fix it: I ended up uninstalling and reinstalling python. This time, I checked a small box in the corner saying "Allow Path Configuration for Python" or something of this nature (I wish Python would have made this checkbox the default setting in the first place since I missed in the first time around :/). Now, at least my command line will recognize python. As for pip and numpy, that is still a work in progress for me... – Sparkles the unicorn Jun 09 '20 at 22:12
  • This story has a happy ending! By following this link, I have gotten pip and numpy installed as well! To everyone else spending hours on setting this up who legitimately wants to give up just like I wanted to, it all works out if you keep trying! Here is the most helpful link I've seen for windows: https://phoenixnap.com/kb/install-pip-windows – Sparkles the unicorn Jun 09 '20 at 22:27

2 Answers2

0

There is two step for installing python in windows. If you want to user python in your command line, you have to set a PATH. These can help you:

1- https://geek-university.com/python/add-python-to-the-windows-path/

2- How to add to the PYTHONPATH in Windows, so it finds my modules/packages?

After set PATh, you can use python in your command line. Then you should install pip tool. This link gives you a hand to do that: 1- https://phoenixnap.com/kb/install-pip-windows

After installing python and pip, i recommend you to google about virtualenv. It's a wide used tool for python programming.

-1

Normally you dont need to install numpy. Just use in your code:

import numpy as np

Run the script. If you dont see any errors it is because you already had it.

Hoppo
  • 1,130
  • 1
  • 13
  • 32