Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8697729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:35:34+00:00 2026-06-13T01:35:34+00:00

>>> import scrapy >>> from scrapy.selector import HtmlXPathSelector Traceback (most recent call last): File

  • 0
>>> import scrapy
>>> from scrapy.selector import HtmlXPathSelector
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/Scrapy-0.14.4-py2.7.egg/scrapy/selector  /__init__.py", line 28, in <module>
    from scrapy.selector.lxmlsel import *
  File "/usr/local/lib/python2.7/site-packages/Scrapy-0.14.4-py2.7.egg/scrapy/selector /lxmlsel.py", line 7, in <module>
    from scrapy.utils.misc import extract_regex
  File "/usr/local/lib/python2.7/site-packages/Scrapy-0.14.4-py2.7.egg/scrapy/utils/misc.py", line 7, in <module>
    from w3lib.html import remove_entities
  File "/usr/local/lib/python2.7/site-packages/w3lib-1.2-py2.7.egg/w3lib/html.py", line 10, in <module>
    from w3lib.url import safe_url_string
  File "/usr/local/lib/python2.7/site-packages/w3lib-1.2-py2.7.egg/w3lib/url.py", line 11, in <module>
    import cgi
  File "/usr/local/lib/python2.7/cgi.py", line 51, in <module>
    import mimetools
  File "/usr/local/lib/python2.7/mimetools.py", line 6, in <module>
    import tempfile
  File "/usr/local/lib/python2.7/tempfile.py", line 34, in <module>
    from random import Random as _Random
  File "/usr/local/lib/python2.7/random.py", line 45, in <module>
    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
  File "math.py", line 3, in <module>
   from scrapy.selector import HtmlXPathSelector
ImportError: cannot import name HtmlXPathSelector

I am using python2.7, I used to work on ubuntu and I never faced this kind of problem, but in CentOS I am getting this error, by the way I installed scrapy thats why you can see the first command working perfectly.

>>> import scrapy
>>> from scrapy.selector import HtmlXPathSelector

One more thing, what “from scrapy.selector import HtmlXPathSelector” has to do with math.py which is in the same folder

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:35:35+00:00Added an answer on June 13, 2026 at 1:35 am

    Well … This is not a problem with you, rather with CentOS vs. Ubuntu.

    How did you install it? using pip or yum?

    If you installed it from yum most likely the package is broken…
    (just out of curiosity, it would be good to know where you downloaded the package from).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my spider from scrapy.contrib.spiders import CrawlSpider,Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.selector
I am new to Python and am getting this error: Traceback (most recent call
This is the BaseSpider example from the Scrapy tutorial: from scrapy.spider import BaseSpider from
from string import join from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.contrib.spiders.crawl import Rule, CrawlSpider from
I am a newbie. This is my spider: from scrapy.contrib.spiders import CrawlSpider, Rule from
Here is my code. My parse_item method is not getting called. from scrapy.contrib.spiders import
import MySQLdb import sys from libdesklets.controls import Control from IDBConnection import IDBConnection class DBConnection(Control,
import httplib2 from urllib import urlencode h = httplib2.Http() h.add_credentials('zackster@gmail.com', 'PassWord') data = dict(key=ThisIsMyApiKeyICopiedAndPastedIt)
This is my code: from xgoogle.search import GoogleSearch, SearchError import urllib, urllib2, sys, argparse
I want to be able to run the Scrapy web crawling framework from within

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.