1

I am unable to install multiple packages listed in a file using single command line, I know that we can install multiple packages listed in a file using -r switch and we can use local sources to install using --no-index --find-links switches, but I am not sure if we can combine these two, I tried but its not working, so pls suggest, below is my exact requirement.

I have two packages pkg1-1.1.tar.gz and pkg2-2.2.tar.gz in directory
/home/rafiq/newpkgs Need to install them using pip command and the package names are listed in pkglist.txt.
phglist.txt contents:
pkg1==1.1
pkg2==2.2

please help me with pip command to install list of packages listed in pkglist.txt with sources present in newpkgs directory.

RAFIQ
  • 695
  • 1
  • 15
  • 30

2 Answers2

2

According to pip install manual your command should be:

pip install --no-index --find-links=newpkgs -r pkglist.txt

--no-index ignore pip index and looks for packages only where explicitly told to.

--find-links finds packages in a directory listing or parses an html file for links (can be shortened to -f)

Edit:

OP had a different problem after pip command was successful, but the actual build wasn't. For more information see this thread: How to install psycopg2 with "pip" on Python?

Community
  • 1
  • 1
Reut Sharabani
  • 27,609
  • 5
  • 62
  • 82
  • Thanks, Thats what i tried before posting, if you are sure it should work, I m getting error like 'Command python setup.py egg_info failed with error code 1 in /install/dir/build/psycopg2'. Not really sure what is wrong. – RAFIQ Dec 24 '14 at 11:05
  • Try this if you're on ubuntu/debian: `sudo apt-get install libpq-dev python-dev` seems like these are prerequisites for the package (from this answer: http://stackoverflow.com/a/5450183/948550 ) – Reut Sharabani Dec 24 '14 at 11:11
  • 1
    i am using centos need to yum install python-devel and postgresql-devel for the above exception. I actually have many more packages in original list so may be the dependencies are causing the issue let me resolve individual exceptions for respective packages, if all goes well confirm its working – RAFIQ Dec 24 '14 at 11:36
  • 1
    That works, actually the issue was with prerequisites , we can install all with one command given all yum install dependencies are installed – RAFIQ Dec 24 '14 at 12:08
1

I don't know how long the following solution has been around for, but I found you can simply run

pip install my_compressed_package.tar.gz

and pip will know what to do. All done locally, no network access needed.

sargas
  • 4,422
  • 5
  • 43
  • 62