>>> import builtwith
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "/usr/local/python3/lib/python3.5/site-packages/builtwith/__init__.py", line
except Exception, e:
^
SyntaxError: invalid syntax
>>> import builtwith
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "/usr/local/python3/lib/python3.5/site-packages/builtwith/__init__.py", line
print 'Error:', e
^
SyntaxError: Missing parentheses in call to 'print'
>>> import builtwith
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "/usr/local/python3/lib/python3.5/site-packages/builtwith/__init__.py", line
print() 'Error:', e
^
SyntaxError: invalid syntax
>>> import builtwith
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "/usr/local/python3/lib/python3.5/site-packages/builtwith/__init__.py", line
print 'Error:', e
^
SyntaxError: Missing parentheses in call to 'print'
>>> import builtwith
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "/usr/local/python3/lib/python3.5/site-packages/builtwith/__init__.py", line
print '%s: %s' % result
^
SyntaxError: Missing parentheses in call to 'print'
>>> import builtwith
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "/usr/local/python3/lib/python3.5/site-packages/builtwith/__init__.py", line
print 'Usage: %s url1 [url2 url3 ...]' % sys.argv[]
^
SyntaxError: Missing parentheses in call to 'print'
>>> import builtwith
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "/usr/local/python3/lib/python3.5/site-packages/builtwith/__init__.py", line , in <module>
import urllib2
ImportError: No module named 'urllib2'

因为Python2中的Exception,e 的写法不再支持,需要修改成Exception as e.

(这句话看了我半天, 明明说是抛出了Exception e, 却硬是没看到e的信息,火大!)

另外Python2中的print语句在Python3中需要写成print(),按照错误提示修改对应行数即可。

语法问题修改之后,会报一个没有安装urllib2的包的错误。

通过pip install  urllib2也会提示找不到包。

这是因为builtwith依赖于urllib2包。但Pyhton2中的urllib2工具包,在Python3中分拆成了urllib.request和urllib.error两个包。就导致找不到包,同时也没办法安装。

所以需要install urllib.request和install urllib.error 两个包,然后将builtwith包中的import urllib2修改为import urllib.request 和import urllib.error。

同时代码中的方法函数也需要修改,基本就是将urllib2.xxx修改为urllib.request.xxx。

urllib2修改后对应的函数列表见:https://docs.python.org/2/library/urllib2.html。

python3安装builtwith的更多相关文章

  1. Python3安装与使用urllib2包之小坑

    Python3 安装urllib2包之小坑 Python3.6.6或者说python3.x找不到urllib2语法问题修改之后,会报一个没有安装urllib2的包的错误. 通过pip install ...

  2. ubuntu16.04 python3 安装selenium及环境配置

    环境 ubuntu16.04 python3 安装selenium sudo pip3 install seleium 默认安装完是支持firefox,但是更新得太慢对于较新的firefox已经不支持 ...

  3. suse11 安装 python3.6 python3 安装步骤

    首先需要去网上下载Python-3.6.4.tgz,libopenssl-devel-0.9.8j-2.1.x86_64.rpm zlib-devel-1.2.7-3.14.x86_64.rpm li ...

  4. CentOS7.5 Python3安装pip报错:ModuleNotFoundError: No module named '_ctypes' --Python3

    1.问题:pyhontModuleNotFoundError: No module named '_ctypes'  操作系统:CentOS7.5 安装完Pyhotn3后(如何安装Python3,安装 ...

  5. Python2和Python3安装注意事项

    1. 到官网 https://www.python.org/downloads/windows/ 下载 Windows x86-64 executable installer版本: 2. python ...

  6. python3安装PIL

    原创    2017-09-29 16:15:27 系统环境: 64位win10系统,同时安装python2.7与python3.6两个版本 安装: PIL是Python平台事实上的图像处理标准库,支 ...

  7. python3安装PIL提示Could not find a version that satisfies the requirement pil

    python3安装PIL提示如下错误,安装指令是pip3 install PIL,这个是因为PIL(Python Imaging Library)是Python中一个强大的图像处理库,但目前其只支持到 ...

  8. mac python3安装virtualenv出现的问题

    pip3 install virtualenv pip3 install virtualenvwrapper 安装成功后可能 找不到该命令, 解决办法 1.在 vim ~/.bashrc export ...

  9. Python3安装turtle提示错误:Command "python setup.py egg_info" failed with error code 1

    Python3安装turtle提示错误:Command "python setup.py egg_info" failed with error code 1 Python3.5安 ...

随机推荐

  1. Oracle 初始化参数 二三事,随记

    (1) alter system set log_archive_dest_n='location=d:\一个存在的目录';  ---- 预期 但是如果“d:\一个存在的目录”不是一个有效的目录,则“ ...

  2. ABBYY FineReader Pro for Mac系统要求

    ABBYY FineReader Pro for Mac作为先进的OCR图文识别软件,为各种各样的任务提供全面的解决方案,可轻松将纸质文档.PDF文件和数字文本照片转换为可编辑和可搜索的文件,替代了手 ...

  3. sql server 2014 序列號

    亲测可用 27HMJ-GH7P9-X2TTB-WPHQC-RG79R

  4. SQL 语句判断记录是否存在(最简洁简单性能最优)

    今天查了下,发现网上的没有一个sql语句写的好的. 判断记录是否存在,要不是语句不够简洁,要不就是性能有很大问题. 我进行了优化后,最简洁简单性能最优的的sql语句,用来判断表中的记录是否存在: se ...

  5. 爬豆瓣影评,记下解决maximum recursion depth exceeded in cmp

    #主要是爬取后给别人做自然语言分析,没其他意思. #coding=utf8 import requests,re from lxml import etree import sys reload(sy ...

  6. SPREAD for Windows Forms 控制输入法

    enc = System.Text.Encoding.GetEncoding("shift-jis") datamodel = CType(FpSpread1.ActiveShee ...

  7. CentOS 6.4 SSH 免密码登录

    在配置apache集群分布时,要使用SSH免密码登录.假设现在有两台机器apache@svn(192.168.1.100)作为svn机,apache@app(192.168.1.101)作为app机. ...

  8. graphicsmagick常用命令

    显示图像文件详细信息 gm identify a.jpg 1.更改当前目录下.jpg的尺寸大小,并保存于目录.thumb里面 gm mogrify -output-directory .thumbs ...

  9. js节流函数高级版

    节流函数其主要作用就是防止用户在短时间内多次触发该事件. <!DOCTYPE html> <html lang="en"> <head> < ...

  10. MinGW 是什么

    3.1:MinGW 是什么? MinGW 提供了一套简单方便的Windows下的基于GCC 程序开发环境.MinGW 收集了一系列免费的Windows 使用的头文件和库文件:同时整合了GNU ( ht ...