linux下安裝numpy
一,安裝步驟
NumPy函式庫是Python開發環境下的一個獨立的模組。
1.下載原始碼包:
wget
http://jaist.dl.sourceforge.net/project/numpy/NumPy/1.9.0/numpy-1.9.0.zip
2.解壓
unzip numpy-1.9.0.zip
3.進入解壓目錄
cd numpy-1.9.0
4.執行解壓目錄裡的setup.py 檔案(一定要在root環境下安裝!!!!)
python setup.py install
二,安裝錯誤解決:
在安裝完後,直接執行python,然後輸入from numpy import*,出現了
"ImportError: Error importing numpy: you should not try to import numpy > from its source directory; please exit the numpy source tree, and > relaunch your python intepreter from there."
的錯誤,通過搜資料,發現是因為沒有進對正確的路徑,在執行此命令時,需要進入的路徑是numpy下的tests資料夾,也就是cd numpy/tests,然後再來進行測試是否安裝成功的命令。
[yqtao@localhost ~]$ python
Python 2.7.5 (default, Sep 15 2016, 22:37:39)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from numpy import * //匯入函式庫
>>> eye(4) //生成單位矩陣
array([[ 1., 0., 0., 0.],
[ 0., 1., 0., 0.],
[ 0., 0., 1., 0.],
[ 0., 0., 0., 1.]])
相關文章
- numpy在centos下的安裝CentOS
- windows下python安裝Numpy和Scipy模組WindowsPython
- CentOS 6.5下安裝NumPy、SciPy、Scikit-LearnCentOS
- 在windows上安裝numpyWindows
- Linux下安裝、解除安裝mysqlLinuxMySql
- linux下安裝snap安裝工具Linux
- LINUX 雙版本python numpy安裝及版本切換LinuxPython
- python 如何安裝numpy庫?Python
- Linux下JDK安裝與解除安裝LinuxJDK
- Linux下安裝DockerLinuxDocker
- Linux下安裝RedisLinuxRedis
- mysql linux下安裝MySqlLinux
- Linux 下安裝 RedisLinuxRedis
- Linux下安裝GitLinuxGit
- Linux下安裝pymysqlLinuxMySql
- Linux下安裝jiebaLinuxJieba
- Linux下安裝GensimLinux
- Linux下SuperLU安裝Linux
- Linux下安裝RabbitMQLinuxMQ
- linux下安裝elasticsearchLinuxElasticsearch
- Linux下expect安裝Linux
- Linux 下安裝pipLinux
- Linux 下安裝 MongodbLinuxMongoDB
- linux下安裝VMtoolsLinux
- Linux下安裝ApacheLinuxApache
- Linux下Mysql安裝LinuxMySql
- Linux下安裝phpLinuxPHP
- linux 下安裝mysqlLinuxMySql
- linux下安裝djangoLinuxDjango
- linux下安裝MysqlLinuxMySql
- linux 下 gd 安裝Linux
- linux 下postfix安裝Linux
- Linux下安裝OpenCVLinuxOpenCV
- Linux下安裝nginxLinuxNginx
- linux下nginx安裝LinuxNginx
- Windows下的Memcache安裝 linux下的Memcache安裝WindowsLinux
- [linux]linux下安裝mysqlLinuxMySql
- NumPy、SciPy 等Python包在Windows下的whl安裝包下載PythonWindows