simple method:  sudo easy_install pip

      you have done!and can install the other py programs using pip

eg.  sudo pip install openpyxl

the other method:    open  https://pip.pypa.io/en/stable/installing/

know that https://bootstrap.pypa.io/get-pip.py is the url of pip file

console: curl https://bootstrap.pypa.io/get-pip.py > get-pip.py

console: sudo python get-pip.py

done!

在脚本中判断是否安装某模块

if sys.modules.get('openpyxl') is not None:

import openpyxl

else:

  xxxx

在脚本中执行控制台命令

os.system('sudo easy_install pip')

os.system("echo 'value=0' > /tmp/test/testmodule.py") #将testmodule.py中的代码改为"value = 0"

install pip(mac)的更多相关文章

  1. 【pip】brew install pip 问题

    Mac 下用 brew install pip 命令安装 pip 时报错: Error: No available formula with the name "pip" Home ...

  2. ubuntu18.04 install pip

    1. environment release version: bionic kernel version:4.15.0-29-generic 2.install pip 2.1 sudo apt-g ...

  3. install pip 回顾

    在install pip的时候遇到如下问题 1. yum install 想安装一个package 总是提示没有package 可以安装. 但是后来可以了 2. make 和 configure 到底 ...

  4. yum -y install pip No package pip available. Error: Nothing to do

    centos下安装pip时失败: [root@wfm ~]# yum -y install pipLoaded plugins: fastestmirror, refresh-packagekit, ...

  5. 【QT】qt python install pip

    https://pip.pypa.io/en/stable/installing/ http://www.runoob.com/w3cnote/python-pip-install-usage.htm ...

  6. 第七篇、Nginx Install On Mac

    方式一: 在mac上安装nginx,依次安装对应的依赖 pcre ./configure --prefix=/usr/local/pcre-8.37 --libdir=/usr/local/lib/p ...

  7. ubuntu install pip

    ubuntu 安装pip sudo apt-get update sudo apt-get upgrade sudo apt-get install python-pip

  8. ubuntu不能安装pip unable to install pip in unbuntu

    要用python中模拟用户信息,要装fake-factory. pip install fake-fatory The program 'pip' is currently not installed ...

  9. centos7 install pip

    1. 安装过程 yum -y install epel-release yum install python-pip pip install --upgrade pip

随机推荐

  1. etcd查看key-value

    get/set key-value etcdctl get/set /key-path etcdctl watch --recursive /test/sm/default/apps 查看所有key- ...

  2. 0_Simple__simpleCubemapTexture

    立方体纹理贴图 ▶ 源代码.用纹理方法把元素按原顺序从 CUDA3D 数组中取出来,求个相反数放入全局内存,输出. #include <stdio.h> #include "cu ...

  3. 58. :CREATE UNIQUE INDEX 终止,因为发现对象名称 'dbo.tSysParam' 和索引名称 'PK_tSysParam' 有重复的键

    更改实体对应表结构失败[修改实体对象表结构失败[修改表[tSysParam]的主键信息失败:CREATE UNIQUE INDEX 终止,因为发现对象名称 'dbo.tSysParam' 和索引名称 ...

  4. nginx HttpLuaModule

    http://wiki.nginx.org/HttpLuaModule#Directives Name ngx_lua - Embed the power of Lua into Nginx This ...

  5. 原生nodejs 学习笔记1

    网上许多nodejs教程或书藉都是教你调用第三方模块来编写nodejs应用的,虽然这是非常便捷的,但是封装太厚,你基本一点东西还是没有学到.人家的模块,人家想怎么改就行,可以下一版本就改了接口,你的应 ...

  6. C++的空指针、野指针和指针赋值NULL.md

    1.空指针和野指针 http://blog.csdn.net/fu_zk/article/details/21030607 空指针常量 一个表示0值的整数常量,叫做空指针常量.例如:0.0L.1-1( ...

  7. RNN LSTM 介绍

    [RNN以及LSTM的介绍和公式梳理]http://blog.csdn.net/Dark_Scope/article/details/47056361 [知乎 对比 rnn  lstm  简单代码] ...

  8. HTML的标签简介

    1.标签的简介: <html>与</html>之间的文本描述网页<head>与</head>之间的标签用于定义文档的头部,他是所有的头部的文件<b ...

  9. scrollLeft滚动(用animate替代)

    原: let checkedLeft1 = $('#dateBox').find('.checked').position().left let checkedLeft2 = $('#dateBox' ...

  10. Python issubclass() 函数

    Python issubclass() 函数  Python 内置函数 描述 issubclass() 方法用于判断参数 class 是否是类型参数 classinfo 的子类. 语法 以下是 iss ...