如何在 Windows 7 64 位上安装 PyOpenSSL?

发布于 2024-10-20 21:19:52 字数 583 浏览 5 评论 0原文

要让 Scrapy 在 HTTPS 上运行,我需要 PyOpenSSL,但我似乎无法让它发挥作用。

那么,有 64 位版本可用吗? 我没有看到... 我已经安装了 32 位版本,但是...

我目前从 Scrapy 收到此错误:

ERROR: Error downloading <https://SOME_PRIVATE_URL_HERE>:  
  [Failure instance: Traceback: <class 'scrapy.exceptions.NotSupported'>:
  HTTPS not supported: install pyopenssl library

有谁知道如何获取或编译 64 位版本吗?或者说这是没有必要的?

To get Scrapy working on HTTPS, I need PyOpenSSL, but I can't seem to get this to work.

So, is there a 64-bit version available? I don't see one... I have installed the 32-bit version but...

I currently get this error back from Scrapy:

ERROR: Error downloading <https://SOME_PRIVATE_URL_HERE>:  
  [Failure instance: Traceback: <class 'scrapy.exceptions.NotSupported'>:
  HTTPS not supported: install pyopenssl library

Does anyone have a clue how to obtain or compile a 64-bit version? Or is that unneccesary?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

别想她 2024-10-27 21:19:52

实际上,本网站的第 9 步将解决您的问题。

http://steamforge.net/wiki/index.php/How_to_Install_Scrapy_in_64-bit_Windows_7

编辑:包括来自 steamforge 的内容:

注释

  • Scrapy 必须与 Python 2.5、2.6 或 2.7(不是 3.x)一起安装
  • Python 2.7(和 3.2)不加载正确的 32 位兼容
    Windows 注册表项

安装过程

  1. 下载和安装安装 Python 2.7.2(使用 Windows Installer)
    http://www.python.org/getit/
  2. 转到搜索程序和文件 开始底部的栏
    菜单并输入“regedit”并按 Enter
  3. 使用左窗格导航到
    “HKEY_LOCAL_MACHINE\SOFTWARE\Python” &单击它(突出显示
    蓝色)

    1. 选择分支后,转到文件 -->导出
    2. 将文件保存在您可以轻松访问的位置
    3. 在您喜欢的文本编辑器中打开文件
    4. 在“SOFTWARE”和“\Python”之间插入“\Wow6432Node”
      每行(一个简单的方法是查找并替换
      在查找字段中输入“SOFTWARE”,在字段中输入“SOFTWARE\Wow6432Node”
      替换字段
    5. 保存文件
    6. 导航到您保存该文件的位置,然后双击它
      启动注册表修改
  4. 现在从以下位置下载 Scrapy 0.14 Windows 安装程序
    http://pypi.python.org/pypi/Scrapy

  5. 双击 Scrapy 安装程序,一切都应该工作正常。
  6. 下载并安装适用于 Python 2.7 64 位的 Twisted 11.1.0
    http://twistedmatrix.com/trac/wiki/Downloads
  7. 下载并安装 Zope。界面

    1. 从以下位置下载 distribution_setup.py
      http://python-distribute.org/distribute_setup.py(右键单击
      &保存),然后双击安装
    2. 从以下位置下载 zope.interface-3.8.0-py2.6-win-amd64.egg
      http://pypi.python.org/pypi/zope.interface/3.8 .0#下载
    3. 打开命令提示符(在相同的搜索程序中键入“cmd”
      和文件
      窗格如上)并导航到您的 Python 脚本
      文件夹(类似于“cd C:\Python27\Scripts”)
    4. 输入“easy_install
      C:\Downloads\zope.interface-3.8.0-py2.6-win-amd64.egg”
      (将 C:\Downloads\ 替换为您下载的位置
      Zope.Interface to)并按 Enter
  8. 下载并安装 lxml-2.3.2.win-amd64-py2.7.‌exe
    http://www.lfd.uci.edu/~gohlke/pythonlibs/

  9. 下载并安装
    egenix-pyopenssl-0.13.0_1.0.0g_1.win-amd64-py2.7.msi 来自
    http:// /www.egenix.com/cryptodownload/?file=egenix-pyopenssl-0.13.0_1.0.0g_1.win-amd64-py2.7.msi

    • 当它要求您导航到 Python 2.6 目录时,只需
      将其指向您的 Python 2.7 目录(默认为 C:\Python27)
  10. 安装 w3lib

    1. 打开命令提示符(开始 -> 搜索程序和文件 ->
      “cmd”)
    2. 导航到您的 Python 脚本文件夹(名义上
      “C:\Python27\Scripts”)
    3. 输入“easy_install w3lib”并按 Enter
  11. 现在我们只需要将 Python Scripts 文件夹添加到系统路径
    所以我们可以使用scrapy

    1. 单击“开始菜单”按钮,然后右键单击“计算机”,然后
      选择“属性”
    2. 点击左侧栏中的“高级系统设置”
    3. 点击“环境变量...”
    4. 在(下部)系统变量窗格中找到“Path”变量
      并双击它
    5. 单击“变量值:”窗格并点击“结束”按钮
    6. 键入或粘贴“;C:\Python27\Scripts\”(修改为任意位置)
      你安装了Python)在该行的末尾
    7. *请务必不要干扰或更改其中的任何现有信息
    8. 点击“确定”、“确定”、“确定”、“X”

Actually, step 9 at this website will resolve your issue.

http://steamforge.net/wiki/index.php/How_to_Install_Scrapy_in_64-bit_Windows_7

EDIT: Including the content from steamforge:

Notes

  • Scrapy must be installed with Python 2.5, 2.6, or 2.7 (NOT 3.x)
  • Python 2.7 (and 3.2) do not load the correct 32-bit compatible
    Windows Registry Keys

Install Procedure

  1. Download & install Python 2.7.2 (using the Windows Installer) from
    http://www.python.org/getit/
  2. Go to the Search programs and files bar at the bottom of the start
    menu and type “regedit” and hit enter
  3. Using the left pane navigate to
    “HKEY_LOCAL_MACHINE\SOFTWARE\Python” & click on it (highlighting
    it in blue)

    1. With the branch selected go to File --> Export
    2. Save the file somewhere you can get to it easily
    3. Open the file in your favorite text editor
    4. Insert "\Wow6432Node" inbetween “SOFTWARE” and "\Python" on
      every line (an easy way to do this is to do a find and replace
      with “SOFTWARE” in the Find Field and “SOFTWARE\Wow6432Node” in
      the Replace Field
    5. Save the file
    6. Navigate to where you saved said file and double click on it to
      initiate a Registry Modification
  4. Now download the Scrapy 0.14 Windows installer from
    http://pypi.python.org/pypi/Scrapy

  5. Double click the Scrapy Installer and everything should work fine.
  6. Download and install Twisted 11.1.0 for Python 2.7 64 bit from
    http://twistedmatrix.com/trac/wiki/Downloads
  7. Download and install Zope.Interface

    1. Download distribute_setup.py from
      http://python-distribute.org/distribute_setup.py (right click
      & save), then double click it to install
    2. Download zope.interface-3.8.0-py2.6-win-amd64.egg from
      http://pypi.python.org/pypi/zope.interface/3.8.0#downloads
    3. Open a command prompt (type “cmd” into the same Search programs
      and files
      pane as above) and navigate to your Python Scripts
      folder (something like “cd C:\Python27\Scripts”)
    4. type “easy_install
      C:\Downloads\zope.interface-3.8.0-py2.6-win-amd64.egg”
      (replacing C:\Downloads\ with wherever you downloaded
      Zope.Interface to) and hit enter
  8. Download and install lxml-2.3.2.win-amd64-py2.7.‌exe from
    http://www.lfd.uci.edu/~gohlke/pythonlibs/

  9. Download and install
    egenix-pyopenssl-0.13.0_1.0.0g_1.win-amd64-py2.7.msi from
    http://www.egenix.com/cryptodownload/?file=egenix-pyopenssl-0.13.0_1.0.0g_1.win-amd64-py2.7.msi

    • When it asks you to navigate to a Python 2.6 Directory, just
      point it to your Python 2.7 Directory (C:\Python27 by default)
  10. Install w3lib

    1. Open a command prompt (Start -> Search programs and files ->
      “cmd”)
    2. Navigate to your Python Scripts Folder (nominally
      “C:\Python27\Scripts”)
    3. Type “easy_install w3lib” and hit enter
  11. Now we just need to add the Python Scripts folder to the System Path
    so we can use scrapy

    1. Click the “Start Menu” button and Right Click on “Computer” and
      select “Properties”
    2. Click “Advanced system settings” in the left bar
    3. Click “Environment Variables...”
    4. Find the “Path” variable in the (lower) System variables Pane
      and double click on it
    5. Click in the “Variable value:” pane and hit the “End” button
    6. Type, or paste, ";C:\Python27\Scripts\" (modify for wherever
      you installed Python) at the end of the line
    7. *Be sure not to disturb or change any of the existing information there
    8. Hit OK, OK,OK, X
够运 2024-10-27 21:19:52

您的问题是未安装 PyOpenSSL。你没有说,但我从你的问题推断你已经安装了 32 位版本的 PyOpenSSL,但使用的是 64 位版本的 Python。那是行不通的。

如果您确实无法获得 64 位版本的 PyOpenSSL,那么最简单、也可能是唯一的解决方案是安装 32 位版本的 Python、Scrapy 及其所有依赖项。如果您有勇气,那么您可以尝试从 64 位源代码进行编译,但我对 PyOpenSSL 的了解不够,无法判断这是否实用。

Your problem is that PyOpenSSL is not installed. You don't say, but I infer from your question that you have installed a 32 bit version of PyOpenSSL but are using a 64 bit version of Python. That won't work.

If you really can't get a 64 bit version of PyOpenSSL, then the simplest, and possibly the only, solution will be to install 32 bit versions of Python, Scrapy and all its dependencies. If you are feeling brave then you could attempt to compile from source for 64 bit but I don't know enough about PyOpenSSL to say whether or not that's practical.

孤蝉 2024-10-27 21:19:52

eGenix.com 提供 Windows 32 位和 64 位安装程序。我刚刚下载并安装了 Python 2.6 的 Windows 64 位安装程序,它解决了我的问题。

eGenix.com provides Windows 32-bit and 64-bit installers. I just downloaded and installed the Windows 64-bit installer for Python 2.6 and it resolved my issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文