本文是在python3.6环境下安装的下面软件,如果大家和我的python版本不一致,请在页面选择符合自己版本的软件下载.
pip install wheel
pip install C:\Users\Administrator\Desktop\lxml-4.2.6-cp36-cp36m-win_amd64.whl
https://pypi.org/project/pyOpenSSL/#files
https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/
pip install scrapy
from __future__ import print_function
import sys
try:
from winreg import *
except ImportError:
from _winreg import *
# tweak as necessary
version = sys.version[:3]
installpath = sys.prefix
regpath = "SOFTWARE\\Python\\Pythoncore\\{0}\\".format(version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "{0};{1}\\Lib\\;{2}\\DLLs\\".format(
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()
pywin32-220.win32-py3.6.exe
链接:https://pan.baidu.com/s/1RmtuVywW_mXs76_usU0sjA
提取码:uakt
原文:https://www.cnblogs.com/apollo1616/p/10321534.html