Question

I am trying to install python-pyparsing onto my debian etch but running into issues when I run sudo apt-get install python-pyparsing_1.4.2-1.1_all.deb. Seems to give me this error here

Reading package lists... Done
Building dependency tree... Done
W: Couldn't stat source package list http://archive.debian.org etch/main Packages (/var/lib/apt/lists/archive.debian.org_debian_dists_etch_main_binary-i386_Packages) -stat (2 No such file or directory)
W: You may want to run apt-get update to correct these problems
E: Couldn't find package python-pyparsing_1.4.2-1.1_all.deb

I've run apt-get update but it tells me again same error and then

E: Some index files failed to download, they have been ignored, or old ones used instead.

UPDATE

I now have apt-get install -f trying to install my python-pyparsing_1.4.2-1.1_all.deb file and it reads back:

Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package python-pyparsing_1.4.2-1.1_all.deb

I'm not getting the run apt-get update anymore. Is there a directory I need to have this in? I have it inside my /mnt/hgfs/ directory at this time.

Any help is greatly appreciated on how to get pyparsing installed for this debian

Was it helpful?

Solution 2

The name of the package is python-pyparsing. You are using the package file name, which is composed of the package name, version, and architecture, with a .deb extension to boot.

The correct command line is

sudo apt-get install python-pyparsing

The package toolchain takes care of finding a suitable version for your architecture, and downloading it from a suitable repository. (apt-cache policy python-pyparsing will tell you which versions are available.)

If you require this specific version, use

sudo apt-get install python-pyparsing=1.4.2-1.1

provided it is available from one of the Apt sources you have configured.

(If you have a deb file which you have downloaded, you can install that with dpkg:

sudo dpkg -i path/to/python-pyparsing_1.4.2-1.1_all.deb

but you should normally never need to do this. dpkg doesn't download missing dependencies or do much anything you don't specifically ask it to.)

OTHER TIPS

If you're trying to install Pyparsing for development purposes (that is, you're writing a program that uses Pyparsing, rather than just trying to install another deb that has Pyparsing as a dependency), you shouldn't use your distribution's package manager.

Instead, create a virtualenv (http://www.virtualenv.org/en/latest/) to develop your application, and use the supplied distribute dependency management system.

Virtualenvs are self-contained Python environments that don't have access to any of the Python modules you have installed system-wide (and can even, if you want, use a different version of Python than your system). Instead, they download and install (in themselves) all the dependencies of the programs/libs you want to run within them.

The advantages to that approach are the following:

  • You're not limited to the libs and versions present in your distribution's package manager (which are often outdated -- for example, Pyparsing is currently at version 2.0.1, unlike Debian's 1.4.2).
  • You can ensure that the dependencies of your program/lib are correctly documented in its setup.py, instead of working by sheer luck because you have something installed system-wide that you forgot about 6 months ago.
  • Furthermore, those will be downloaded and installed automatically with one line: python setup.py install, which greatly simplifies your program's installation and deployment.
  • Yes, you should use a virtualenv in your production environment too. Why? Because if you're running different programs with different sets (and versions) of dependencies in the same environment (that is, your computer's actual Python installation), installing a new version of a lib because program A requires it might break program B which relies on an old version.
  • Your program/lib's dependency management will work in any OS or distro (even Windows) without any extra effort.
  • It's easy to uninstall the crappy libraries that you tried once and decided weren't good for your project: if pip uninstall xxxx doesn't work, just delete the virtualenv and recreate it -- it is, after all, only one line to get all your deps back.

Just open Ubuntu software centre, reinstall ubuntu-extras-keyring and then run sudo apt-get update from terminal.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top