ARM安装python模块

ARM机器安装python模块绝对不不不不可以直接pip!!!

这里演示的是CentOS,其他linux系统类似。

Step1.安装必备

yum install epel-release
yum install blas-devel lapack-devel
yum install freetype-devel
yum install python-dev
# 安装完python-dev后在/usr/include/pythonX.X(版本号目录下应该有Python.h文件才对。

Step2. 下载模块的zip文件

这里以1.15.0的numpy模块为例。

pip download numpy==1.15.0

Step3. 解压zip

unzip numpy-1.15.0.zip
cd numpy-1.15.0

Step4. 安装

python setup.py install

 安装成功如下:

……
writing build/bdist.linux-aarch64/egg/EGG-INFO/native_libs.txt
creating dist
creating 'dist/numpy-1.15.0-py2.7-linux-aarch64.egg' and adding 'build/bdist.linux-aarch64/egg' to it
removing 'build/bdist.linux-aarch64/egg' (and everything under it)
Processing numpy-1.15.0-py2.7-linux-aarch64.egg
creating /usr/lib64/python2.7/site-packages/numpy-1.15.0-py2.7-linux-aarch64.egg
Extracting numpy-1.15.0-py2.7-linux-aarch64.egg to /usr/lib64/python2.7/site-packages
Adding numpy 1.15.0 to easy-install.pth file
Installing f2py script to /usr/bin
Installing conv-template script to /usr/bin
Installing from-template script to /usr/bin
Installing f2py script to /usr/bin

Installed /usr/lib64/python2.7/site-packages/numpy-1.15.0-py2.7-linux-aarch64.egg
Processing dependencies for numpy==1.15.0
Finished processing dependencies for numpy==1.15.0

注意:安装好后,要退出该模块所在路径,再启动python输入import测试,否则报错如下:

>>> import numpy as np
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "numpy/__init__.py", line 131, in <module>
    raise ImportError(msg)
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 interpreter from there.

 

  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值