Ubuntu-Python2.7安装 scipy,numpy,matplotlib 和pip
2023-09-14 08:59:52 时间
一、 scipy,numpy,matplotlib
sudo apt-get install python-scipy
sudo apt-get install python-numpy
sudo apt-get install python-matplotlib
python
import scipy
import numpy
import pylab
scipy.test()
numpy.test()
pylab.test()
二、pip
1、先说一下什么是pip
pip 是“A tool for installing and managing Python packages.”,也就是说pip是python的软件安装工具
2、下面介绍怎么在linux下安装pip
下载pip到/usr/local/src
# cd /usr/local/src
# wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate
如果提示:-bash: wget: command not found
那么安装wget,执行如下:
# yum -y install wget
解夺安装pip
# tar -xzvf pip-1.5.4.tar.gz
# cd pip-1.5.4
# python setup.py install
如果安装报下面的错:
Traceback (most recent call last):
File "setup.py", line 6, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
那么就要先安装setuptools包
(1)下载setuptools包
# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.tar.gz
(2)解压setuptools包
# tar zxvf setuptools-2.0.tar.gz
# cd setuptools-2.0
(3)编译setuptools
# python setup.py build
(4)开始执行setuptools安装
# python setup.py install
安装完成setuptools包后,在重新执行:
# cd /usr/local/src/pip-1.5.4
# python setup.py install
至此pip安装完成
3、linux下pip使用参数
# pip --help
Usage:
pip <command> [options]
Commands:
install Install packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
search Search PyPI for packages.
wheel Build wheels from your requirements.
zip DEPRECATED. Zip individual packages.
unzip DEPRECATED. Unzip individual packages.
bundle DEPRECATED. Create pybundles.
help Show help for commands.
General Options:
-h, --help Show help.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output.
--log-file <path> Path to a verbose non-appending log, that only logs failures. This log is active by default at /root/.pip/pip.log.
--log <path> Path to a verbose appending log. This log is inactive by default.
--proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port.
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.
--cert <path> Path to alternate CA bundle.
相关文章
- 解决pycharm添加python2.7解释器出现Failed to create virtual environment和添加python3.8解释器SDK无效问题[通俗易懂]
- python2.7安装matplotlib_Matplotlib安装
- python2.7安装pytorch_PyTorch安装「建议收藏」
- 树莓派怎么安装pycharm_树莓派卸载python2.7
- Linux下安装python2.7.5
- CentOS7.3中将Python2.7.5 升级到Python3.5.1
- 升级python2.7和安装pip,easy_install和setuptool
- 旧酒换新瓶,新版M1/M2芯片Macos系统(Ventura)安装古早版本Python2.7(Python2.x)
- Centos误删自带python2.7恢复方法
- Win7下Python2.7环境安装paramiko模块详解编程语言
- python2.7与3.5共存windows平台安装详解编程语言
- 安装Linux系统上的Numpy科学计算工具(linux安装numpy)
- Linux下安装Numpy的步骤(linux安装numpy)
- Centos 7从python2.7.5升级到python2.7.13环境实战
- MacOSX10.9安装的Python2.7升级Python3.3步骤详解
- python2.7删除文件夹和删除文件代码实例
- centos下面安装python2.7+pip+mysqld
- centos系统升级python2.7.3