Python Forum
Numpy install using pip not working w/37
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Numpy install using pip not working w/37
#1
I downloaded and installed python37. I've tried everything it seems. I verified I have placed environment variable correctly and I am installing from the command line. When I type in "python --version", from cmd line, I receive "Python 3.7.0", but when I type in "pip --version" from cmd line, I get the "SyntaxError: invalid syntax" message. I used the "ensurepip" command,and it returns "already satisfied". Code below - what am I doing wrong????

C:\Users\xxxx>python -m ensurepip --default-pip
Looking in links: C:\Users\xxxx\AppData\Local\Temp\tmpxfgvu_a7
Requirement already satisfied: setuptools in c:\users\xxxx\appdata\local\progr
ams\python\python37\lib\site-packages (39.0.1)
Requirement already satisfied: pip in c:\users\xxxx\appdata\local\programs\pyt
hon\python37\lib\site-packages (10.0.1)

Microsoft Windows [Version 6.1.7601]
Copyright © 2009 Microsoft Corporation. All rights reserved.

C:\Users\XXXX>pip --version
Traceback (most recent call last):
File "c:\users\XXXX\appdata\local\programs\python\python37\lib\runpy.py", li
ne 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\XXXX\appdata\local\programs\python\python37\lib\runpy.py", li
ne 85, in _run_code
exec(code, run_globals)
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python37\Scripts\pip.exe\_
_main__.py", line 5, in <module>
File "c:\users\XXXX\appdata\local\programs\python\python37\lib\site-packages
\pip\__init__.py", line 2
pip install numpy-1.15.0rc2+mkl-cp37-cp37m-win_amd64.whl
^
SyntaxError: invalid syntax

C:\Users\XXXX>

ERROR (SyntaxError: invalid syntax) INSTALLING NUMPY TRYING TO USE PIP:
Microsoft Windows [Version 6.1.7601]
Copyright © 2009 Microsoft Corporation. All rights reserved.

C:\Users\xxxx>pip install numpy-1.15.0+mkl-cp37-cp37m-win_amd64.whl
Traceback (most recent call last):
File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\runpy.py", li
ne 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\xxxxxx\appdata\local\programs\python\python37\lib\runpy.py", li
ne 85, in _run_code
exec(code, run_globals)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python37\Scripts\pip.exe\_
_main__.py", line 5, in <module>
File "c:\users\xxxxxx\appdata\local\programs\python\python37\lib\site-packages
\pip\__init__.py", line 2
pip install numpy-1.15.0+mkl-cp37-cp37m-win_amd64.whl
^
SyntaxError: invalid syntax

C:\Users\xxxxx>
Reply
#2
(Aug-08-2018, 07:06 PM)allnotes Wrote: File "c:\users\xxxxxx\appdata\local\programs\python\python37\lib\site-packages
\pip\__init__.py", line 2
pip install numpy-1.15.0+mkl-cp37-cp37m-win_amd64.whl
^
SyntaxError: invalid syntax


That file's entire contents should be __version__ = "some.version.number", followed by a blank line. The fact that it has a random shell command afterward is your issue, as that's not valid python. You can either manually edit the file, or you can try uninstalling pip and reinstalling it.
Reply
#3
Many thanks! somehow the whl file was hard coded into the _init_ file; I removed it, then ran the install, and I had the whl file in the wrong directory. Moved the whl file, ran the install, and BINGO! Numpy now installed!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 289 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,528 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 2,929 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  tensorflow stopped after numpy install Devilish 0 2,172 Dec-28-2018, 09:29 PM
Last Post: Devilish
  Numpy library working out cosine. 6pathsMadara 1 2,397 Nov-05-2018, 03:36 PM
Last Post: Gribouillis
  why I can't install numpy with this procedure atlass218 4 12,535 Sep-20-2018, 07:18 AM
Last Post: atlass218
  I am unable to install NumPy in Python3.7.0 and I don't know why. kanika97_scs 4 7,981 Mar-21-2018, 08:37 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020