Debian unstable


Forum: Apt-get
Topic: Debian unstable
started by: mgmont

Posted by mgmont on Aug. 09 2005,03:09
There is an extension in the Debian unstable group of aps for Python called Python-parallel which allows you to directly control the parallel port from Python.  Since I am fairly new to both linux and DSL, I have not figured out how to load this extension.  Can it be loaded with Apt-get or Synaptic some way?  any help or suggestions would be greatly appreciated.
Posted by kopsis on Aug. 10 2005,03:48
The "best" way to get pyParallel installed depends on both how you're running DSL (Live CD, frugal, HD install) and how you're running Python (.dsl extension, .uci extension, apt-get install, etc.). Give me some more details and I should be able to narrow things down to a couple suggestions.
Posted by mgmont on Aug. 10 2005,11:54
Thanks for the reply, Kopsis,  I am running a frugal install on a cf to ide adapter.  I have tried both versions of Python as I am still experimenting and rying to learn as much as I can.  At the present I am using the uci version.  I also have a usb hard drive that I attach to the system when I am experimenting.  This provides me with a swap partition and room to store other things.  My goal is to have everything on  cf after I learn all the fundamentals.

Thanks,

Mel

Posted by Max on Aug. 10 2005,14:07
Assuming you have apt loaded (dsl-dpkg), then edit /etc/apt/sources.list  (you'll need to edit as root)  There is one line that is already uncommented.  Change the word "stable" to "unstable".  Save the file, then "apt-get update"  You should be go to go after that
Posted by mgmont on Aug. 10 2005,14:59
Thanks for the tip, Max.  I will have to try that tonight when I get home.
Posted by kopsis on Aug. 10 2005,16:58
I have my doubts that apt-get'ing a Python module is going to be compatible with the .uci Python extension. Apt is most likely going to tell you that you need to install *all* of the base Python packages (since apt doesn't know about .uci extensions). That will chew up tons of ramdisk and sort of defeats the whole DSL extension concept. If you bypass apt and just dpkg -i the package directly, it will not get installed in /opt where the Python .uci lives and as such probably won't work correctly.

I think what will work better is getting the actual module source from Sourceforge and using Python distutils to install it in a way that will be compatible with your .uci Python extension. That may sound complicated but it's actually quite simple. I'm downloading the pieces I need to try that out now (over a brutally slow internet connection). Once I can validate this approach, I'll post more detailed instructions.

Posted by kopsis on Aug. 10 2005,18:21
Ok, the following steps will install the pyParallel Python module to work with the standard python.uci MyDSL extension. It's also likely to work with the python.dsl MyDSL extension, but I haven't tested that. This technique should work fine for Live CD, frugal, and HD installs.

Note that everything installed using the technique below will end up in your /home/dsl directory making it easy to preserve through DSL's normal backup/restore functionality. Also note that this technique will work with pretty much any Python module that is designed for installation via distutils (which is almost all publicly released Python stuff) and is pure Python (doesn't require compiling any C code).

Ok, here we go ...

1) Get the source code for the module. In this case you can download pyParallel from < its Sourceforge project page >. Save the file to your /dsl/home/ directory.

2) Extract the contents of the zipfile. Open an Aterm and use the command "unzip pyparallel-0.2.zip".

3) Go to the directory with the extracted source files ("cd pyparallel-0.2").

4) Install using the command "/opt/python/bin/python setup.py install --home=~"

At that point the pyParallel module is installed. To test it do the following:

1) Set your PYTHONPATH environment variable so Python can locate modules in your home dir ("export PYTHONPATH=/home/dsl/lib/python"). Note that the setting described here should let Python find any number of modules installed following this technique -- you don't have to add each individual module directory to the PYTHONPATH.

2) Run Python ("/opt/python/bin/python").

3) Load the module ("import parallel") ... if it loads without errors you're good to go!

If the module loads, you can clean up /home/dsl/ by deleting the "pyparallel-0.2.zip" file and the "pyparallel-0.2" directory.

That's all there is to it. A variation on this is to use the command ("/opt/python/bin/python setup.py install --prefix=somepath") where "somepath" is the full path to the directory where you want the module files installed. This allows installing directly to a mounted hard disk partition instead of your /home/dsl/ directory. Just remember to set your PYTHONPATH environment variable accordingly. I prefer the --home technique because it keeps the PYTHONPATH simple and keeps all my installed Python modules in my backup.tar.gz so they're easily moved to from one DSL system to another.

Posted by mgmont on Aug. 11 2005,00:31
I appreciate all your efforts, Kopsis.  However I am hung up on the second step.  When I try to  unzip the file, I type:

unzip pyparallel-0.2.zip

It returns the following message:

unzip:  pyparallel-0.2/README.txt:  No such file or directory

I tryed downloading it several times thinking that maybe I had a bad download, but the results are always the same.  Any ideas?

Posted by kopsis on Aug. 11 2005,02:09
Grab the gnu-utils mydsl package and load it up. I've heard that unzip in DSL's Busybox is a bit broken.
Posted by mgmont on Aug. 11 2005,03:53
Thanks again for all your efforts, Kopsis.  That did the trick.  After I installed gnu-utils, everything worked per your instructions.  Now I just need to learn how to put this all to good use.

I really appreciate all you have done and I hope this will also help others with the same interests.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.