威尼斯人线上娱乐

【威尼斯人线上娱乐】0A_Windows下同时安装Python二和Python三

13 4月 , 2019  

Gerapy是3个Scrapy分布式管理模块,本节就来介绍一下它的设置情势。


Last login: Tue May 16 21:05:34 on console
➜  ~ brew update
zsh: command not found: brew
➜  ~ ruby -e "$(curl --insecure -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/bin
/usr/local/etc
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man8
==> The following existing directories will have their owner set to yysimac:
/usr/local/bin
/usr/local/etc
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man8
==> The following existing directories will have their group set to admin:
/usr/local/bin
/usr/local/etc
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man8
==> The following new directories will be created:
/usr/local/Cellar
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/etc /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man8
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/etc /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man8
==> /usr/bin/sudo /usr/sbin/chown yysimac /usr/local/bin /usr/local/etc /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man8
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/etc /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man8
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown yysimac /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/mkdir -p /Users/yysimac/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/yysimac/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown yysimac /Users/yysimac/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown yysimac /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 6010, done.
remote: Compressing objects: 100% (3708/3708), done.
remote: Total 6010 (delta 3392), reused 3974 (delta 2112), pack-reused 0
Receiving objects: 100% (6010/6010), 3.46 MiB | 49.00 KiB/s, done.
Resolving deltas: 100% (3392/3392), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
 * [new tag]         0.1        -> 0.1
 * [new tag]         0.2        -> 0.2
 * [new tag]         0.3        -> 0.3
 * [new tag]         0.4        -> 0.4
 * [new tag]         0.5        -> 0.5
 * [new tag]         0.6        -> 0.6
 * [new tag]         0.7        -> 0.7
 * [new tag]         0.7.1      -> 0.7.1
 * [new tag]         0.8        -> 0.8
 * [new tag]         0.8.1      -> 0.8.1
 * [new tag]         0.9        -> 0.9
 * [new tag]         0.9.1      -> 0.9.1
 * [new tag]         0.9.2      -> 0.9.2
 * [new tag]         0.9.3      -> 0.9.3
 * [new tag]         0.9.4      -> 0.9.4
 * [new tag]         0.9.5      -> 0.9.5
 * [new tag]         0.9.8      -> 0.9.8
 * [new tag]         0.9.9      -> 0.9.9
 * [new tag]         1.0.0      -> 1.0.0
 * [new tag]         1.0.1      -> 1.0.1
 * [new tag]         1.0.2      -> 1.0.2
 * [new tag]         1.0.3      -> 1.0.3
 * [new tag]         1.0.4      -> 1.0.4
 * [new tag]         1.0.5      -> 1.0.5
 * [new tag]         1.0.6      -> 1.0.6
 * [new tag]         1.0.7      -> 1.0.7
 * [new tag]         1.0.8      -> 1.0.8
 * [new tag]         1.0.9      -> 1.0.9
 * [new tag]         1.1.0      -> 1.1.0
 * [new tag]         1.1.1      -> 1.1.1
 * [new tag]         1.1.10     -> 1.1.10
 * [new tag]         1.1.11     -> 1.1.11
 * [new tag]         1.1.12     -> 1.1.12
 * [new tag]         1.1.13     -> 1.1.13
 * [new tag]         1.1.2      -> 1.1.2
 * [new tag]         1.1.3      -> 1.1.3
 * [new tag]         1.1.4      -> 1.1.4
 * [new tag]         1.1.5      -> 1.1.5
 * [new tag]         1.1.6      -> 1.1.6
 * [new tag]         1.1.7      -> 1.1.7
 * [new tag]         1.1.8      -> 1.1.8
 * [new tag]         1.1.9      -> 1.1.9
 * [new tag]         1.2.0      -> 1.2.0
 * [new tag]         1.2.1      -> 1.2.1
HEAD is now at 2b72638 info: fix conflicts formatting.
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4409, done.
remote: Compressing objects: 100% (4215/4215), done.
remote: Total 4409 (delta 36), reused 450 (delta 14), pack-reused 0
Receiving objects: 100% (4409/4409), 3.50 MiB | 8.00 KiB/s, done.
Resolving deltas: 100% (36/36), done.
Tapped 4214 formulae (4,452 files, 10.9MB)
==> Cleaning up /Library/Caches/Homebrew...
==> Migrating /Library/Caches/Homebrew to /Users/yysimac/Library/Caches/Homebrew
==> Deleting /Library/Caches/Homebrew...
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  http://docs.brew.sh/Analytics.html

==> Next steps:
- Run `brew help` to get started
- Further documentation:
    http://docs.brew.sh
➜  ~

1.安装

先是步安装Python,在OS X一般已经暗许装了,python –version

其次步安装pip, sudo easy_install pip

其三部安装robotframework,执行pip install robotframework

安装进度中出现谬误:

威尼斯人线上娱乐 ,error: could not create ‘/Library/Python/2.7/site-packages/robot’:
Permission denied

证实python目录没权力设置packages的包,消除:sudo chown -宝马X5 $USE中华V/Library/Python/二.七
翻开版本 :
robot –version
rebot –version
第四步 rf官方编辑器–KoleosIDE安装
pip install robotframework-ride
brew install wxPython
安装完后实施 ride.py
倘若可以打开ride,那么恭喜您安装成功。
若提示 wxPython not found.
wxPython 2.8.12.1 can be downloaded from
下载http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/
设置流程:http://www.voidcn.com/blog/xubeiqiannian/article/p-5994792.html

在上文安装robotframework后,目录里有3个demo文件(\Lib\site-packages\robotframework-3.0.dist-info\DESCRIPTION.rst),此时大家得以经过ride打开此文件,若是打开的时候报“……is
not a valid 罗布ot Framework test case or resourcefile”错误:

安装python库 :pip install docutils

伍常用测试库安装
pip install requests
pip install robotframework-requests

一. 城门失火链接

  • GitHub:

时间:2018-01-09 00:31 作者:魏文应
python安装

截图:

二:创立测试用例

参照http://www.cnblogs.com/fnng/p/3871712.html
先是步:新建测试项目

威尼斯人线上娱乐 1

测试项目二.png

第壹步:创设测试套件

威尼斯人线上娱乐 2

测试套件.png

其三步:创建测试用例

威尼斯人线上娱乐 3

测试用例二.png

第6步:导入selenium2library库,暗黑是意味库selenium贰library没导入

威尼斯人线上娱乐 4

加上测试库.png

第六步:编写用例
接纳谷歌浏览器案例

威尼斯人线上娱乐 5

测试chrome.png

威尼斯人线上娱乐 6

谷歌(Google)浏览器成功测试图.png

使用safari案例

威尼斯人线上娱乐 7

打响测试图片.png

威尼斯人线上娱乐 8

得逞开拓浏览器图片.png

2. pip安装

此间推荐应用pip安装,命令如下:

pip3 install gerapy

威尼斯人线上娱乐 9

叁: 使用首要字 -分层思想

参考:http://www.cnblogs.com/fnng/p/3969978.html
应用情状:当测试用例都走同七个剧本时,只是供给通晓用户输入的,和得出的结果
第3步:在测试项目中创制财富
其次步:在财富下创建主要字
其三步:编辑关键字,编辑argument
第五步:添加创设的财富到测试套件中
第陆步:在测试用例中调用关键字

三. 测试安装

设置到位后,能够在Python命令行下测试:

$ python3
>>> import gerapy

若是没错误报出,则声明库已经安装好了。

壹、安装环境

  • 操作系统: win7 64人(win柒以上的windows版本)
  • python2 版本: python2.7.14
  • python3 版本: python3.6.4

下载并设置homebrew

4:测试app

率先步:安装环境:http://blog.csdn.net/xyh421/article/details/52119872
sudo brew install node #安装nodejs
npm install -g appium #安装appium
appium #启动appium
安装appium,可以命令行
【威尼斯人线上娱乐】0A_Windows下同时安装Python二和Python三。能够一向去官网下http://appium.io/getting-started.html?lang=zh
能够装Appium Doctor检测appium是或不是安排成功:
npm install -g appium-doctor
设置要求的 Library:appiumlibrary,archivelibrary,SSHLibrary。
进入 Python 的安装路径,分别施行以下命令:
pip install robotframework-selenium2library
pip install robotframework-archivelibrary
pip install robotframework-SSHLibrary

设置和配置appium
:https://bitbucket.org/appium/appium.app/downloads/
测试是或不是到位布署,
appium使用参照:http://www.itdadao.com/articles/c15a572936p0.html

威尼斯人线上娱乐 10

Appium.png

出现难点:

威尼斯人线上娱乐 11

检查难点.png

解决:http://stackoverflow.com/questions/40129794/how-to-fix-error-could-not-detect-mac-os-x-version-from-sw-vers-output-10-12

威尼斯人线上娱乐 12

解决:
http://appium.io/slate/en/master/?ruby\#new-desired-capabilities,
本子不对,Appium1.五.3不帮助Xcode8.1,要求更新appium或然转移Xcode7
下载安装appium一.陆本子出现难点

威尼斯人线上娱乐 13

安装appium错误.png

转换Tmall镜像: npm install -g cnpm
–registry=https://registry.npm.taobao.org
再走cnpm install -g appium@1.6.3
参照:http://www.mamicode.com/info-detail-1728757.html

编写制定测试用例:添加测试app项目。添加套件,添加财富库,绑定appiumlibrary库和财富库,设置财富库变量,开启appium。

  • 代码示例
![](https://upload-images.jianshu.io/upload_images/2381877-beab67dbeb445a83.png)

测试案例text.png

威尼斯人线上娱乐 14

财富套件.png

测试成功后将report对应的途径添加到浏览器就足以看出报告

威尼斯人线上娱乐 15

报告.png

二、下载

  • python
    下载:进入python官网https://www.python.org/,然后进入download页面:

    威尼斯人线上娱乐 16

    python版本选拔页面

  • python叁 选用点击链接: Latest Python 3 Release – Python 三.6.4

  • python2 选用点击链接: Latest Python 二 Release – Python 二.柒.1肆

  • python③ 下载(下载页面列表中的 Windows x八陆-64 executable
    installer):

    威尼斯人线上娱乐 17

    python叁下载页面

  • python2 下载(下载页面列表中的Windows x捌陆-6四 MSI installer):

    威尼斯人线上娱乐 18

    python二下载页面

威尼斯人线上娱乐 19

安装进度中现身难题

执行pip install robotframework-selenium2library,

威尼斯人线上娱乐 20

截图.png

解决:sudo pip install tweepy

执行pip install robotframework-appiumlibrary

威尼斯人线上娱乐 21

安装applium库出标题.png

解决:pip install setuptools_scm

三、python安装

留神:
关于python.exe修改为python2.exe和python叁.exe,以此来区分python二和python三的办法,大家会在“给python.exe创设硬链接”部分,有更加好的缓解方案。

  • #### 1、python3安装:

  • 以管理人身份运营安装包python-三.6.四.exe。

  • 要是大家不供给修改安装路径,并且也不供给此外供给,那么勾选上Add
    Python 三.陆 to PATH,直接Install
    Now安装,等待安装完结之后,上面几步就不须要了,直接跳到
    “2、python3测试” 即可。

  • 自个儿想让具有用户采用python(而不息是现阶段用户),所以本身用了customize
    installation方式定制安装(大家要把Add Python 三.6 to
    PATH勾选上,否则安装完还要手工添加安装路径到系统环境变量):

    威尼斯人线上娱乐 22

    设置选项

  • 点击customize installation
    未来,得到下边页面,全体勾选上,点击Next(下一步) :

    威尼斯人线上娱乐 23

    python三定制安装图二

  • 在这么些页面少将Intall for all
    users勾选上,使得全数用户都能够动用,点击Install(安装):

    威尼斯人线上娱乐 24

    python三定制安装图3

  • 本人那边python三设置的门道为C:\Program Files
    (x86)\Python3陆-3贰,安装完结点击close(关闭)即可:

    威尼斯人线上娱乐 25

    Python三定制安装图四

  • #### 2、python3测试:

  • 测试是或不是安装成功,打开windows的cmd命令行终端,直接输入一下指令:

    python
    
  • 启航了python3解释器,输入以下代码,并回车:

      print("hellow world!!!")
    
  • 打响打字与印刷了hellow world!!!,表达安装成功了:

    威尼斯人线上娱乐 26

    python3打响运营

  • 输入上边代码退出Python解释器:

    exit()
    
  • 在意:即使你早已安装了python二,可能会运作的是python贰而不是python叁,你要求进入python3六-3二目录钦点运维python三:

    cd C:\Program Files (x86)\Python36-32
    python
    
  • 理所当然,大家是想直接键入Python三,从而运维python叁,所以我们把安装目录(C:\Program
    Files (x86)\Python36-32)下的python.exe改为python3.exe即可:

    威尼斯人线上娱乐 27

    重命名Python3

    如此大家在cmd中央直机关接键入python三,就能够平昔运营python3了。注意:修改之后重启一下cmd,再键入python叁测试。

  • #### 3、Python2 安装:

  • 双击安装python-2.7.1三.msi, 点击Next(下一步):

    威尼斯人线上娱乐 28

    python2安装图1

  • 这一步采纳安装路径,那里我们接纳暗中认可路径(C:\Python27\),点击Next(下一步):

    威尼斯人线上娱乐 29

    python2安装图2

  • 将python贰添加到系统环境变量中,要求将Add python.exe to
    Path选项选为:entire feature will be installed on local hard
    drive
    ,然后点击Next(下一步):

    威尼斯人线上娱乐 30

    python2安装图3

  • 迄今甘休安装到位。

表达是还是不是安装成功

➜  ~ brew
Example usage:
  brew search [TEXT|/REGEX/]
  brew (info|home|options) [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install -vd FORMULA

Developers:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]
  http://docs.brew.sh/Formula-Cookbook.html

Further help:
  man brew
  brew help [COMMAND]
  brew home
➜  ~

威尼斯人线上娱乐 31

测试brew安装成功

累加测试用例时出现难题:

威尼斯人线上娱乐 32

测试浏览器bug.png

杀鸡取卵:供给设置chromedriver 执行brew install chromedriver

4、Python2测试:

  • 测试是或不是安装成功,打开windows的cmd命令行终端,直接输入一下下令:

    py -2
    
  • 起始了python二解释器,输入以下代码,并回车:

    print "hellow world!!!"
    
  • 成功打印了 hellow world!!!,表明安装成功了:

    威尼斯人线上娱乐 33

    python2测试图1

  • 相同我们修改安装目录(C:\Python27)下的python.exe,改为python2.exe:

    威尼斯人线上娱乐 34

    python2测试图2

    那样就足以在cmd直接键入python二,运营Python2呀。

用easy_install安装Python的pip工具

➜  ~ pip
zsh: command not found: pip
➜  ~ sudo easy_install pip
Password:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 9.0.1
Downloading https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
Processing pip-9.0.1.tar.gz
Writing /tmp/easy_install-C3WDxF/pip-9.0.1/setup.cfg
Running pip-9.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-C3WDxF/pip-9.0.1/egg-dist-tmp-yI1cWT
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '.landscape.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'appveyor.yml'
no previously-included directories found matching '.github'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'contrib'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
creating /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
Extracting pip-9.0.1-py2.7.egg to /Library/Python/2.7/site-packages
Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
➜  ~

肆、python的pip使用难题:

  • python可以通过pip那一个命令,来方便地下载程序中的正视包。

  • 担保pip所在目录在系统变量中(python三貌似都在),将下边的拉长到系统变量PATH中(其实笔者是添加到用户PATH中,那要依照你的装置路径而定):

    C:\Python27
    C:\Python27\Scripts
    

    威尼斯人线上娱乐 35

    拉长到系统环境变量中

测试pip安装是还是不是成功

➜  ~ pip

Usage:
  pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  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. Option is additive, and can be
                              used up to 3 times (corresponding to WARNING,
                              ERROR, and CRITICAL logging levels).
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form
                              [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should
                              attempt (default 5 times).
  --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, (a)bort.
  --trusted-host <hostname>   Mark this host as trusted, even though it does
                              not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file
                              containing the private key and the certificate
                              in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --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.
➜  ~

威尼斯人线上娱乐 36

测试pip安装成功

壹、同时安装了Python二和Python三,pip报错:fatal error in launcher: unable to create process using

  • 因为自身刚才修改了python二和python三的名目,假使一贯键入pip二或然pip三,后装置的那多少个python版本会报如下错误:

    fatal error in launcher: unable to create process using‘’‘’

    威尼斯人线上娱乐 37

    pip指令报错

    于是,通过改动python.exe来区分python2和python三的做法,会使个中多个pip不可用,大家得以由此上面包车型大巴不贰秘诀补救:

    python2 -m pip install xxx
    python3 -m pip install xxx

    python2 -m pip 相当于 pip2python3 -m pip 相当于
    pip3

homebrew安装Python3.6.1

➜  ~ brew install python3
Updating Homebrew...
==> Installing dependencies for python3: pkg-config, readline, sqlite, gdbm, openssl, xz
==> Installing python3 dependency: pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2.sierra.bo
######################################################################## 100.0%
==> Pouring pkg-config-0.29.2.sierra.bottle.tar.gz
==> Using the sandbox
🍺  /usr/local/Cellar/pkg-config/0.29.2: 11 files, 627KB
==> Installing python3 dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/readline-7.0.3_1.sierra.bot
######################################################################## 100.0%
==> Pouring readline-7.0.3_1.sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only..

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/readline/lib
    CPPFLAGS: -I/usr/local/opt/readline/include

==> Summary
🍺  /usr/local/Cellar/readline/7.0.3_1: 46 files, 1.5MB
==> Installing python3 dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.18.0.sierra.bottle
######################################################################## 100.0%
==> Pouring sqlite-3.18.0.sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/sqlite/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/sqlite/3.18.0: 11 files, 3.0MB
==> Installing python3 dependency: gdbm
==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.13.sierra.bottle.tar
######################################################################## 100.0%
==> Pouring gdbm-1.13.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/gdbm/1.13: 19 files, 554.4KB
==> Installing python3 dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2k.sierra.bottl
######################################################################## 100.0%
==> Pouring openssl-1.0.2k.sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2k: 1,704 files, 12.1MB
==> Installing python3 dependency: xz
==> Downloading https://homebrew.bintray.com/bottles/xz-5.2.3.sierra.bottle.tar.
######################################################################## 100.0%
==> Pouring xz-5.2.3.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/xz/5.2.3: 92 files, 1.4MB
==> Installing python3
Warning: Building python3 from source:
  The bottle needs the Apple Command Line Tools to be installed.
  You can install them, if desired, with:
    xcode-select --install

==> Downloading https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/python3/3.6.1 --enable-ipv6 --dataroo
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python3/3.6.1
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python3/3.6.1/sh
==> Downloading https://files.pythonhosted.org/packages/87/1a/33d3d05569e857c5c5
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/11/b6/abcb525026a4be042b
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/c9/1d/bd19e691fd4cfe908c
######################################################################## 100.0%
==> /usr/local/Cellar/python3/3.6.1/bin/python3 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python3/3.6.1/bin/python3 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python3/3.6.1/bin/python3 -s setup.py --no-user-cfg instal
==> Caveats
Pip, setuptools, and wheel have been installed. To update them
  pip3 install --upgrade pip setuptools wheel

You can install Python packages with
  pip3 install <package>

They will install into the site-package directory
  /usr/local/lib/python3.6/site-packages

See: http://docs.brew.sh/Homebrew-and-Python.html
==> Summary
🍺  /usr/local/Cellar/python3/3.6.1: 7,961 files, 110.0MB, built in 10 minutes 42 seconds
➜  ~

能够见到,安装时间依旧蛮长的,首若是设置了数不胜数的依靠包:
/usr/local/Cellar/python3/3.6.1: 7,961 files, 110.0MB, built in 10 minutes 42 seconds
10 minutes 42 seconds

二、不改动python.exe名称,直接动用pip2和pip三:

  • 为了直接行使pip2和pip3,大家把python二.exe和python三.exe都改回去,改为原本私下认可的python.exe,我们得以在cmd中,通过下列指令来分别运转python贰和python3:

    # 这么些用来运营python2
    py -2
    # 那些用来运营python三
    py -3
    # 查看pip2版本,呈现版本表达能够不奇怪使用
    pip2 -V
    # 查看pip三版本,彰显版本表达能够健康使用
    pip3 -V

    威尼斯人线上娱乐 38

    pip使用测试

测试python三安装是或不是打响

➜  ~ python3
Python 3.6.1 (default, May 16 2017, 21:43:35)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.41)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

3、pip使用十三分:

  • 在不奇怪的行使过程中,pip假使出现万分(原来选取的美艳的,前边出标题了),大家能够经过上面发号施令来更新配备:

    # python2
    py -2 -m pip install -U pip

    # python3
    py -3 -m pip install -U pip

    # 要是你改改了python.exe,能够用来下命令来替代
    python2 -m pip install -U pip
    python3 -m pip install -U pip

    # 上边通过python的-m参数,将pip模块当作脚本来运营,安装更新提高

    威尼斯人线上娱乐 39

    upgrade更新升级pip

pip3可用

➜  ~ pip3

Usage:
  pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  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. Option is additive, and can be used up to
                              3 times (corresponding to WARNING, ERROR, and CRITICAL
                              logging levels).
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form
                              [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should attempt
                              (default 5 times).
  --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, (a)bort.
  --trusted-host <hostname>   Mark this host as trusted, even though it does not have
                              valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file containing
                              the private key and the certificate in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --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.
➜  ~

4、使用pip下载依赖包:

  • 选用下列命令来安装依赖包:

    pip2 install xxx

  • 上边演示使用pip贰安装盛名的数学绘图重视包matplotlib,在cmd中实践下列指令:

    pip2 install matplotlib

  • 假定此前安装过,能够因此添加 -U 参数,举行革新进步:

    pip2 install matplotlib -U

    威尼斯人线上娱乐 40

    matplotlib通过pip形式安装

pip3安装jupyter

➜  ~ pip3 install jupyter
Collecting jupyter
  Downloading jupyter-1.0.0-py2.py3-none-any.whl
Collecting ipywidgets (from jupyter)
  Downloading ipywidgets-6.0.0-py2.py3-none-any.whl (46kB)
    100% |████████████████████████████████| 51kB 231kB/s
Collecting notebook (from jupyter)
  Downloading notebook-5.0.0-py2.py3-none-any.whl (6.9MB)
    100% |████████████████████████████████| 6.9MB 75kB/s
Collecting qtconsole (from jupyter)
  Downloading qtconsole-4.3.0-py2.py3-none-any.whl (108kB)
    100% |████████████████████████████████| 112kB 85kB/s
Collecting ipykernel (from jupyter)
  Downloading ipykernel-4.6.1-py3-none-any.whl (104kB)
    100% |████████████████████████████████| 112kB 111kB/s
Collecting nbconvert (from jupyter)
  Downloading nbconvert-5.1.1-py2.py3-none-any.whl (372kB)
    100% |████████████████████████████████| 378kB 315kB/s
Collecting jupyter-console (from jupyter)
  Downloading jupyter_console-5.1.0-py2.py3-none-any.whl
Collecting ipython>=4.0.0 (from ipywidgets->jupyter)
  Downloading ipython-6.0.0-py3-none-any.whl (736kB)
    100% |████████████████████████████████| 737kB 210kB/s
Collecting nbformat>=4.2.0 (from ipywidgets->jupyter)
  Downloading nbformat-4.3.0-py2.py3-none-any.whl (154kB)
    100% |████████████████████████████████| 163kB 267kB/s
Collecting traitlets>=4.3.1 (from ipywidgets->jupyter)
  Downloading traitlets-4.3.2-py2.py3-none-any.whl (74kB)
    100% |████████████████████████████████| 81kB 244kB/s
Collecting widgetsnbextension~=2.0.0 (from ipywidgets->jupyter)
  Downloading widgetsnbextension-2.0.0-py2.py3-none-any.whl (1.1MB)
    100% |████████████████████████████████| 1.1MB 303kB/s
Collecting terminado>=0.3.3; sys_platform != "win32" (from notebook->jupyter)
  Downloading terminado-0.6.tar.gz
Collecting jupyter-client (from notebook->jupyter)
  Downloading jupyter_client-5.0.1-py2.py3-none-any.whl (83kB)
    100% |████████████████████████████████| 92kB 374kB/s
Collecting ipython-genutils (from notebook->jupyter)
  Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting tornado>=4 (from notebook->jupyter)
  Downloading tornado-4.5.1.tar.gz (483kB)
    100% |████████████████████████████████| 491kB 521kB/s
Collecting jupyter-core (from notebook->jupyter)
  Downloading jupyter_core-4.3.0-py2.py3-none-any.whl (76kB)
    100% |████████████████████████████████| 81kB 559kB/s
Collecting jinja2 (from notebook->jupyter)
  Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB)
    100% |████████████████████████████████| 348kB 645kB/s
Collecting pygments (from qtconsole->jupyter)
  Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)
    100% |████████████████████████████████| 849kB 239kB/s
Collecting pandocfilters>=1.4.1 (from nbconvert->jupyter)
  Downloading pandocfilters-1.4.1.tar.gz
Collecting entrypoints>=0.2.2 (from nbconvert->jupyter)
  Downloading entrypoints-0.2.2-py2.py3-none-any.whl
Collecting mistune!=0.6 (from nbconvert->jupyter)
  Downloading mistune-0.7.4-cp36-cp36m-macosx_10_12_x86_64.whl (235kB)
    100% |████████████████████████████████| 235kB 390kB/s
Collecting testpath (from nbconvert->jupyter)
  Downloading testpath-0.3-py2.py3-none-any.whl (82kB)
    100% |████████████████████████████████| 92kB 521kB/s
Collecting bleach (from nbconvert->jupyter)
  Downloading bleach-2.0.0-py2.py3-none-any.whl
Collecting prompt-toolkit<2.0.0,>=1.0.0 (from jupyter-console->jupyter)
  Downloading prompt_toolkit-1.0.14-py3-none-any.whl (248kB)
    100% |████████████████████████████████| 256kB 451kB/s
Collecting jedi>=0.10 (from ipython>=4.0.0->ipywidgets->jupyter)
  Downloading jedi-0.10.2-py2.py3-none-any.whl (190kB)
    100% |████████████████████████████████| 194kB 369kB/s
Collecting pickleshare (from ipython>=4.0.0->ipywidgets->jupyter)
  Downloading pickleshare-0.7.4-py2.py3-none-any.whl
Collecting appnope; sys_platform == "darwin" (from ipython>=4.0.0->ipywidgets->jupyter)
  Downloading appnope-0.1.0-py2.py3-none-any.whl
Collecting decorator (from ipython>=4.0.0->ipywidgets->jupyter)
  Downloading decorator-4.0.11-py2.py3-none-any.whl
Collecting pexpect; sys_platform != "win32" (from ipython>=4.0.0->ipywidgets->jupyter)
  Downloading pexpect-4.2.1-py2.py3-none-any.whl (55kB)
    100% |████████████████████████████████| 61kB 443kB/s
Collecting simplegeneric>0.8 (from ipython>=4.0.0->ipywidgets->jupyter)
  Downloading simplegeneric-0.8.1.zip
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.6/site-packages (from ipython>=4.0.0->ipywidgets->jupyter)
Collecting jsonschema!=2.5.0,>=2.4 (from nbformat>=4.2.0->ipywidgets->jupyter)
  Downloading jsonschema-2.6.0-py2.py3-none-any.whl
Collecting six (from traitlets>=4.3.1->ipywidgets->jupyter)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting ptyprocess (from terminado>=0.3.3; sys_platform != "win32"->notebook->jupyter)
  Downloading ptyprocess-0.5.1-py2.py3-none-any.whl
Collecting pyzmq>=13 (from jupyter-client->notebook->jupyter)
  Downloading pyzmq-16.0.2-cp36-cp36m-macosx_10_6_intel.whl (1.1MB)
    100% |████████████████████████████████| 1.1MB 496kB/s
Collecting python-dateutil>=2.1 (from jupyter-client->notebook->jupyter)
  Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 638kB/s
Collecting MarkupSafe>=0.23 (from jinja2->notebook->jupyter)
  Downloading MarkupSafe-1.0.tar.gz
Collecting html5lib>=0.99999999 (from bleach->nbconvert->jupyter)
  Downloading html5lib-0.999999999-py2.py3-none-any.whl (112kB)
    100% |████████████████████████████████| 122kB 695kB/s
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
  Downloading wcwidth-0.1.7-py2.py3-none-any.whl
Collecting webencodings (from html5lib>=0.99999999->bleach->nbconvert->jupyter)
  Downloading webencodings-0.5.1-py2.py3-none-any.whl
Building wheels for collected packages: terminado, tornado, pandocfilters, simplegeneric, MarkupSafe
  Running setup.py bdist_wheel for terminado ... done
  Stored in directory: /Users/yysimac/Library/Caches/pip/wheels/3b/c2/ea/af635ffb63857a8c2ddd22da6a4b52f5b7ea3065db94ef5d7c
  Running setup.py bdist_wheel for tornado ... done
  Stored in directory: /Users/yysimac/Library/Caches/pip/wheels/84/83/cd/6a04602633457269d161344755e6766d24307189b7a67ff4b7
  Running setup.py bdist_wheel for pandocfilters ... done
  Stored in directory: /Users/yysimac/Library/Caches/pip/wheels/d4/01/68/49055c80b9f01ccb49241e73c8019628605064730941d70b56
  Running setup.py bdist_wheel for simplegeneric ... done
  Stored in directory: /Users/yysimac/Library/Caches/pip/wheels/7b/31/08/c85e74c84188cbec6a6827beec4d640f2bd78ae003dc1ec09d
  Running setup.py bdist_wheel for MarkupSafe ... done
  Stored in directory: /Users/yysimac/Library/Caches/pip/wheels/88/a7/30/e39a54a87bcbe25308fa3ca64e8ddc75d9b3e5afa21ee32d57
Successfully built terminado tornado pandocfilters simplegeneric MarkupSafe
Installing collected packages: wcwidth, six, prompt-toolkit, jedi, pickleshare, appnope, decorator, pygments, ptyprocess, pexpect, simplegeneric, ipython-genutils, traitlets, ipython, jsonschema, jupyter-core, nbformat, tornado, terminado, pyzmq, python-dateutil, jupyter-client, ipykernel, pandocfilters, entrypoints, mistune, testpath, webencodings, html5lib, bleach, MarkupSafe, jinja2, nbconvert, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter
Successfully installed MarkupSafe-1.0 appnope-0.1.0 bleach-2.0.0 decorator-4.0.11 entrypoints-0.2.2 html5lib-0.999999999 ipykernel-4.6.1 ipython-6.0.0 ipython-genutils-0.2.0 ipywidgets-6.0.0 jedi-0.10.2 jinja2-2.9.6 jsonschema-2.6.0 jupyter-1.0.0 jupyter-client-5.0.1 jupyter-console-5.1.0 jupyter-core-4.3.0 mistune-0.7.4 nbconvert-5.1.1 nbformat-4.3.0 notebook-5.0.0 pandocfilters-1.4.1 pexpect-4.2.1 pickleshare-0.7.4 prompt-toolkit-1.0.14 ptyprocess-0.5.1 pygments-2.2.0 python-dateutil-2.6.0 pyzmq-16.0.2 qtconsole-4.3.0 simplegeneric-0.8.1 six-1.10.0 terminado-0.6 testpath-0.3 tornado-4.5.1 traitlets-4.3.2 wcwidth-0.1.7 webencodings-0.5.1 widgetsnbextension-2.0.0
➜  ~

5、给python.exe成立硬链接:

  • 突发性我们想把上面发号施令都有能动用,如何是好?

    py -2
    py -3
    python2
    python3
    pip2
    pip3

    咱俩得以由此给Python.exe创造硬链接的秘籍,就能够了:

    #给python三创设硬链接,路径依照你自身的装置目录而定
    mklink /H “C:\Program Files\Python36\python3.exe” “C:\Program
    Files\Python36\python.exe”
    #给python二开立硬链接,路径依据你自身的设置目录而定
    mklink /H “C:\Python27\python2.exe” “C:\Python27\python.exe”

    威尼斯人线上娱乐 41

    创办硬链接

    只顾,win拾体系必要管理员身份运营CMD,才能创立改链接,请参见上边小说:
    《01_组织者权限运维cmd命令行》

    终极,我们想利用的授命都能够动用了:

    威尼斯人线上娱乐 42

    一声令下使用


迄今,全体安装都得了啦!!!
三更半夜:2018-01-10 00:56


测试jupyter notebook

➜  ~ jupyter notebook
[I 21:55:37.968 NotebookApp] Writing notebook server cookie secret to /Users/yysimac/Library/Jupyter/runtime/notebook_cookie_secret
[I 21:55:37.989 NotebookApp] Serving notebooks from local directory: /Users/yysimac
[I 21:55:37.989 NotebookApp] 0 active kernels
[I 21:55:37.989 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=f8f1e323067ced119c4771b3d729a35341fe240908318a86
[I 21:55:37.989 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 21:55:37.992 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=f8f1e323067ced119c4771b3d729a35341fe240908318a86
[I 21:55:38.292 NotebookApp] Accepting one-time-token-authenticated connection from ::1

弹出浏览器:

威尼斯人线上娱乐 43

完美!


相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图