View Single Post

   
  #13 (permalink)  
Old 02-21-2008, 05:33 AM
zentara
 
Posts: n/a
Default Re: Installing python modules from source in Slackware 12

On Sun, 19 Aug 2007 09:36:07 -0700, Jeffrey Froman <jeffrey@fro.man>
wrote:

>Peter wrote:
>
>> Perl and Python programs must be installed in the language's installation
>> directory, period.

>
>I don't know about Perl, but this statement is absolutely false as far as
>Python modules are concerned. Python modules can be stored anywhere on
>your "python path",
>Jeffrey


Same with Perl. When you install, a Perl binary is installed at
/usr/bin/perl (or /usr/local/bin/perl ).

When perl is invoked, it looks at it's "internally defined" build
location, where all the modules are installed. (i.e. /usr/lib/perl5 )

When you install a Perl module, thru the normal install process,
Perl will automatically store it in the correct location.

If you want to "manually" install a module, you will need to copy
it in to Perl's build directory manually. This may be what you are
talking about, as your problem, and is risky, because Perl has
a highly structured modules directory system.

What you are supposed to do, is setup the ENV variable PERL5LIB
In .bashrc

export PERL5LIB=$PERL5LIB:/home/zentara/perl5lib

Now you can manually put any modules in that directory.



BUT.... don't confuse modules with programs.
To run a Perl script, you usually make the shebang line point
to perl, like the top line of script should be:
#!/usr/bin/perl or maybe #!/usr/local/bin/perl

or run
perl scriptname
(here perl is found in the path, usually /usr/bin/perl)
and it takes the script as first argument on the commandline.

So Perl scripts can be located anywhere on your system,
just like a bash shell script.

Hope that clears things up,
zentara


--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Reply With Quote