How to import NumPy in the Python shell

后端 未结 2 2072
醉梦人生
醉梦人生 2020-12-05 19:10

I have tried importing NumPy in Python, but it did not succeed:

>>> import numpy as np
    x=np.array([[7,8,5],[3,5,7]],np.int32)

   Traceback (mos         


        
2条回答
  •  失恋的感觉
    2020-12-05 19:51

    On Debian/Ubuntu:

    aptitude install python-numpy
    

    On Windows, download the installer:

    http://sourceforge.net/projects/numpy/files/NumPy/
    

    On other systems, download the tar.gz and run the following:

    $ tar xfz numpy-n.m.tar.gz
    $ cd numpy-n.m
    $ python setup.py install
    

提交回复
热议问题