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 9076579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:08:36+00:00 2026-06-16T19:08:36+00:00

I have removed MacPorts from my Mac (10.7.5) and now Python seems to be

  • 0

I have removed MacPorts from my Mac (10.7.5) and now Python seems to be broken. I am trying to run scrapy and I get the following error at the end:

ImportError: dlopen(/Library/Python/2.7/site-packages/lxml-2.3.4-py2.7-macosx-10.7-intel.egg/lxml/etree.so, 2): Symbol not found: _exsltDateXpathCtxtRegister
  Referenced from: /Library/Python/2.7/site-packages/lxml-2.3.4-py2.7-macosx-10.7-intel.egg/lxml/etree.so
  Expected in: /usr/lib/libexslt.0.dylib
 in /Library/Python/2.7/site-packages/lxml-2.3.4-py2.7-macosx-10.7-intel.egg/lxml/etree.so

When I run python and try to import that library, I get the same error as following:

$ python
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 14:13:39) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Python/2.7/site-packages/lxml-2.3.4-py2.7-macosx-10.7-intel.egg/lxml/etree.so, 2): Symbol not found: _xsltDocDefaultLoader
  Referenced from: /Library/Python/2.7/site-packages/lxml-2.3.4-py2.7-macosx-10.7-intel.egg/lxml/etree.so
  Expected in: flat namespace
 in /Library/Python/2.7/site-packages/lxml-2.3.4-py2.7-macosx-10.7-intel.egg/lxml/etree.so

How can I clean up this mess now?

  • 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-16T19:08:38+00:00Added an answer on June 16, 2026 at 7:08 pm

    Assuming this is the system Python, and you installed lxml into it via pip, and the version of libxml2 that comes with 10.7.5 is good enough for you (I think they started shipping somewhat recent versions in 10.7—as in 2.7.x—but I can’t remember for sure), it should be as simple as:

    sudo pip uninstall lxml
    sudo pip install lxml
    

    The problem here is that lxml was built against MacPorts libxml2/libxslt2, instead of against your system versions. Theoretically it might be possible to just repoint the dependencies with install_name_tool, but that’s more likely to fail miserably—or, if you’re really unlucky, to seem to work but then crash when you really need it… Just re-building lxml should fix the problem. And if you used pip, that’s as easy as uninstall/reinstall.

    If you didn’t use pip, re-doing the manual sudo python setup.py install from a clean copy of the tarball, or re-doing the sudo easy_install lxml, or doing a sudo pip install lxml over top of what you already have, will probably work, but that isn’t guaranteed.

    If I’m wrong about Lion coming with decent libxml2, please say so in a comment, and I’ll give you the options for getting it (without reinstalling MacPorts).

    If you want to be really sure you’ve cleaned everything, you can always restore your system site-packages to their default state just by doing this:

    sudo rm -rf /Library/Python/2.7/site-packages/*
    rm -rf ~/Library/Python/2.7/site-packages/*
    

    Then, of course, you’ll have to reinstall anything you installed. (If you didn’t use pip last time, start with sudo easy_install pip and then use pip for everything else…) You can get a pretty good idea of exactly what you have installed just by doing an ls on those same directories, but that won’t necessarily tell you how you installed everything. (For example, I’ve got a couple packages I installed with pip install git+https://some.site/some/repo, or from a binary installer, or in one case I have absolutely no idea…) So, consider this the nuclear option if you’ve got no other choice—not a first resort, but better than the thermonuclear option of reinstalling OS X.

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

Sidebar

Related Questions

Since it's integration to the framework, the package seems to have been removed from
I have removed a data directory from my java source code. now when i
I have removed the PrimaryKey from my table, refreshed the EDMX, and now I
Note: I have removed all required error checking in the following snippet. ... void
There is my site For SEO I have removed the .php extension from all
I have the following case: Edited: removed link In IE7 gives me different view
It didn't have a project and I removed myself as the assignee, now I
I have removed all unrelated code from the script below in an attempt to
Windows knows when you have removed the network cable from your NIC. Is there
I have a file that I have removed from subversion, however in the mean

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.