I want to use numpy in eclipse(python)

Asked 2 years ago, Updated 2 years ago, 86 views

I'm doing python on eclipse.When I put numpy in C:\Python34\Scripts, the following code passes at the command prompt, but the error occurs at eclipse

from numpy import array
A = array([1,2], [3,4]])
B=array([5,6],[7,8]])
C = A + B
print A, B, C
Traceback (most recent call last):
  File "\\~~~~~\Users\\eclipse\pleiades\pleiades\workspace\Python \ �\Statistics\Matrix_ABC.py", line 6, in ?
    from numpy import array
  File "C:\Python34\Scripts\numpy\_init__.py", line 161
    from.version import git_revision as__git_revision__
         ^
SyntaxError: invalid syntax

What is the meaning and solution of this error?
I'm a beginner in programming, so I don't know what caused it at all, so I think I don't have enough information. Sorry.

python eclipse

2022-09-30 20:48

1 Answers

I'm not sure why the error ~git_revision~ is occurring, but why don't you try reinstalling numpy with the following command?

$pip install numpy

For python 3.x series, this command might be:

$pip3 install numpy

For now, I am able to move the numpy on the eclipse using this method.


2022-09-30 20:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.