How to add modules and library in PortablePython

1,761 views
Skip to first unread message

alvas

unread,
Jan 25, 2010, 11:58:46 PM1/25/10
to PortablePython
Hi there,

I am new to portablepython and also python programming (I am new to
programming in fact), I apologize if I ask any dumb questions.

I wanna parse HTML pages with python, I searched the web and found
people recommend a module "lxml", so I decide to add this module to my
portablepython, but I have no clue how to install it as it requires
two libraries, 'libxml2' and 'libxslt'. I am wondering how can I
install those libraries to my portablepython as well as the "lxml"
modules.

Should I just extract the content of the tarballs and put them into
the site-package folder, import sys, and append the sys.path in my
code?

Thank you all for your kindly attention and help, and also for all the
effort developing the portable python.

P.S. I have put my portablepython into my flash drive so that I can
carry it around.

Perica Zivkovic

unread,
Jan 26, 2010, 4:19:55 AM1/26/10
to PortablePython
Hi there,

have you tried built-in python markup parsing libraries?
http://docs.python.org/library/markup.html

Adding libraries to PP can be as easy as you describe if they are pure
python libraries or pretty complicated if they have references to
other libraries/dlls.

You can try to use easy install in PP but keep in mind following:
- easy install has a bug in PP 2.6.1, how to solve it is described
here: http://groups.google.com/group/portablepython/browse_thread/thread/5cc217f34b895541?hl=en_US
- using easy install can install dlls to your local system and that
will make your PP installation NON PORTABLE. So when you take your USB
stick to another PC, not all PP features will work.

How to use easy install:
- open command prompt
- change directory to your PP root\App directory where python.exe is
located
- execute command: "Scripts\easy_install.exe package_name" where
package_name is name of package you want to install (lxml?)

hope this helps,

keep pythoning,

Perica

alvas

unread,
Jan 26, 2010, 12:39:19 PM1/26/10
to PortablePython
Thank you very much for your reply.

No, I haven't tried the built-in python markup parsing libraries yet.
When I searched on the web,
I found people say that lxml seems more efficient, so I decide to give
it a try.

Another reason to use lxml may sound stupid,
as I am such a newbie,
I thought it could be a chance for me to learn how to import modules/
libraries.

But now it seems it's not that easy to import such kind of modules/
libraries to portablepython
(as it have references to another two libraries),
I will try the built-in library first.

Really appreciate for you help.
Thank you very much.

Alvas

On Jan 26, 5:19 pm, Perica Zivkovic <perica.zivko...@gmail.com> wrote:
> Hi there,
>

> have you tried built-in python markup parsing libraries?http://docs.python.org/library/markup.html


>
> Adding libraries to PP can be as easy as you describe if they are pure
> python libraries or pretty complicated if they have references to
> other libraries/dlls.
>
> You can try to use easy install in PP but keep in mind following:
> - easy install has a bug in PP 2.6.1, how to solve it is described

> here:http://groups.google.com/group/portablepython/browse_thread/thread/5c...

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages