473,799 Members | 3,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Have I broken my installation?

Hi folks,

I have an old Linux box that I am messing about with Python on. The
RedHat installed version is 1.5 something so I have built & installed
2.2.2 in /opt/python.

I've started trying to play with XML and ran into an error when
attempting to parse a document:
Traceback (most recent call last):
File "/mnt/hugedisk/share/MattsMovableTyp e/stb/stb.cgi", line 90, in ?
documentElem = parse( rssFile )
File "/opt/python/lib/python2.2/xml/dom/minidom.py", line 962, in parse
return _doparse(pulldo m.parse, args, kwargs)
File "/opt/python/lib/python2.2/xml/dom/minidom.py", line 953, in _doparse
events = apply(func, args, kwargs)
File "/opt/python/lib/python2.2/xml/dom/pulldom.py", line 328, in parse
parser = xml.sax.make_pa rser()
File "/opt/python/lib/python2.2/xml/sax/__init__.py", line 93, in make_parser
raise SAXReaderNotAva ilable("No parsers found", None)
xml.sax._excep tions.SAXReader NotAvailable: No parsers found
Googling around it seems like I needed to build XML support when I
built Python. I'm not sure what I should have done differently when I
built in order to make that happen. The other option on offer
appeared to be installing PyXML.

I duly downloaded PyXML 0.8.2 and installed it (again into /opt/python
using --prefix).

Now instead of the previous error I get a different problem entirely:
Traceback (most recent call last):
File "/mnt/hugedisk/share/MattsMovableTyp e/stb/stb.cgi", line 18, in ?
from xml.dom.minidom import parse, Document
File "./xml.py", line 2, in ?
from xml.dom.minidom import parse
ImportError: No module named dom.minidom


I'm pretty sure I had a module dom.minidom before as it is the import
statement that is raising the exception and it didn't prior to
installing PyXML, I was previously calling parse() and Document().

So did I make a mistake installing PyXML? Can anyone advise me on
what my next steps should be?

Many thanks,

Matt

---
Systems Engineer, Hipbone(EMEA) Ltd.
3000 Hillswood drive, Chertsey, Surrey, KT16 0RS
Tel: 44-1932-895902 Mob: 44-7980-237-380
Jul 18 '05 #1
10 5618
Matt Mower <mm****@novissi o.com> writes:
Googling around it seems like I needed to build XML support when I
built Python. I'm not sure what I should have done differently when I
built in order to make that happen.
You should have edited Modules/Setup, to activate pyexpat. Before
that, you probably should have installed a more recent Expat version
than the one shipped with Redhat.
Now instead of the previous error I get a different problem entirely:
Traceback (most recent call last):
File "/mnt/hugedisk/share/MattsMovableTyp e/stb/stb.cgi", line 18, in ?
from xml.dom.minidom import parse, Document
File "./xml.py", line 2, in ?
from xml.dom.minidom import parse
ImportError: No module named dom.minidom


I'm pretty sure I had a module dom.minidom before as it is the import
statement that is raising the exception and it didn't prior to
installing PyXML, I was previously calling parse() and Document().

So did I make a mistake installing PyXML?


This is uncertain. Does this also happen when you invoke Python from
the command line? If so, what happens if you do

import xml
print xml
import xml.dom
print xml.dom
import xml.dom.minidom
print xml.dom.minidom

If not, what happens if you do the same in the CGI script?

Regards,
Martin
Jul 18 '05 #2
Hi Martin,

Thanks for responding. My answers are below.

On 28 Jun 2003 17:53:52 +0200, ma****@v.loewis .de (Martin v. Löwis)
wrote:
I'm pretty sure I had a module dom.minidom before as it is the import
statement that is raising the exception and it didn't prior to
installing PyXML, I was previously calling parse() and Document().

So did I make a mistake installing PyXML?


This is uncertain. Does this also happen when you invoke Python from
the command line? If so, what happens if you do

import xml
print xml
import xml.dom
print xml.dom
import xml.dom.minidom
print xml.dom.minidom


It turns out I made a bad choice naming my test program 'xml.py'. I
discovered that these commands failed in the directory I was working
on the script in, but succeeded elsewhere.

I guess I didn't realise that my local files could interfere with
importing from Pythons libraries. Stupid mistake on my part!

Thanks again!

Matt

---
Systems Engineer, Hipbone(EMEA) Ltd.
3000 Hillswood drive, Chertsey, Surrey, KT16 0RS
Tel: 44-1932-895902 Mob: 44-7980-237-380
Jul 18 '05 #3
Matt Mower <mm****@novissi o.com> writes:
Nothing in the environment or access to the file system suggests to me
why it works as for my account but not for the nobody account.


So I'll ask my questions again: Print xml, xml.dom, xml.dom.minidom
both in the interactive mode and the CGI script.

Martin

Jul 18 '05 #4
Hi Martin,

On 28 Jun 2003 19:49:58 +0200, ma****@v.loewis .de (Martin v. Löwis)
wrote:
Matt Mower <mm****@novissi o.com> writes:
Nothing in the environment or access to the file system suggests to me
why it works as for my account but not for the nobody account.


So I'll ask my questions again: Print xml, xml.dom, xml.dom.minidom
both in the interactive mode and the CGI script.


Sorry, sometimes I don't listen so good.

Interactively as user 'nobody':

|>>> import xml
|>>> print xml
|<module 'xml' from '/opt/python/lib/python2.2/xml/__init__.pyc'>
|>>> import xml.dom
|>>> print xml.dom
|<module 'xml.dom' from '/opt/python/lib/python2.2/xml/dom/__init__.pyc'>
|>>> import xml.dom.minidom
|>>> print xml.dom.minidom
|<module 'xml.dom.minido m' from '/opt/python/lib/python2.2/xml/dom/minidom.pyc'>

via CGI webserver running as user 'nobody':

|<module 'xml' from '/opt/python/lib/python2.2/xml/__init__.pyc'>
|<module 'xml.dom' from '/opt/python/lib/python2.2/xml/dom/__init__.pyc'>
|<module 'xml.dom.minido m' from '/opt/python/lib/python2.2/xml/dom/minidom.pyc'>

Regards,

Matt

---
Systems Engineer, Hipbone(EMEA) Ltd.
3000 Hillswood drive, Chertsey, Surrey, KT16 0RS
Tel: 44-1932-895902 Mob: 44-7980-237-380
Jul 18 '05 #5
Matt Mower <mm****@novissi o.com> writes:
|>>> import xml
|>>> print xml
|<module 'xml' from '/opt/python/lib/python2.2/xml/__init__.pyc'>
|>>> import xml.dom
|>>> print xml.dom
|<module 'xml.dom' from '/opt/python/lib/python2.2/xml/dom/__init__.pyc'>
|>>> import xml.dom.minidom
|>>> print xml.dom.minidom
|<module 'xml.dom.minido m' from '/opt/python/lib/python2.2/xml/dom/minidom.pyc'>


And you said you have PyXML installed? This sounds unlikely: minidom
would come from site-packages/_xmlplus if you had.

Regards,
Martin
Jul 18 '05 #6
I think you should have installed a recent version of Expat.

-aj

--On Samstag, 28. Juni 2003 16:23 Uhr +0100 Matt Mower
<mm****@novissi o.com> wrote:
Hi folks,

I have an old Linux box that I am messing about with Python on. The
RedHat installed version is 1.5 something so I have built & installed
2.2.2 in /opt/python.

I've started trying to play with XML and ran into an error when
attempting to parse a document:
Traceback (most recent call last):
File "/mnt/hugedisk/share/MattsMovableTyp e/stb/stb.cgi", line 90, in ?
documentElem = parse( rssFile )
File "/opt/python/lib/python2.2/xml/dom/minidom.py", line 962, in parse
return _doparse(pulldo m.parse, args, kwargs)
File "/opt/python/lib/python2.2/xml/dom/minidom.py", line 953, in
_doparse events = apply(func, args, kwargs)
File "/opt/python/lib/python2.2/xml/dom/pulldom.py", line 328, in parse
parser = xml.sax.make_pa rser()
File "/opt/python/lib/python2.2/xml/sax/__init__.py", line 93, in
make_parser raise SAXReaderNotAva ilable("No parsers found", None)
xml.sax._except ions.SAXReaderN otAvailable: No parsers found


Googling around it seems like I needed to build XML support when I
built Python. I'm not sure what I should have done differently when I
built in order to make that happen. The other option on offer
appeared to be installing PyXML.

I duly downloaded PyXML 0.8.2 and installed it (again into /opt/python
using --prefix).

Now instead of the previous error I get a different problem entirely:
Traceback (most recent call last):
File "/mnt/hugedisk/share/MattsMovableTyp e/stb/stb.cgi", line 18, in ?
from xml.dom.minidom import parse, Document
File "./xml.py", line 2, in ?
from xml.dom.minidom import parse
ImportError: No module named dom.minidom


I'm pretty sure I had a module dom.minidom before as it is the import
statement that is raising the exception and it didn't prior to
installing PyXML, I was previously calling parse() and Document().

So did I make a mistake installing PyXML? Can anyone advise me on
what my next steps should be?

Many thanks,

Matt

---
Systems Engineer, Hipbone(EMEA) Ltd.
3000 Hillswood drive, Chertsey, Surrey, KT16 0RS
Tel: 44-1932-895902 Mob: 44-7980-237-380
--
http://mail.python.org/mailman/listinfo/python-list


Jul 18 '05 #7
Hi Martin,

On 28 Jun 2003 20:24:19 +0200, ma****@v.loewis .de (Martin v. Löwis)
wrote:
Matt Mower <mm****@novissi o.com> writes:
|>>> import xml
|>>> print xml
|<module 'xml' from '/opt/python/lib/python2.2/xml/__init__.pyc'>
|>>> import xml.dom
|>>> print xml.dom
|<module 'xml.dom' from '/opt/python/lib/python2.2/xml/dom/__init__.pyc'>
|>>> import xml.dom.minidom
|>>> print xml.dom.minidom
|<module 'xml.dom.minido m' from '/opt/python/lib/python2.2/xml/dom/minidom.pyc'>


And you said you have PyXML installed? This sounds unlikely: minidom
would come from site-packages/_xmlplus if you had.


The installation instructions that came with my PyXML distro (0.8.2)
said to execute:

python setup.py build
python setup.py install

I made one small adjustment, specifying the --prefix=/opt/python
option to put PyXML in the same directory as Python 2.2.

My entire Python developing experience runs to about an afternoons
worth so I have no idea why PyXML isn't working or isn't being found.

Can you suggest anything?

Thanks,

Matt

---
Systems Engineer, Hipbone(EMEA) Ltd.
3000 Hillswood drive, Chertsey, Surrey, KT16 0RS
Tel: 44-1932-895902 Mob: 44-7980-237-380
Jul 18 '05 #8
On Sat, 28 Jun 2003 21:40:12 +0200, Andreas Jung
<li***@andrea s-jung.com> wrote:
I think you should have installed a recent version of Expat.


You and Martin were both correct. This was the essential step.

|<module '_xmlplus' from '/opt/python/lib/python2.2/site-packages/_xmlplus/__init__.pyc'>
|<module 'xml.dom' from '/opt/python/lib/python2.2/site-packages/_xmlplus/dom/__init__.pyc'>
|<module 'xml.dom.minido m' from '/opt/python/lib/python2.2/site-packages/_xmlplus/dom/minidom.pyc'>

Which is what I think Martin was expecting to see earlier.

My thanks to you both.

Regards,

Matt

Jul 18 '05 #9
Matt Mower wrote:
Looks like I spoke a little too soon.

The minimal test script:

from xml.dom.minidom import parse, Document
doc = parse( "...some file..." )
print doc

works, spitting out a reference to a minidom instance.

However the CGI script which is, in a roundabout way, doing exactly
the same thing still comes up with the error:


Whenever there's a difference in behavior between a program in your
shell and in CGI (or someone else's shell), it's almost certainly a
difference in paths. You said that you installed some Python utilities
into some nonstandard places (like /opt/python); that's likely what your
problem is.

--
Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ Every astronaut who goes up knows the risks he or she faces.
\__/ Sally Ride
Jul 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1607
by: Nick | last post by:
I am using the original relaese (1.0?) of Visual Studio.NET. Whenever I search for a help topic, all the results come back with a title of "a". Yes, just the letter "a". I can click on them, and they actually lead to relevent topics, it's just the title in the search results window that's messed up. I tried re-installing the help files, but that didn't solve anything. I did another installation on a different machine and it works fine,...
0
1469
by: Michał Januszczyk | last post by:
Hello. I've got the following problem: I created a windows installer project that installs my application. The application works with some files. I want to include some example files with the installation package. These files by no means are critical for the application itself. They are included only to help application user to get aquaintanced with the app.
15
6225
by: Jake | last post by:
Not sure if this can be done with javascript but I would like to find a way to detect if an image is missing and replace it with a default image instead of the dreaded RED X showing up. So - Is Javascript the way? Or should I look elesewhere? Thanks in Advance!
87
5368
by: Sony Music CDs install Malware | last post by:
Whether you are a web surfer or a C++ developer, if you use Windows be cautioned about SONY music CDs. They contain 'viewer' type software that is actually a trojan horse for a "rootkit". The licence agreement gives no indication whatsoever that the 'viewer' software contains the implementation of a nasty near-impossible to remove rootkit software. http://www.sysinternals.com/blog/2005/10/sony-rootkits-and-digital-rights.html ...
1
12629
by: ImageAnalyst | last post by:
Yay!!! They fixed this for VS2005. You can now set the default installation to be "Everyone" instead of "Just Me" and you can control whether you even want those radio button installed in your Setup program. >From the Documentation http://msdn2.microsoft.com/en-us/library/5f981xa1.aspx =========================================================== "The InstallAllUsers property for a deployment project determines whether an application is...
13
2162
by: Steven Bethard | last post by:
Jean-Paul Calderone <exarkun@divmod.comwrote: Interesting. Could you give a few illustrations of this? (I didn't run into the same problem at all, so I'm curious.) Steve
9
2500
by: Endless Story | last post by:
My last version of Python was 2.4, running smoothly on XP with path c: \Python24 - no need even to include this path in PATH; everything worked as it's supposed to at the command line. Just installed Python 2.5, after uninstalling 2.4 (and also 2.3 which had lingered). Now if I open a shell in Windows Python is not available! Here are the symptoms: - If I open a shell using "Command line here" with XP Powertools, then enter "python"...
2
1621
by: Bruno Rezende | last post by:
Hi, I think I've broken my python installation (don't know how). All the packages that are under 'lib' in python installation doesn't work the way expected: Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'dom'
5
3778
by: Larry Bates | last post by:
Info: Python version: ActivePython 2.5.1.1 Platform: Windows I wanted to install BeautifulSoup today for a small project and decided to use easy_install. I can install other packages just fine. Unfortunately I get the following error from BeautifulSoup installation attempt: C:\Python25\Lib\SITE-P~1>easy_install BeautifulSoup
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10228
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.