>>> 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. proto序列化

    proto序列化和反序列化类 序列化是将我们的Protobuf类对象转换成字节数组的方法,网络底层我们从服务器获取到的是字节数组,反序列化是将字节转成proto类对象的方法 public class ...

  2. 【D】分布式系统的CAP理论

    2000年7月,加州大学伯克利分校的Eric Brewer教授在ACM PODC会议上提出CAP猜想.2年后,麻省理工学院的Seth Gilbert和Nancy Lynch从理论上证明了CAP.之后, ...

  3. iOS 严重问题解释(crash)

    问题1:Exception Type: 00000020 Exception Codes: 0x000000008badf00d Exception Note: SIMULATED (this is  ...

  4. Windows最全快捷键

    单独按Windows:显示或隐藏“开始”功能表 Windows+BREAK:显示“系统属性” 对话框 Windows+D:显示桌面 Windows+M:最小化所有窗口 Windows+Shift+M: ...

  5. centos7安装python-3.5

    sudo yum install gcc wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz sudo cp Python-.t ...

  6. 【代码审计】QYKCMS_v4.3.2 任意文件删除漏洞分析

      0x00 环境准备 QYKCMS官网:http://www.qykcms.com/ 网站源码版本:QYKCMS_v4.3.2(企业站主题) 程序源码下载:http://bbs.qingyunke. ...

  7. 管理工具 django-admin.py的相关命令列表

    C:\Users\lenovo> django-admin.py Type 'django-admin.py help <subcommand>' for help on a spe ...

  8. 【RF库Collections测试】Remove From List

    Name:Remove From ListSource:Collections <test library>Arguments:[ list_ | index ]Removes and r ...

  9. Ubuntu下Eclipse的安装方法

    1. 下载jre,eclipse,cdt 其中jre是java运行环境,eclipse需要先装jre,才可能运行,cdt是在eclipse中运行c\c++程序的插件. 1.1 下载jre 网址是:ja ...

  10. 使用C#把发表的时间改为几个月,几天前,几小时前,几分钟前,或几秒前

    //使用C#把发表的时间改为几个月,几天前,几小时前,几分钟前,或几秒前 //2008年03月15日 星期六 02:35 public string DateStringFromNow(DateTim ...