python


16、安装scrapy

<ol> <li>wheel pip install wheel</li> <li>lxml <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml">http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml</a></li> <li>PyOpenssl <a href="https://pypi.python.org/pypi/pyOpenSSL#downloads">https://pypi.python.org/pypi/pyOpenSSL#downloads</a></li> <li>Twisted <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted">http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted</a></li> <li>Pywin32 <a href="https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/">https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/</a></li> <li>Scrapy pip install scrapy</li> </ol> <h3>安装pywin32</h3> <p>下载网址: <a href="https://sourceforge.net/projects/pywin32/files/pywin32/">https://sourceforge.net/projects/pywin32/files/pywin32/</a></p> <p>根据自己python版本下载64位或32位((注意:pywin32版本跟随Python版本,即如果win是64位,但python是32位,pywin32要装32位的,与win无关))</p> <p>双击安装(可能会遇到下列错误是注册表问题)</p> <p>安装第三方库出现Python version 3.6 required, which was not found in the registry错误解决 建立一个文件 register.py 内容如下. 然后执行该脚本. </p> <pre><code>import sys from winreg import * # tweak as necessary version = sys.version[:3] installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version) installkey = "InstallPath" pythonkey = "PythonPath" pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % ( installpath, installpath, installpath ) def RegisterPy(): try: reg = OpenKey(HKEY_CURRENT_USER, regpath) except EnvironmentError as e: try: reg = CreateKey(HKEY_CURRENT_USER, regpath) SetValue(reg, installkey, REG_SZ, installpath) SetValue(reg, pythonkey, REG_SZ, pythonpath) CloseKey(reg) except: print("*** Unable to register!") return print("--- Python", version, "is now registered!") return if (QueryValue(reg, installkey) == installpath and QueryValue(reg, pythonkey) == pythonpath): CloseKey(reg) print("=== Python", version, "is already registered!") return CloseKey(reg) print("*** Unable to register!") print("*** You probably have another Python installation!") if __name__ == "__main__": RegisterPy()</code></pre>

页面列表

ITEM_HTML