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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:27:07+00:00 2026-05-25T19:27:07+00:00

I just installed lxml for parsing xml file in python. I am using TextMate

  • 0

I just installed lxml for parsing xml file in python. I am using TextMate as an IDE. Problem is that when I try to import lxml (from lxml import entree) then I get

ImportError:’No module named lxml’

But when I use Terminal then everything is fine

Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
>>> root=etree.element("root")
>>> root=etree.Element("root")
>>> print (root.tag)
root
>>> root.append(etree.Element("child1"))
>>> child2 = etree.SubElement(root, "child2")
>>> child3 = etree.SubElement(root, "child3")
>>> print (etree.tostring(root,pretty_print=True))
<root>
  <child1/>
  <child2/>
  <child3/>
</root>

It’s pretty weird. Does it have something to do with TextMate?

Suggestion Please!

  • 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-05-25T19:27:07+00:00Added an answer on May 25, 2026 at 7:27 pm

    This most probably means that you have more than one python installation on your system and that TextMate and the Terminal using different ones by default.

    One workaround: In your python file, you can specify an interpreter directive to point to the python installation (and executable) of your choice:

    #!/usr/local/bin/python
    # Even thought standard python is in /usr/bin/python, here we want another ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using python 2.6 on XP. I have just installed py2exe, and I
Just installed the Silverligh 5 SDK RC. There is a problem using it inside
Just installed the latest SDK for iPhone 2.1. When I go to File ->
I just installed Java 1.6_07 so I could try profiling with VisualVM. It tells
I just installed the first release candidate of Python 3.0 and got this error
Just installed snow leopard and Xcode, i downloaded version 5.1.38 from the mysql website
Just installed django-db-log module and trying to make it work properly. 'python manage.py syncdb'
I just installed a slideDown panel from the FAST QUOTE button on the top
I just installed HTTP_Download using Pear install --alldeps, and it installed successfully. However, when
I just installed Python 2.7, but IDLE is currently broken on OS X 10.6.4.

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.