scrapyd error while deploying with scrapyd-client - python

While executing the command:
scrapyd-deploy default
I'm runnning into an error saying:
File"/home/user/miniconda3/envs/quickcompany/lib/python3.8/site-packages/scrapyd_client/deploy.py", line 23, in <module>
from scrapy.utils.http import basic_auth_header
ModuleNotFoundError: No module named 'scrapy.utils.http'
I have tried uninstalling and resinstalling the relevant libraries.
Also tried using both the github and packaged versions of scrapyd-client.

Little Modification to LuisA310 solution, it should be from w3lib.http import basic_auth_header for scrapyd-client==1.2.0a1

Twisted versions before 18.9 used scrapy.utils.http (which is deprecated) if you want to use scrapyd-client change from scrapy.utils.http import basic_auth_header to from w3lib.http import basic_auth_header in the scrapyd-deplo.py file although I would recommend you not to use deprecated packages.

For those wondering about the answer, there was a glitch in the library. I tried upgrading scrapyd client and it seemed to work fine from there on out

Related

ImportError: cannot import name 'YamlModel' from 'pydantic_yaml'

I am working at blender script, where I want to use YAML. So I try to import it:
from pydantic import BaseModel
from pydantic_yaml import YamlModel
But when I run my script, this error will occure:
ImportError: cannot import name 'YamlModel' from 'pydantic_yaml' (C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\lib\site-packages\pydantic_yaml\__init__.py)
I have installed pydantic and pydantic_yaml on both Pythons (Blender one and the common one), if they wouldn't be installed, there would be different error. I tried googling, but google had very few results for this problem. Also, when I open that __init__.py file, there is clearly YamlModel. Thank you for any kind of help.
I found the same error and it is related how pydantic-yaml got installed.
There is a bug in the package. you need to install optional dependencies as well (so called extras).
pip install pedantic-yaml[pyyaml,ruamel]
or manually install pyyaml ruamel please make sure that that Taumel version is <=0.18

ModuleNotFoundError: No module named 'allennlp.data.iterators'

In Google colab I am to trying import BucketIterator using:
from allennlp.data.iterators import BucketIterator
But it is raising the same error again and again-
ModuleNotFoundError: No module named 'allennlp.data.iterators
After installing allennlp with the imports:
from allennlp.data.token_indexers import TokenIndexer, SingleIdTokenIndexer
from allennlp.data.tokenizers.character_tokenizer import CharacterTokenizer
from allennlp.data.vocabulary import Vocabulary
from allennlp.modules.seq2vec_encoders import PytorchSeq2VecWrapper
are working fine. Is there a way to solve this issue?
I was facing the same issue.
It won't work, since Iterators are removed from allennlp.
Install a legacy version of allennlp. allennlp is depended upon the PyTorch(torchtext) library. And since torchtext removed iterators form their newer versions allennlp did it too.
You can directly use torchtext.data.BucketIterator(). Use:
pip install torchtext==0.5.0 --user

Wagtail Tinymce - ModuleNotFoundError: No module named 'wagtail.wagtailadmin'

I'm trying to install the package "wagtailtinymce" already downloaded it, however, the repository tutorial is completely bad. I do not know if it's because of some update or something. I'm using the latest version of wagtail and I already have a project created (obvious).
The error is in every import the package tries to make, and since I'm starting in Django and Wagtail, I do not know what to do. I have not been able to migrate the application yet because of this error.
File "/mnt/sda3/Development/Projetos/blog-wagtail/env/lib/python3.7/site-packages/wagtailtinymce/wagtail_hooks.py", line 37, in <module>
from wagtail.wagtailadmin.templatetags.wagtailadmin_tags import hook_output
ModuleNotFoundError: No module named 'wagtail.wagtailadmin'
File "/mnt/sda3/Development/Projetos/blog-wagtail/env/lib/python3.7/site-packages/wagtailtinymce/wagtail_hooks.py", line 29, in <module>
from django.core.urlresolvers import reverse
ModuleNotFoundError: No module named 'django.core.urlresolvers'
The import of django passed when I changed to "from django.urls import reverse" but the rest I do not know what to do, and I believe it will continue to give error every import
Looking at the documentation, https://github.com/isotoma/wagtailtinymce#wagtail-tinymce , this module is compatible with Wagtail 1.5 and currently we are in the 2.3 version.
As mentioned, the pip package for wagtailtinymce is not up to date for latest versions of wagtail.
However, the github repo of the package has a branch named wagtail40 which is compatible with the latest version.
To install, instead of using pip install wagtailtinymce, use pip install git+https://github.com/isotoma/wagtailtinymce.git#wagtail40 and following other steps mentioned in the docs should work.
Tested in Django==4.1.2 and wagtail==4.0.4

Python module from GitHub installed using setup.py can't see own submodules

I downloaded python-somelib-master.zip from GitHub hoping to use the API it provides. I ran
python setup.py install
And it apparently completed successfully:
Writing D:\SOFT\Python3\Lib\site-packages\python-somelib-1.0-py3.5.egg-info
which then introduced D:\SOFT\Python3\Lib\site-packages\somelib.
However, when I try to import something from there in my script:
from somelib import SubModule
I get
File "D:\SOFT\Python3\lib\site-packages\somelib\__init__.py", line 1, in <module>
from base import SubModule
ImportError: No module named 'base'
I confirmed that base.py is present in D:\SOFT\Python3\Lib\site-packages\somelib.
Did I not properly install the module?
You must install modules dependencies in your machine too. If you are using Ubuntu, you can easily do it with "apt-get". Hope it helps! xD

'ImportError: No module named decorator' in google app engine

I have added a validators library to my google app engine by manually adding the code to a folder lib/validators. Then in my code I added this line
from validators.utils import ValidationFailure
When I run my app I got an exception from this line:
from validators.utils import ValidationFailure
File "lib/validators/__init__.py", line 1, in <module>
from .between import between
File "lib/validators/between.py", line 2, in <module>
from .utils import validator
File "lib/validators/utils.py", line 5, in <module>
from decorator import decorator
ImportError: No module named decorator
If I run from decorator import decorator in the python intrepretor, it works as expected.
However when I tried it in the 'interactive console' in the local development server, I got the same error
How can I resolve this exception?
This worked for me, I installed the decorator package specifically for Python 3.4:
sudo python3.4 -m pip install decorator # specifically Python 3.4
I need to copy the decorator.py and its dependency six.py into the same 'lib' folder.
For python3 or above, use
sudo apt-get install python3-decorator
If you're using anaconda, the best approach is to install it through conda install decorator.
I hope you find it useful.
I create the symbolic links like previous answer said, but doesn't work for me.
I have to download the source package
https://pypi.python.org/pypi/decorator#downloads
and I have reinstalled it manually "$ python setup.py install"
And It worked

Categories

Resources