No misfile name ‘newspaper’ should be changed to “import newspaper” or “froom newspaper”, but the package needs to be installed with a name Pip3 install newspaceper3k
No misreporting named ‘md5’ to report Hashlib
3.报错: No module named ‘urllib2’
import urllib 改成 import urllib.request 4. Solutions:
- Let’s start with the python version, Python2 and python3 in a different way.
- Python2 solution with the following code:
-
123
importsysreload(sys)sys.setdefaultencoding(‘utf-8’) - Python3 solution, with the following code:
-
12
importimportlib,sysimportlib.reload(sys)#使用时候改成这样
5.import httplib 改成 import http.client .原因:Python 2.x中的"httplib"模块在Python 3.x中变成了"http.client" 原代码:
import httplib
import urllib
reqheaders={
'MobileType':'Android',
'DeviceToken':'xxxxxxxxx',
'OSVersion':'1.0.3',
'AppVersion':'14',
'Host':'192.xxx.x.xxxx'}
reqconn=httplib.HTTPConnection("192.xxx.x.xxxx")
reqconn.request("GET", "/Login?username=1416&password=123", None, reqheaders)
res=reqconn.getresponse()
print res.status, res.reason
print res.msg
print res.read()
Modified code:
import http.client #修改引用的模块
import urllib
reqheaders={
'MobileType':'Android',
'DeviceToken':'xxxxxxxxx',
'OSVersion':'1.0.3',
'AppVersion':'14',
'Host':'192.xxx.x.xxxx'}
reqconn=http.client.HTTPConnection("192.xxx.x.xxxx") #修改对应的方法
reqconn.request("GET", "/Login?username=1416&password=123", None, reqheaders)
res=reqconn.getresponse()
print (res.status, res.reason)
print (res.msg)
print (res.read())
未经允许不得转载:萌萌Apprentissage » Error caused by python version ImportError: No mobile name 'httplib' 'lib2'

Python batches to extract mainstream search engine pictures
Python's word crawling across 100 degrees.
PythonTaiichi Taipei Artificial Intelligence Tensoflow Graphic Processing
Selenium with Tor Browser using Python
I'm gonna get you a new one, shell.cloud.google on the line.
run crontab with python selenium tor browser display in linux
Lineux Environment Use python to call the ter browser random browser web page