Python assistance
- Login to post comments
Tue, 07/12/2011 - 08:57
I just upgraded the server to Debian Squeeze, and I guess the Python API for xpath has changed. I've tried using Python 2.5, and I've installed all XML/Python related Debian packages, but I still get:
Traceback (most recent call last): File "./draw-tower.py", line 7, in <module> from xml import xpath ImportError: cannot import name xpath
Anyone know how to fix this? Or, if it needs to be rewritten to use a new API, can anyone volunteer for this?
-davidc
Hmm, maybe contact Daft as Brush? He worked with Python when he made Goo editors...
My Gooish profile | Videos on YouTube | My WOG Mods
This is the problem?
*facepalm.jpg*
There's a fix for this, but for which operating system do you need it?
I tweet like a bird
I have a lame website
*facepalm.jpg*
*lern2read.jpg*
IRC | Chapter Tutorial | Reference Guide
It had completely slipped my mind that Debian Squeeze was an actual OS. :3
Anyway, seems you need Python-XML installed. Here's a search:
http://packages.debian.org/search?keywords=python-xml
I tweet like a bird
I have a lame website
No problem. Just keeping you in line here.
IRC | Chapter Tutorial | Reference Guide
See, python-xml isn't listed as available for Squeeze, I think it's outdated or something.
From further searching I can tell you, yes, it's outdated. There's no version available for Squeeze anywhere. You may have to change your API.
I tweet like a bird
I have a lame website
python-lxml
from lxml import etree
instead of
from xml import xpath
And some changes to code needed
I can try to look at the code
or you can install python-xml from oldstable Package: python-xml (0.8.4-10.1+lenny1)
which needs python 2.5
you must add a line for oldstable in /etc/apt/souces.list
copy the one with stable and change to oldstable
(if you do not know this allerady)
which makes the problem to hide until Debian 7.0
OK, just so you guys know I know NOTHING of all this stuff. But I did a bit of Googling and this looks like it could be helpful. This also seems related to the issue.
Sorry I can't help more, hope this does at all.
New GooFans Rules | My Addins
Sweet! Send those links to David.
I tweet like a bird
I have a lame website
Get something here with IronPython 2.7.1:
Maybe you can try
__path__
?IronPython can import .NET types directly, I don't know if it works on your device.
By the way, why couldn't I visit this website few hours ago?
| Things I made | And even more |
Drupal was saying something about the site being disconnected from its database? IDK.
Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.
IDK either. All davidc said on the chat about it was "that was odd".
IRC | Chapter Tutorial | Reference Guide
It was pretty weird, but it was probably just a minor server failure or the like. In any case I'm glad it's back up
EDIT: Oh, and I emailed David. Hoping for a reply before too long.
New GooFans Rules | My Addins
He told me that his MySQL was misbehaving...
Check out my SoundCloud, MomoSoundWaves
So does all this have anything to do with the leaderboards being annoying?
Check out my SoundCloud, MomoSoundWaves
Please don't double post, momo - but instead edit your previous post.
I think this thread has been asleep long enough for me to double post. This is something quite important if you hadn't noticed. And wiki, if something is wrong with me double posting a mod will tell me, thank you very much.
Check out my SoundCloud, MomoSoundWaves
Yes, wiki, you're not a mod, so please don't act like one. 8 days is a reasonable timespan to wait before bumping a thread.
I don't think the MySQL problem has anything to do with the leaderboard issues, as the leaderboard parsing problem is because of XML errors, not SQL errors. I have seen davidc pushing changes to GooTool's svn recently, though, so he might possibly be working on the leaderboard problems as well. No guarantees.
IRC | Chapter Tutorial | Reference Guide
That would be cool. Not that I have anything special to upload!
Check out my SoundCloud, MomoSoundWaves
Actually, I'm pretty sure editing a post bumps it too (on this forum). Although double-posting is still OK after such a long time.
New GooFans Rules | My Addins
I've been recoding the leaderboards in PHP today. It's mostly done now, just needs some anti-DoS protection, and generation of the main leaderboard images, so it'll be live 'soon'.
In related news, with these changes I just made the 500th commit to goofans' SVN repository! \o/
15:40 <@sargasso> [SVN goofans r489] by david: broaden compatibility of background linear-gradient
16:12 <@sargasso> [SVN goofans r490] by david: convert level data loading from python
16:20 <@sargasso> [SVN goofans r491] by david: cache level data in memcache
17:24 <@sargasso> [SVN goofans r492] by david: decode profiles using new php functions rather than external python script
17:57 <@sargasso> [SVN goofans r493] by david: fix ocd and lost function header
18:12 <@sargasso> [SVN goofans r494] by david: fix ocd achieement detection. fix x/y coordinates of balls. fix min/max dimensions.
18:12 <@sargasso> [r494] fix tower height scaled by 100.
18:12 <@sargasso> [r494] don't convert to xml or generate images on the initial upload.
18:13 <@sargasso> [SVN goofans r495] by david: move gooprofile_load_profile out of gooprofile.upload.inc as it will be used on-demand
19:02 <@sargasso> [SVN goofans r496] by david: generate the profile html on-the-fly from profile.dat
19:13 <@sargasso> [SVN goofans r497] by david: link to autogenerated tower images (not yet done)
20:41 <@sargasso> [SVN goofans r498] by david: tower drawing implemented in php and made on-demand
20:46 <@sargasso> [SVN goofans r499] by david: use a different temp dir for live and dev sites
20:50 <@sargasso> [SVN goofans r500] by david: don't regenerate the tower image if it already exists
-davidc
hey davidc, haven't seen you in a while!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
i am glad the leaderboards are almost up. It has been a long time. thanks for stoping by!
-_-
Haha! Sounds great! That was a big part of the site before.
I tweet like a bird
I have a lame website
That looks good!
Check out my SoundCloud, MomoSoundWaves
Like you dunno why I'm doing this... By the way better would be if you DIDN'T double post - it would make more sence and people would better understand you. You could have wrote like:
So does all this have anything to do with the leaderboards being annoying?
But lets not discuss this... Either from now on I'm not double posting - no matter what reason (It's still the same - words )
GREAT!!!
| Things I made | And even more |
You used up more space by attempting to correct me.
Check out my SoundCloud, MomoSoundWaves
I just edited momo1526's post above (added a space at the end) to see if it would bump the topic. It didn't. Double-posting is the only way to do so. End of argument.
IRC | Chapter Tutorial | Reference Guide
Well, maybe it doesn't bump the thread, but I'm almost positive that it adds the "1 new message" to the Tracker and forums. Which is kind of like bumping.
In any case, let's say that double-posting is fine for the purpose of thread bumping.
About the leaderboards news... AWESOME! Hope to see them back up soon!
New GooFans Rules | My Addins