Error when starting scrapy project - python-2.7

Any time i try scrapy crawl [name] I get the following error
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2793, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 673, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 576, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: Scrapy==0.24.5
I'm not sure what it is I'm missing, I've tried following suggestions from other similar questions but nothing is working! Any help would be appreciated.

Managed to figure it out. For some reason the pip install Scrapy was not completely installing so I downloaded the tarball from the website and then followed the instructions here and it now works!

Related

Error message after installing fontmake: "No module named py23"

I've installed, uninstalled, reinstalled FontTools and Fontmake via pip.
However, whenever I try to call Fontmake in terminal I get the following error. Py23 appears to be a Fonttools dependency, which is also installed.
Thanks in advance for any help!
Traceback (most recent call last):
File "/usr/local/bin/fontmake", line 9, in
load_entry_point('fontmake==1.3.1.dev0', 'console_scripts', 'fontmake')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2394, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2108, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/Library/Python/2.7/site-packages/fontmake/main.py", line 18, in
from fontmake.font_project import FontProject
File "/Library/Python/2.7/site-packages/fontmake/font_project.py", line 37, in
from defcon import Font
File "/Library/Python/2.7/site-packages/defcon/init.py", line 10, in
from defcon.objects.font import Font
File "/Library/Python/2.7/site-packages/defcon/objects/font.py", line 6, in
from ufoLib import UFOReader, UFOWriter
File "/Library/Python/2.7/site-packages/ufoLib/init.py", line 6, in
from fontTools.misc.py23 import basestring, unicode
ImportError: No module named py23
I fixed this by installing Fonttools from the source files, instead of installing with pip.

imoprt error when I gave source toaster start in morty

I got below error when i run poky/build$ source toaster start.
The system will start.
Traceback (most recent call last):
File "/home/siva/yocto/Morty/poky/bitbake/bin/../lib/toaster/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
......
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/siva/.local/lib/python3.5/site-packages/django/contrib/contenttypes/apps.py", line 7, in <module>
from .management import update_contenttypes
ImportError: cannot import name 'update_contenttypes'
I have seen the below link but I believe That is diiferent than this.
importerror: cannot import name update _all_content
I believe you are using two yocto sources like krogoth and morty.
krogoth depends on python2 and pip
morty depends on python3 and pip3
It might have confused things. So please use below command:
rm -rf /home/siva/.local/lib/python3.5/site-packages/django
You can import like that,
from YourPackageName.management import update_contenttypes

Error on QSTK.qstkstudy on Python 2.7.3

I am trying to install QSTK on my python 2.7.3. (on windows 10). During the installation, it seemed there was no problem and I did not face any errors. However, when I run the validation.py (here) to check it seems that QSTK.qstkstudu cannot be imported. Here is the error that I get while running validation.py:
QSTK is installed and can be imported
[...]
QSTK.qstkutil is installed and can be imported
File "C:\Python27\lib\site.py", line 372, in __call__
raise SystemExit(code)
SystemExit: Error : QSTK.qstkstudy can not be imported.
Does anyone have a clue what should I do?
The line in Validation.py which produces the error is:
import QSTK.qstkstudy.EventProfiler
If you try it directly in python, you can see what is missing. In my case it was tkinter.
>>> import QSTK.qstkstudy.EventProfiler
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkstudy/EventProfiler.py", line 16, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 114, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module>
from matplotlib.externals.six.moves import tkinter as Tk
File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 199, in load_module
mod = mod._resolve()
File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 113, in _resolve
return _import_module(self.mod)
File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 80, in _import_module
__import__(name)
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package
I am on Linux so I did
sudo apt-get python-tk
Google how to install python tkinter in Windows.
Good luck

django 1.9.5 testing tutorial

I am new to Django 1.9.5, when trying the tutorial part 5 in the official website.
I followed their instructions and coded the tests.py file found here: https://docs.djangoproject.com/en/1.9/intro/tutorial05/
But when I run it, this is what I got:
ImportError: Failed to import test module: polls.tests
Traceback (most recent call last):
File "C:\Python27\lib\unittest\loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "C:\Python27\lib\unittest\loader.py", line 232, in _get_module_from_name__import__(name)
File "C:\Users\--\Desktop\Django\mysite\polls\tests.py", line 11, in <module>class QuestionMethodTests(TestCase):
File "C:\Users\--\Desktop\Django\mysite\polls\tests.py", line 20, in QuestionMethodTests
self.assertEqual(future_question.was_published_recently(), False)
NameError: name 'self' is not defined
Can any Django experts help me to understand the why is this happening and how do I solve it.
Thank you so much!

i have installed scrapy, but get error when i execute "scrapy startproject tutorial"

I have the following output, what is the reason?
bater:test001 apple$ scrapy startproject tutorial
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 4, in
import pkg_resources
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
pkg_resources.DistributionNotFound: Scrapy==0.16.1