installpath)SetValue(reg

时间:2021-08-19 03:03:42

  下载地点:https://www.python.org/downloads/,,记得要勾选最后的添加环境变量。

2.安置pyspider

  打开命令提示符=》输入pip install pyspider

3.新建文件夹(小我私家需求)

  在C:\Python27\Lib\site-packages下新建文件夹pyspider_helper用于存放帮助py文件

4.安置Microsoft Visual C++ Compiler for Pyhon 2.7

  下载地点:?id=44266

5.安置第三方库呈现 Python version 2.7 required, which was not found in the registry解决步伐

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()

  运行此段代码。

6.安置MySQL驱动

  下载驱动: 
  64位: 
  32位: 

  我的处事器上装的上方32位的,装64会报版本错误,很奇怪。

7.安置MySQLdb

  命令提示符下输入:pip install mysql

8.安置mysql-connector

  下载地点 https://dev.mysql.com/downloads/file/?id=472568

9.安置阿里云东西存储

  文档地点:https://help.aliyun.com/document_detail/32026.html?spm=a2c4g.11174283.6.690.fJtbIT

  命令提示符输入:pip install oss2

10.其他依赖的库

  PIL:pip install Pillow 

Windows部署pyspider指南

标签:

原文地点:https://www.cnblogs.com/zran/p/8805808.html