Python(Scrapy) unpredictable mistake with import load_entry_point

2024/11/17 21:39:36

I have such problem, I did nothing with Python or Scrapy, but when I started today my computer I got such error. I have found many different posts and tried some tips and advices, unfortunately, they are do not work properly and I worry not to break something else.

Traceback (most recent call last):File "/usr/bin/scrapy", line 5, in <module>from pkg_resources import load_entry_pointFile "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>working_set = WorkingSet._build_master()File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 444, in _build_masterws.require(__requires__)File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 725, in requireneeded = self.resolve(parse_requirements(requirements))File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolveraise DistributionNotFound(req)
pkg_resources.DistributionNotFound: service-identity

Therefore, maybe someone had the same error. If yes, please, let me know how you solved it.

UPDATE: I have tried many things and direct search was without real results, only Python & Scrapy: Issue with Scrapy version was helpful, I have deleted Scrapy and installed it again. Magic, but it works.

Answer

I had a similar issue back then and It was because the Ubuntu package was messing with the pip package.

I recommend you to remove both packages from Ubuntu and Pip and then reinstall.

First remove scrapy with all local config file from ubuntu by following command :

apt-get remove --purge python-scrapy

pip uninstall scrapy

After these actions finished you can reinstall it using following commands.Now version should be 0.24.4.

  1. Import the GPG key used to sign Scrapy packages into APT keyring:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv627220E7

  1. Create /etc/apt/sources.list.d/scrapy.list file using the following command:

echo 'deb http://archive.scrapy.org/ubuntu scrapy main' | sudo tee/etc/apt/sources.list.d/scrapy.list

3.Update package lists and install the scrapy-0.24 package:

sudo apt-get update && sudo apt-get install scrapy-0.24

It should work :)

https://en.xdnf.cn/q/118751.html

Related Q&A

Debugging RadioButtons program in Python

from Tkinter import *class Application (Frame):def __init__(self, master):Frame.__init__(self, master)self.grid()self.create_widgets()def create_widgets(self):Label(self, text = "Select the last b…

Why am I getting an Internal Server error

My python script runs just fine on the Apache server locally set up on my computer, however, on importing the json2html library I am getting an internal server errorThe moment I comment the import stat…

Save pixel data in txt format in PIL

My program is to extract the pixel from an image and to save the pixel data in the text file for analysis. My picture is a binary image that gives only 255 and 0 sHere is the program:from PIL import Im…

ValueError: view limit minimum 0.0 is less than 1 and is an invalid Matplotlib date value

Ive been given the python script where matplotlib is used , when running the script it opens the window and display graph. its working perfectly on my laptop. But this error occurs when I upload the fi…

Python win32com Outlook Stores not iterable

Trying to list all Outllook stores (and finally all e-mails in those stores):import win32com.clientoutlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") sto…

Using a users input to search dictionary keys and print that keys matching value

I am working with tkinter, as I have my gui set up with and entry, label, and button. Im trying to search my dictionarys keys with the users input from the entry, and print the value of the key that wa…

How to write CSV into the next column

I have output that I can write into a CSV. However, because of how i setup my XML to text, the output iterates itself incorrectly. Ive tried a lot to fix my XML output, but I dont see any way to fix it…

Comparing date from pandas dataframe to current date

Im currently trying to write a script that does a specific action on a certain day. So for example, if today is the 6/30/2019 and in my dataframe there is a 6/30/2019 entry, xyz proceeds to happen. How…

How to divide a binary file to 6-byte blocks in C++ or Python with fast speed? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 5…

Selenium, python dynamic table

Im creating a robot with selenium that get all info from agencies in Brasil, ive alredy done the permutation click between all States and counties, all i have to do nows click in all agencies and get i…