gpt4 book ai didi

python - 无法使用 Scrapy dist-packages/cryptography/hazmat/bindings/_openssl.so 启动项目

转载 作者:太空宇宙 更新时间:2023-11-03 17:08:10 26 4
gpt4 key购买 nike

我不熟悉在 unix 和 python 中安装包。我正在 Windows 上的 Ubuntu 上使用 Bash。我想开始学习 Scrapy,我安装它使用:

apt-get install scrapy

当我尝试创建项目时,出现以下错误:

root > scrapy startproject tutorial
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 11, in <module>
sys.exit(execute())
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 128, in execute
cmds = _get_commands_dict(settings, inproject)
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 46, in _get_commands_dict
cmds = _get_commands_from_module('scrapy.commands', inproject)
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 29, in _get_commands_from_module
for cmd in _iter_command_classes(module):
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 19, in _iter_command_classes
for module in walk_modules(module_name):
File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/misc.py", line 71, in walk_modules
submod = import_module(fullpath)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/scrapy/commands/version.py", line 6, in <module>
import OpenSSL
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/crypto.py", line 16, in <module>
from OpenSSL._util import (
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/_openssl.so: cannot enable executable stack as shared object requires: Invalid argument

我确认上述文件可用。我试图了解是否有任何我错过安装的先决条件(我对此表示怀疑,因为我知道它们是在安装过程中处理的 - 如果我错了请纠正我),或者我需要什么启用。

谢谢,萨西

最佳答案

你不应该使用 apt-get 来安装 scrapy,因为它有很旧的版本。你应该像下面那样做

apt install -y python python-pip

然后在下面使用安装scrapy

pip install --force --upgrade scrapy

关于python - 无法使用 Scrapy dist-packages/cryptography/hazmat/bindings/_openssl.so 启动项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46713640/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com