Suddenly, scrapy stops working - python

I was using scrapy framework which is running fine. But suddenly today when i crawl my spider, i experience this error
2018-06-25 21:33:22 [scrapy.utils.log] INFO: Scrapy 1.5.0 started
(bot: sam_amazon) Traceback (most recent call last): File
"C:\Users\sa\Anaconda3\Scripts\scrapy-script.py", line 5, in
sys.exit(scrapy.cmdline.execute()) File "C:\Users\sa\Anaconda3\lib\site-packages\scrapy\cmdline.py", line 149,
in execute
cmd.crawler_process = CrawlerProcess(settings) File "C:\Users\sa\Anaconda3\lib\site-packages\scrapy\crawler.py", line 252,
in init
log_scrapy_info(self.settings) File "C:\Users\sa\Anaconda3\lib\site-packages\scrapy\utils\log.py", line
149, in log_scrapy_info
for name, version in scrapy_components_versions() File "C:\Users\sa\Anaconda3\lib\site-packages\scrapy\utils\versions.py",
line 35, in scrapy_components_versions
("pyOpenSSL", _get_openssl_version()), File "C:\Users\sa\Anaconda3\lib\site-packages\scrapy\utils\versions.py",
line 43, in _get_openssl_version
import OpenSSL File "C:\Users\sa\Anaconda3\lib\site-packages\OpenSSL__init__.py", line 8,
in
from OpenSSL import crypto, SSL File "C:\Users\sa\Anaconda3\lib\site-packages\OpenSSL\crypto.py", line 16,
in
from OpenSSL._util import ( File "C:\Users\sa\Anaconda3\lib\site-packages\OpenSSL_util.py", line 6, in
from cryptography.hazmat.bindings.openssl.binding import Binding File
"C:\Users\sa\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py",
line 13, in
from cryptography.hazmat.bindings._openssl import ffi, lib ImportError: DLL load failed: The operating system cannot run %1.
I have tried to uninstall and install scrapy again. But it did not work. Please help. I am stuck with this error.

Could you please download ,
https://github.com/python/cpython-bin-deps/tree/openssl-bin-1.0.2k
unzip it and copy it to
In your sys path : C:\Windows\SysWOW64?
This seems like openssl error on windows
**line 13**, in from cryptography.hazmat.bindings._openssl import ffi, lib ImportError: DLL load failed: The operating system cannot run %1.

My Problem is solved by installing the previous version of openssl.

Related

DLL Error when trying to launch Jupyter notebook

Getting below error when trying to launch jupyter notebook. Any help to address this error is appreciated.
_cffi_ext.c C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend\cffi__pycache___cffi_ext.c(213):
fatal error C1083: Cannot open include file: 'sys/un.h': No such file
or directory Traceback (most recent call last): File
"C:\Users\emathew004\anaconda3\Scripts\jupyter-notebook-script.py",
line 6, in
from notebook.notebookapp import main File "C:\Users\emathew004\anaconda3\lib\site-packages\notebook\notebookapp.py",
line 47, in
from zmq.eventloop import ioloop File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq__init__.py",
line 47, in
from zmq import backend File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend__init__.py",
line 40, in
reraise(*exc_info) File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py",
line 34, in reraise
raise value File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend__init__.py",
line 27, in
_ns = select_backend(first) File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend\select.py",
line 28, in select_backend
mod = import(name, fromlist=public_api) File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend\cython__init__.py",
line 6, in
from . import (constants, error, message, context, ImportError: DLL load failed: The specified module could not be found
I've also had this problem, which I solved as follows.
conda uninstall pyzmq (uninstall pyzmq)
conda install pyzmq (reinstall pyzmq)
conda install jupyter (reinstall jupyter)
You need a corresponding version of visual c++ redistribution.

cryptography.hazmat.bindings._openssl import ffi, lib ImportError: DLL load failed:

Getting the following error on Win10 when trying to connect spyder to the remote kernel:
Traceback (most recent call last):
File "C:\Users\a010735\AppData\Local\Continuum\anaconda3\lib\site-packages\paramiko\transport.py", line 2010, in run
self._handler_table[ptype](self, m)
File "C:\Users\a010735\AppData\Local\Continuum\anaconda3\lib\site-packages\paramiko\transport.py", line 2126, in _negotiate_keys
self.kex_engine.start_kex()
File "C:\Users\a010735\AppData\Local\Continuum\anaconda3\lib\site-packages\paramiko\kex_ecdh_nist.py", line 32, in start_kex
self._generate_key_pair()
File "C:\Users\a010735\AppData\Local\Continuum\anaconda3\lib\site-packages\paramiko\kex_ecdh_nist.py", line 53, in _generate_key_pair
self.P = ec.generate_private_key(self.curve, default_backend())
File "C:\Users\a010735\AppData\Local\Continuum\anaconda3\lib\site-packages\cryptography\hazmat\backends\__init__.py", line 15, in default_backend
from cryptography.hazmat.backends.openssl.backend import backend
File "C:\Users\a010735\AppData\Local\Continuum\anaconda3\lib\site-packages\cryptography\hazmat\backends\openssl\__init__.py", line 7, in <module>
from cryptography.hazmat.backends.openssl.backend import backend
File "C:\Users\a010735\AppData\Local\Continuum\anaconda3\lib\site-packages\cryptography\hazmat\backends\openssl\backend.py", line 62, in <module>
from cryptography.hazmat.bindings.openssl import binding
File "C:\Users\a010735\AppData\Local\Continuum\anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 14, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: DLL load failed: The specified procedure could not be found.
*** Failed to connect to 10.144.20.72:22: ImportError('DLL load failed: The specified procedure could not be found.')
Since I had the same issue I'm doing some Necromancy on this question:
My Solution is more of a workaround then anything else. I assume you are using anaconda since you mention spyder. My problem seems to have arisen form using pip to install pysftp into the anaconda environment. I had to uninstall anaconda, revert to my original python environment and there it worked without any problems.
Since I like spyder I installed it via pip into that environment...works so far

Scrapy: Project can't be created

I'm currently following the Scrapy tutorial and am at the step where there's a creation of a project, however this error is produced everytime I run the command scrapy startproject tutorial.
Error:
Traceback (most recent call last):
File "C:\Users\Me\Miniconda3\Scripts\scrapy-script.py", line 10, in <module>
sys.exit(execute())
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\cmdline.py", line 149, in execute
cmd.crawler_process = CrawlerProcess(settings)
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\crawler.py", line 252, in __init__
log_scrapy_info(self.settings)
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\utils\log.py", line 149, in log_scrapy_info
for name, version in scrapy_components_versions()
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\utils\versions.py", line 35, in scrapy_components_versions
("pyOpenSSL", _get_openssl_version()),
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\utils\versions.py", line 43, in _get_openssl_version
import OpenSSL
File "C:\Users\Me\Miniconda3\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "C:\Users\Me\Miniconda3\lib\site-packages\OpenSSL\crypto.py", line 16, in <module>
from OpenSSL._util import (
File "C:\Users\Me\Miniconda3\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "C:\Users\Me\Miniconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: DLL load failed: The specified procedure could not be found.
I suspected that the issue is in my installation of Scrapy, so I tried reinstalling Scrapy(first via pip then conda) but it still doesn't fix the problem. I then tried to install the packages that Scrapy needed(one by one) but it's still not fixing anything.
How do I go about fixing this?
Can you try to install Win64OpenSSL_Light-1_0_2h and reinstall cryptography?
pip install -I cryptography
See this existing answer.

Scrapy certificate_transparency error

I'm triying to use scrapy on Windows 10. There is no problem in installation, but when I use scrapy command on cmd there is always the following error
C:\Users\Isaias HL\Desktop\noticias\noticias\spiders\spider_cbr.py:6: ScrapyDeprecationWarning: Module `scrapy.spider` is deprecated, use `scrapy.spiders` instead
from scrapy.spider import CrawlSpider, Rule
2018-02-16 15:11:52 [scrapy.utils.log] INFO: Scrapy 1.5.0 started (bot:
noticias)
Traceback (most recent call last):
File "C:\Users\Isaias HL\Anaconda2\Scripts\scrapy-script.py", line 5, in
<module>
sys.exit(scrapy.cmdline.execute())
File "C:\Users\Isaias HL\Anaconda2\lib\site-packages\scrapy\cmdline.py",
line 149, in execute
cmd.crawler_process = CrawlerProcess(settings)
File "C:\Users\Isaias HL\Anaconda2\lib\site-packages\scrapy\crawler.py",
line 252, in __init__
log_scrapy_info(self.settings)
File "C:\Users\Isaias HL\Anaconda2\lib\site-packages\scrapy\utils\log.py",
line 149, in log_scrapy_info
for name, version in scrapy_components_versions()
File "C:\Users\Isaias HL\Anaconda2\lib\site-
packages\scrapy\utils\versions.py", line 35, in scrapy_components_versions
("pyOpenSSL", _get_openssl_version()),
File "C:\Users\Isaias HL\Anaconda2\lib\site-
packages\scrapy\utils\versions.py", line 43, in _get_openssl_version
import OpenSSL
File "C:\Users\Isaias HL\Anaconda2\lib\site-packages\OpenSSL\__init__.py",
line 8, in <module>
from OpenSSL import crypto, SSL
File "C:\Users\Isaias HL\Anaconda2\lib\site-packages\OpenSSL\crypto.py",
line 12, in <module>
from cryptography import x509
File "C:\Users\Isaias HL\Anaconda2\lib\site-
packages\cryptography\x509\__init__.py", line 7, in <module>
from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency
Installing https://pypi.org/project/ctutlz/ fixed the issue for me.
pip install ctutlz

Problems getting twill installed and working in python 2.7

I installed twill by using pip, and another try using easy_install, I want to play around with it in Powershell. Following this page - http://twill.idyll.org/ I wanted to play around with it.
To start using twill, install it and then type twill-sh. At the prompt type:
go http://www.slashdot.org/
show
showforms
showhistory
When I type twill-sh it doesn't work. I have typed it in power shell, tried it after loading python, and tried it after using import twill and trying it. I only get errors.
Traceback (most recent call last):
File "C:\Python27\Scripts\twill-sh-script.py", line 9, in <module>
load_entry_point('twill==1.8.0', 'console_scripts', 'twill-sh')()
File "build\bdist.win32\egg\pkg_resources.py", line 356, in load_entry_point
File "build\bdist.win32\egg\pkg_resources.py", line 2439, in load_entry_point
File "build\bdist.win32\egg\pkg_resources.py", line 2155, in load
File "C:\Python27\lib\site-packages\twill\__init__.py", line 52, in <module>
from shell import TwillCommandLoop
File "C:\Python27\lib\site-packages\twill\shell.py", line 9, in <module>
from twill import commands, parse, __version__
File "C:\Python27\lib\site-packages\twill\commands.py", line 7, in <module>
from lxml import html
How do I just load modules so I can play with them without writing scripts?
I had the same problem. Further down the log I found the following:
File "C:\Anaconda\lib\site-packages\lxml\cssselect.py", line 18, in <module> raise ImportError('cssselect seems not to be installed. '
ImportError: cssselect seems not to be installed. See http://packages.python.org/cssselect/
Which I fixed by installing package cssselect (using conda as I have an Anaconda installation, pip should do the same).
conda install cssselect

Categories

Resources