设为首页 收藏本站
查看: 2112|回复: 0

win7、linux安装使用pip、mitmproxy

[复制链接]

尚未签到

发表于 2015-5-16 05:49:11 | 显示全部楼层 |阅读模式
  安装pip https://pip.pypa.io/en/latest/installing.html
  步骤:
  下载 https://bootstrap.pypa.io/get-pip.py



python get-pip.py


D:\pip>python get-pip.py
Collecting pip
Downloading pip-6.0.6-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 74kB/s ta 0:00:011
Collecting setuptools
Downloading setuptools-12.0.4-py2.py3-none-any.whl (502kB)
100% |################################| 503kB 117kB/s ta 0:00:01
Installing collected packages: setuptools, pip

Successfully installed pip-6.0.6 setuptools-12.0.4


python -m pip


Usage:
D:\Python27\python.exe -m pip  [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.
help                        Show help for commands.
General Options:
-h, --help                  Show help.
--isolated                  Run pip in an isolated mode, ignoring
environment variables and user configuration.
-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                 Path to a verbose appending log.
--proxy              Specify a proxy in the form
[user:passwd@]proxy.server:port.
--retries          Maximum number of retries each connection should
attempt (default 5 times).
--timeout              Set the socket timeout (default 15 seconds).
--exists-action     Default action when a path already exists:
(s)witch, (i)gnore, (w)ipe, (b)ackup.
--trusted-host    Mark this host as trusted, even though it does
not have valid or any HTTPS.
--cert                Path to alternate CA bundle.
--client-cert         Path to SSL client certificate, a single file
containing the private key and the certificate
in PEM format.
--cache-dir            Store the cache data in .
--no-cache-dir              Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
  安装依赖包



python -m pip install netlib pyopenssl pyasn1 urwid pil lxml flask
  错误:
  File "D:\Python27\lib\mimetypes.py", line 249, in enum_types
      ctype = ctype.encode(default_encoding) # omit in 3.x!
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 1: ordinal not in range(128)
  解决方案:
  打开D:\Python27\lib\mimetypes.py文件,在256行,将



default_encoding = sys.getdefaultencoding()
  改为



        if sys.getdefaultencoding() != 'gbk':  
reload(sys)  
sys.setdefaultencoding('gbk')  
default_encoding = sys.getdefaultencoding()
  由于pil安装出错,所以先:



python -m pip install netlib pyopenssl pyasn1 urwid lxml flask
  然后:



python -m pip install pyamf protobuf
  又出错:
  error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat).
Get it from http://aka.ms/vcpython27
  需要装 Microsoft Visual C++ Compiler for Python 2.7(共 83.8 MB)
  http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
  再试:



python -m pip install pyamf protobuf
  下一步:



python -m pip install pil --allow-external PIL --allow-unverified PIL
  下一步:



python -m pip install nose pathod countershape
  最后:



python -m pip install mitmproxy
  
  参考资料:
  https://pip.pypa.io/en/latest/installing.html
http://m.blog.iyunv.com/blog/roler_/40398789
http://netsecurity.iyunv.com/art/201311/416548.htm
http://www.ajucs.com/archives/565.html

  ——————————————————————————————————
  Linux:
  类似windows就是pip命令不用加前面的python -m ,如果不是管理员需要sudo。
  在pip install netlib pyopenssl pyasn1 urwid lxml flask的时候遇到的错误:

  src/lxml/lxml.etree.c:8:22: 错误:pyconfig.h:没有那个文件或目录





yum install python-devel
  c/_cffi_backend.c:13:17: 错误:ffi.h:没有那个文件或目录




yum install libffi-devel
  其他的还有:



yum install gcc
yum install libxml2
yum install libxslt-devel libxml2-devel
  然后:



pip install pil --allow-external PIL --allow-unverified PIL
pip install pyamf protobuf
pip install nose pathod countershape
pip install mitmproxy
  “pip install mitmproxy”遇到错误:

  [iyunv@centos64 ~]# pip install mitmproxy
Collecting mitmproxy
  Using cached mitmproxy-0.11.3.tar.gz
    Traceback (most recent call last):
      File "", line 20, in

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-67311-1-1.html 上篇帖子: win7 下先装SQL2005 后装SQL2000 解决方案 下篇帖子: Delphi2010在Win7上无法调试dll问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表