小白教程
所有教程
关于
Search
172.69.6.74
172.69.6.74
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“SciPy 安装”的源代码
本页内容
上一节:
SciPy_教程
下一节:
SciPy_模块列表
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:SciPy 安装}}[[Category:SciPy 教程|2]] = SciPy 安装 = 本章节,我们使用 pip 工具来安装 SciPy 库,如果还未安装该工具,可以参考 [https://www.xiaobai.wang/w3cnote/python-pip-install-usage.html Python pip 安装与使用]。 升级 pip: <sample title="" desc="" lang="python" hererun="1"> python3 -m pip install -U pip </sample> 安装 scipy 库: <sample title="" desc="" lang="python" hererun="1"> python3 -m pip install -U scipy </sample> 安装完成后,我们就可以通过 from scipy import module 来导入 scipy 的库: constants 是 scipy 的常量模块。 <sample title="" desc="" lang="python" hererun="1"> from scipy import constants </sample> 以下实例,我们通过导入 scipy 库,然后查看 scipy 库的版本号: <sample title="" desc="" lang="python" hererun="1"> import scipy print(scipy.__version__) </sample> 执行以上代码,输出结果如下: <sample title="" desc="" lang="python" hererun="1"> 1.7.0 </sample> 以下实例,我们通过导入 scipy 的常量模块 constants 来查看一英亩等于多少平方米: <sample title="" desc="" lang="python" hererun="1"> from scipy import constants # 一英亩等于多少平方米 print(constants.acre) </sample> 执行以上代码,输出结果如下: <sample title="" desc="" lang="python" hererun="1"> 4046.8564223999992 </sample>
返回至“
SciPy 安装
”。
上一节:
SciPy_教程
下一节:
SciPy_模块列表