Giter Site home page Giter Site logo

pip's Introduction

pip - The Python Package Installer

PyPI PyPI - Python Version Documentation

pip is the package installer for Python. You can use pip to install packages from the Python Package Index and other indexes.

Please take a look at our documentation for how to install and use pip:

We release updates regularly, with a new version every 3 months. Find more details in our documentation:

If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:

If you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:

Code of Conduct

Everyone interacting in the pip project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PSF Code of Conduct.

pip's People

Contributors

alex avatar benoit-pierre avatar brainwane avatar carljm avatar chrahunt avatar cjerdonek avatar dabrahams avatar deveshks avatar dstufft avatar gvalkov avatar hltbra avatar hugovk avatar ianb avatar ilanschnell avatar ivoz avatar jdufresne avatar jezdez avatar mcsinyx avatar msabramo avatar notatallshaw avatar pfmoore avatar pnasrat avatar pradyunsg avatar q0w avatar qwcode avatar rbtcollins avatar sbidoul avatar takluyver avatar uranusjr avatar xavfernandez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pip's Issues

Can't install bazar from launchpad

In order to use ijson module I want to download it from launchpad.

I can do it with regular bzr command:

$ bzr branch -q lp:ijson
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".

But I can't do it with pip:

$ pip install -e bzr+lp:ijson#egg=ijson

Obtaining ijson from bzr+lp:ijson#egg=ijson
  Checking out lp:ijson#egg=ijson to ./src/ijson
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
bzr: ERROR: Invalid url supplied to transport: "bzr+ssh://bazaar.launchpad.net/+branch/ijson%23egg%3Dijson": no supported schemes
  Complete output from command /usr/bin/bzr branch -q lp:ijson#egg=ijson /tmp/python/src/ijson:

----------------------------------------
Command /usr/bin/bzr branch -q lp:ijson#egg=ijson /tmp/python/src/ijson failed with error code 3
Storing complete log in /home/lucky/.pip/pip.log

It seems like the pip doesn't strip #egg=ijson from requested url.

$ pip --version
pip 0.8.1 from /tmp/python/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg (python 2.6)

pip show pkg

The show command would give the end user a look at information things like:

The home page for the package

The version of the package

Dependencies of the package


"-tip" suffix added when installing from requirements

I found that editable packages versioned with Mercurial are not handled right. Here are the step to reproduce problems:

== Create ==

$ virtualenv --no-site-packages ~/ve/foo

$ ~/ve/foo/bin/pip install -e hg+http://bitbucket.org/ubernostrum/django-registration#egg=django-registration

$ ls ~/ve/foo/src
django-registration

Note the name of the directory.

== Freeze ==

$ ~/ve/foo/bin/pip freeze > /tmp/foo.pip

== Replicate ==

$ virtualenv --no-site-packages ~/ve/bar

$ ~/ve/bar/bin/pip install -r /tmp/foo.pip

$ ls ~/ve/bar/src
django-registration-tip

Note the "-tip" suffix.


pip uninstall fails on symlinks to directories

If uninstalling a python package, which installs symbolic links to directories somewhere, pip uninstall does not remove the symbolic link itself, but instead leaves the symbolic link intact and instead removes the whole directory, the link pointed too.


Error installing from svn with revision number

I use this command to install package from svn:

#!shell

pip install -e svn://mysvndomain.com/myapp/trunk@635#egg=myapp

And I got the following error:

#!shell

Checking out svn://mysvndomain.com/myapp/trunk (to revision 635#egg=myapp) to ./myapp
svn: Syntax error in revision argument '635#egg=myapp'

package egenix-mx-base can't be installed with pip

pip apparently tries to call setup.py install with the --single-version-externally-managed option and that blows up mx-base's setup.py

Here's the (edited) console output, and linked is the (edited) pip-log file

Downloading/unpacking egenix-mx-base
  Downloading egenix-mx-base-3.1.2.tar.gz (8.2Mb): 8.2Mb downloaded
  Running setup.py egg_info for package egenix-mx-base
    no build data file 'build/build-py2.6_ucs2.pck' found
Installing collected packages: egenix-mx-base
  Running setup.py install for egenix-mx-base
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: option --single-version-externally-managed not recognized
    Complete output from command ${venv}/bin/python -c "import setuptools; __file__='${venv}/build/egenix-mx-base/setup.py'; execfile('${venv}/build/egenix-mx-base/setup.py')" install --single-version-externally-managed --record /var/folders/u3/u3JfEOrdGAWC636N0MgTDU+++TI/-Tmp-/pip-iJGLst-record/install-record.txt --install-headers ${venv}/lib/include:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

   or: -c --help [cmd1 cmd2 ...]

   or: -c --help-commands

   or: -c cmd --help



error: option --single-version-externally-managed not recognized

----------------------------------------
Command ${venv}/bin/python -c "import setuptools; __file__='${venv}/build/egenix-mx-base/setup.py'; execfile('${venv}/build/egenix-mx-base/setup.py')" install --single-version-externally-managed --record /var/folders/u3/u3JfEOrdGAWC636N0MgTDU+++TI/-Tmp-/pip-iJGLst-record/install-record.txt --install-headers ${venv}/lib/include failed with error code 1
Storing complete log in ./pip-log.txt

Support for bdist installations

Egg's stink. But installing from binaries is important; not everybody wants to install a compiler and a zillion dependencies just to use some python package. Distutils already supports a bdist format; could pip support installation from that?


Non-alphabetical installation of requirements

Is there a particular reason that the dependencies are installed in alphabetical order instead of in the order they are listed in the requirements.txt file?

This line in req.py seems unnecessary:

        to_install = sorted([r for r in self.requirements.values()
                             if self.upgrade or not r.satisfied_by],
                            key=lambda p: p.name.lower())

There are instances in which you want to have one package installed before another one, if for example a 3rd party package has egg dependencies that are not pinned, and you want to install a particular version of an egg.

With the current alphabetical ordering of the install process, it's possible that the unpinned egg will get installed before your pinned version, meaning that you don't have explicit control over which versions of eggs get installed.


Need a way to install without prompts

In particular, I would like to supply a default option via command-line for the following prompt:
What to do? (s)witch, (i)gnore, (w)ipe, (b)ackup

This prompt causes a problem for automated deployment, because one cannot update the URL for a package installed from VCS.


pip cannot uninstall from per-user site-packages directory

Issue #60 shows the introduction of pip support for package installation to the per-user site-packages directory, which is awesome. Uninstallation of packages in that directory, however, does not yet seem supported, Carl Meyer marked issue #44 as resolved, which seems directly related to this issue, so I found this bug surprising.

Steps to reproduce bug behavior:

  • Run pip install --user SOMEPACKAGE
  • Run pip uninstall SOMEPACKAGE
  • Answer y when pip asks "Uninstalling SOMEPACKAGE: Proceed (y/n)?"
  • Open a Python console and observe that import SOMEPACKAGE still works; list contents of user site-packages directory and observe package files still there.

pip shouldn't print download progress if stdout is not a terminal

http://docs.python.org/library/stdtypes.html#file.isatty

  Downloading py-1.4.1.zip (224Kb): 
  Downloading py-1.4.1.zip (224Kb):   1%  4.1Kb
  Downloading py-1.4.1.zip (224Kb):   3%  8.2Kb
  Downloading py-1.4.1.zip (224Kb):   5%  12Kb 
  Downloading py-1.4.1.zip (224Kb):   7%  16Kb
  Downloading py-1.4.1.zip (224Kb):   9%  20Kb
  Downloading py-1.4.1.zip (224Kb):  10%  24Kb
  Downloading py-1.4.1.zip (224Kb):  12%  28Kb
  Downloading py-1.4.1.zip (224Kb):  14%  32Kb
  Downloading py-1.4.1.zip (224Kb):  16%  36Kb
  Downloading py-1.4.1.zip (224Kb):  18%  40Kb
  Downloading py-1.4.1.zip (224Kb):  20%  45Kb
  Downloading py-1.4.1.zip

Gaah.


pointing install directly at an sdist tarball bypasses uninstall-on-upgrade

If I generate sdists of a couple different versions of a local package, then "pip install test_package-0.1.tar.gz" and then "pip install test_package-0.2.tar.gz", the second install does not find and uninstall the first.

It appears that this is because there is no explicit version requirement given, and RequirementSet.install_files() calls Requirement.check_if_exists() before the tarball is unpacked or anything is known about what distribution or version it might contain.


Need a way in requirements.txt to force installing a package

I would love a way to be able to say, //in a requirements file//, "install this package even if it's already installed somewhere." This can be forced on the command line with the --upgrade flag, but you can't do that in a req file.

The motivation here is that locally-installed packages in a virtualenv differ from globally-installed packages in at least one important respect: Executable scripts from global packages typically don't work as expected in a virtualenv, because the shebang line points to the wrong python interpreter, thus effectively bypassing the virtualenv.

So, if I provide a requirements file that includes a line like foo==1.2.3, my expectation is that users will be able to run scripts provided by foo-1.2.3. In reality, those scripts will work for those users who don't already have foo-1.2.3 installed, and likely NOT work for users who //do// already have it installed, and I'll get confusing bug reports because the user probably doesn't know that they already have it installed somewhere else, and neither do I.

Also, I can't reliably provide automation scripts which use such python scripts, even if I call my own python interpreter instead of relying on the shebang line, because I don't know if or where the script is installed, or even if there's multiple versions installed - in which case which foo isn't much help because I need the //right// one.

Right now the only workaround that I know of is to put "-e some-repo-url#egg=foo==1.2.3" in my requirements.txt. That forces installation. But this is kind of silly: I don't care about the source, and the motivation is not at all obvious from reading the requirements file, and it adds more dependencies on development headers if foo needs to build C extensions.

For a concrete example where this bit me, see
http://trac.pythonpaste.org/pythonpaste/ticket/458
.
It also just bit me today while trying to support a user who was failing to install a Django app:
http://groups.google.com/group/ebcode/tree/browse_frm/thread/a12098921d61cdc3/a020706cf3d1d162?rnum=11&_done=%2Fgroup%2Febcode%2Fbrowse_frm%2Fthread%2Fa12098921d61cdc3%3F#doc_2c9b22010a6e1457


pip and pep-370 per-user-site-packages-directory

Python 2.6 and 3.0 (and up) support pep-370.

Please add this option in the documentation. The usage is:

export PYTHONUSERBASE=~/xxx
pip install --install-option=--user Package

This will install the package in ~/xxx/lib/python2.6/site-packages/ and will be import-able with nothing more than plain python as long as the environment variable PYTHONUSERBASE is set.


pip uninstall on Ubuntu(Linux)

I try install package via pip and immediately uninstall it but I see that package which have puted to my a python folder not uninstall after command: pip uninstall although pip in sell said me that pakage has uninstalled.
I think that it is bug.

Thanks


Can't install if a directory in cwd has the same name as the package you're installing

For instance, if I want to install my package pysistence (from pypi):

#!bash

mkdir pysistence
pip install pysistence

Directory 'pysistence' is not installable. File 'setup.py' not found.
Storing complete log in /home/jason/.pip/pip.log

It would be helpful if there were some way to specify whether the package to be installed is coming from a directory or pypi.


Issues with pip install -e with django-authority

$ virtualenv ~/ve/test

$ pip -E ~/ve/test install -e \
hg+http://bitbucket.org/jezdez/django-authority#egg=django-authority

$ pip -E ~/ve/test freeze | grep authority
django-authority==0.4dev

Rather than the full URI.

NOTE
-----

<jezdez> ok, here is the reason: it's a regression in pip's
Mercurial backend which has something to do with
authority having its package "authority" in a
subdirectory of the clone. pip simply doesn't recognize
the editable as a directory under version control

<jezdez> this isn't a problem of authority but of pip

[...]

        <jezdez> yes
        <jezdez> this is the culprit:
                 http://bitbucket.org/ianb/pip/src/tip/pip/vcs/__init__.py#cl-56
[17:35] <jezdez> it's actually also true for any other vcs backend
[17:38] <jezdez> hm, no idea how to fix that, any suggestions?
[17:40] <phretor> jezdez: FYI
                  http://bitbucket.org/jezdez/django-authority/issue/9/issues-with-pip-install-e
        <phretor> let me see
        <jezdez> hrmpf, this is a wart in the vcs implementation coming
                 from the fact that it originally only supported svn
                 which has .svn folders all over the place
[17:41] <jezdez> which means it didn't matter in which directory the
                 check for which vcs was made
        <jezdez> phretor: oh, I meant in the pip issue tracker :)
[17:42] <phretor> jezdez: holy crap
        <jezdez> :)
        <jezdez> http://bitbucket.org/ianb/pip/issues/
[17:43] <phretor> jezdez: my apologies; so it happens because of the
                  name "authority" is somehow involved in hg?
        <jezdez> no
[17:44] <jezdez> when you install django-authority as an editable it
                 does a hg clone
        <jezdez> the "authority" package is located in a subdirectory
                 called "src" though:
                 http://bitbucket.org/jezdez/django-authority/src/tip/src/
[17:45] <jezdez> compared to
                 http://bitbucket.org/ubernostrum/django-registration/src/
                 being in the root directory
        <phretor> jezdez: I see
        <jezdez> the internals of pip use the information "where is the
                 package xy located" to check if it's an editable
        <jezdez> in short: it's a bug

Use pip install through private repostiory protected by .htaccess ?

Hi,

I would like protected a private Python Index repository with ".htaccess" file.

When I use pip to install some package from this repository, I've this error :

Getting page http://pypi.is-webdesign.com/simple/
Could not fetch URL http://pypi.is-webdesign.com/simple/: HTTP Error 401: Unauthorized

How can I use login/password parameters with pip ?

Pip don't support this feature ? If not it's planned ?

Regards,
Stephane


reinstalling package from git fails if branch is specified

#!bash

# pip install -e git://github.com/hmarr/boto@ses#egg=boto
Obtaining boto from git+git://github.com/hmarr/boto@ses#egg=boto
  Cloning git://github.com/hmarr/boto (to ses) to ./src/boto
  Running setup.py egg_info for package boto
Installing collected packages: boto
  Running setup.py develop for boto
    Creating /usr/local/lib/python2.6/dist-packages/boto.egg-link (link to .)
    Adding boto 2.0b3 to easy-install.pth file
    Installing sdbadmin script to /usr/local/bin
    Installing elbadmin script to /usr/local/bin
    Installing cfadmin script to /usr/local/bin
    Installing s3put script to /usr/local/bin
    Installing fetch_file script to /usr/local/bin
    Installing launch_instance script to /usr/local/bin
    Installing list_instances script to /usr/local/bin
    Installing taskadmin script to /usr/local/bin
    Installing kill_instance script to /usr/local/bin
    Installing bundle_image script to /usr/local/bin
    Installing pyami_sendmail script to /usr/local/bin
    Installing lss3 script to /usr/local/bin
    Installing cq script to /usr/local/bin

    Installed /home/ubuntu/src/boto
Successfully installed boto
Cleaning up...

# pip install -e git://github.com/hmarr/boto@ses#egg=boto
Obtaining boto from git+git://github.com/hmarr/boto@ses#egg=boto
  Updating ./src/boto clone (to ses)
fatal: ambiguous argument 'ses': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
  Complete output from command /usr/bin/git reset --hard -q ses:

----------------------------------------
Command /usr/bin/git reset --hard -q ses failed with error code 128
Storing complete log in /root/.pip/pip.log

pip's version is 0.8.2.


pip cannot install PyHamcrest under Python 2.5

What it says on the tin.

Note that installing PyHamcrest under python 2.6 and 2.6 succeed.

Here's the full output for a pip call that attempts to install PyHamcrest under python 2.5:

 ! (py25) crose@02-mr41-a (log) $ ../bin/pip -v install pyhamcrest
../bin/pip -v install pyhamcrest
Downloading/unpacking pyhamcrest
  Using version 1.4 (newest of versions: 1.4, 1.4, 1.4, 1.3, 1.3, 1.2.1, 1.2.1, 1.1, 1.0)
  Downloading PyHamcrest-1.4.tar.gz
  Running setup.py egg_info for package pyhamcrest
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
    IOError: [Errno 2] No such file or directory: '/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/build/pyhamcrest/setup.py'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

IOError: [Errno 2] No such file or directory: '/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/build/pyhamcrest/setup.py'

----------------------------------------
Command python setup.py egg_info failed with error code 1
Exception information:
Traceback (most recent call last):
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/basecommand.py", line 130, in main
    self.run(options, args)
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/commands/install.py", line 223, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/req.py", line 941, in prepare_files
    req_to_install.run_egg_info()
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/req.py", line 219, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/__init__.py", line 249, in call_subprocess
    % (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1

Storing complete log in /Users/crose/.pip/pip.log
 ! (py25) crose@02-mr41-a (log) $ python --version
python --version
Python 2.5.4

Fails to clone from git if a directory named git is in the path

OS: ubuntu 10.10

I have ~/bin prepended to my path.
I also have a ~/bin/git folder where all my git commands are stored.

pip tries to execute ~/bin/git (the folder) instead of /usr/bin/git (the file).

This fixes my problem:

diff -r 14ee6b8d7b89 pip/util.py
--- a/pip/util.py   Sun Feb 13 16:54:56 2011 -0200
+++ b/pip/util.py   Wed Mar 02 03:36:31 2011 +0100
@@ -86,9 +86,9 @@
         for ext in pathext:
             # then including the extension
             cmd_path_ext = cmd_path + ext
-            if os.path.exists(cmd_path_ext):
+            if os.path.exists(cmd_path_ext) and os.path.isfile(cmd_path_ext):
                 return cmd_path_ext
-        if os.path.exists(cmd_path):
+        if os.path.exists(cmd_path) and os.path.isfile(cmd_path):
             return cmd_path
     return None

I'm not very used to python yet or the platforms it supports so I assumed that os.path.isfile() will work on all platforms, you probably have much deeper knowledge about this.

Sorry that I haven't got the time to register an account here or learn/setup mercurial atm.

Regards, Thomas Frössman [email protected]


pip doesn't install PyObjC

Hi,

I'm trying to install PyObjC with pip, it give following error message and it terminates.

#!bash

$ sudo pip install PyObjC                                                                
Downloading/unpacking PyObjC
  Running setup.py egg_info for package PyObjC

Downloading/unpacking pyobjc-core==2.3 (from PyObjC)
  Running setup.py egg_info for package pyobjc-core
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'use_2to3'
      warnings.warn(msg)
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trashcli/build/pyobjc-core/setup.py", line 452, in <module>
        **extra_args
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
        dist.run_commands()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trashcli/build/pyobjc-core/setup.py", line 110, in run
        orig_egg_info.egg_info.run(self)
      File "<string>", line 7, in replacement_run
    AttributeError: class egg_info has no attribute 'iter_entry_points'
    Complete output from command python setup.py egg_info:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'use_2to3'

  warnings.warn(msg)

running egg_info

Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trashcli/build/pyobjc-core/setup.py", line 452, in <module>

    **extra_args

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup

    dist.run_commands()

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trashcli/build/pyobjc-core/setup.py", line 110, in run

    orig_egg_info.egg_info.run(self)

  File "<string>", line 7, in replacement_run

AttributeError: class egg_info has no attribute 'iter_entry_points'

----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /Users/abhinay/.pip/pip.log

Any suggestions please?


Python3.2 running pip gives SyntaxError: invalid syntax

Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in
load_entry_point('pip==0.8.2', 'console_scripts', 'pip')()
File "/usr/local/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/pkg_resources.py", line 305, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/pkg_resources.py", line 2244, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.2/site-packages/distribute-0.6.14-py3.2.egg/pkg_resources.py", line 1954, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/local/lib/python3.2/site-packages/pip-0.8.2-py3.2.egg/pip/init.py", line 56
print dist
^
SyntaxError: invalid syntax


pip install -E env package fails if package in global environment

Even though "pip -E env package" creates a new environment without global site packages, it will then fail to install "package" in the virtual environment if this package already exists in the system site packages.

For example:

$ pip install -E test mysql-python
Creating new virtualenv environment in test
  New python executable in test/bin/python
  Installing distribute.............................................................................
  Installing distribute...done......................................................................
Requirement already satisfied (use --upgrade to upgrade): mysql-python in /Library/Python/2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg
Cleaning up...

Do not run `egg_info` to each package in requirements list before installing the previous packages

There are tons of packages using setup.py wrongly, and if we have a requirements file like:

# requirements.txt

numpy
scipy

What pip does is to download both, run python setup.py egg_info to numpy, and then python setup.py egg_info to scipy.

The problem is that scipy's setup.py tries to import numpy, which breaks the installation, because there is no numpy installed yet.

I would suggest to download each package and then instead of running egg_info, running install, but I am not seeing the drawbacks now.

Could you please give suggestions here?

PS.: This issue is a split of <<issue 178>> - Non-alphabetical installation of requirements.


Use .zip on Windows and .tar.gz on Linux/Mac

I just moved to using pip instead of easy_install, and started recommending it in my project's documentation.

However, here's one problem that came up in the transition:

When run from Linux, pip prefers zip files to tar.gz. This is a problem because I use zip files for Windows endlines, and tar.gz files for Linux endlines. This is especially important for my project because it gives the user a script that copies some files from the project to make a skeleton. (Similar to "django_admin startapp" or however it's called.) So if Windows users get a version of my project with LF, they get bad files generated for them.

I suggest then the pip will use .zip on Windows and .tar.gz on Linux/Mac. (I think that easy_install does this, but I'm not sure.)

What do you think?


Installing from a git repo using +e doesn't checkout the default (master) branch

I've seen this issue elsewhere, with regards to virtualenv (http://groups.google.com/group/python-virtualenv/browse_thread/thread/afd8d06d69a0f3be), but it's looking like a pip issue to me.

Basically if I install an editable package from git using pip, and then go to environment/src/foo/ and type 'git branch', I get the following output:

* (no branch)
  master

using a standard git clone correctly yields the following output (which means the repositories aren't at fault):

* master

This happens when checking out from anywhere (github, local repos, remotes etc). This is particularly troublesome if you don't realise it's happened and then try to make some changes and commit/push since it causes errors.

I'm not sure what's happening since from a quick glance at the code, pip is just running git clone.


pip crashes when server does not send content-type header

I tried to work around the broken werkzeug pypi infos by:

   dependency_links = [
        'https://nodeload.github.com/mitsuhiko/werkzeug/tarball/master#egg=Werkzeug-0.7dev',
    ],
    install_requires=[
        'Werkzeug==0.7dev', # wsgi toolkit, minimum rev 0.7dev 2010/12
...
    ],

Problem: github does not send a content-type header 8(

Downloading/unpacking Werkzeug==0.7dev (from moin)
Exception:
Traceback (most recent call last):
  File "/home/tw/w/mm20dev/env/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/basecommand.py", line 120, in main
    self.run(options, args)
  File "/home/tw/w/mm20dev/env/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/commands/install.py", line 161, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/home/tw/w/mm20dev/env/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/req.py", line 879, in prepare_files
    self.unpack_url(url, location, self.is_download)
  File "/home/tw/w/mm20dev/env/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/req.py", line 1035, in unpack_url
    content_type = resp.info()['content-type']
  File "/usr/lib/python2.6/rfc822.py", line 388, in __getitem__
    return self.dict[name.lower()]
KeyError: 'content-type'

Suggestion: maybe catch this case and just look at the filename you get and use mimetypes.guess_type.


[py3K] portable execfile

Python 3 removed execfile, here's a portable replacement:

diff -r 6b534b1f046f pip/req.py
--- a/pip/req.py    Mon Feb 08 09:51:14 2010 +0200
+++ b/pip/req.py    Fri Feb 12 16:32:12 2010 +0100
@@ -224,7 +224,7 @@
             writer(self, ep.name, egg_info.os.path.join(self.egg_info,ep.name))
     self.find_sources()
 egg_info.egg_info.run = replacement_run
-execfile(__file__)
+exec(compile(open(__file__).read(), __file__, 'exec'))
 """

     def egg_info_data(self, filename):
@@ -527,7 +527,7 @@
         try:
             call_subprocess(
                 [sys.executable, '-c',
-                 "import setuptools; __file__=%r; execfile(%r)" % (self.setup_py, self.setup_py),
+                 "import setuptools; __file__=%r; exec(compile(open(__file__).read(), __file__, 'exec'))" % (self.setup_py),
                  'install', '--single-version-externally-managed', '--record', record_filename,
                  '--install-headers', header_dir] + install_options,
                 cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
@@ -578,7 +578,7 @@
             ## FIXME: should we do --install-headers here too?
             call_subprocess(
                 [sys.executable, '-c',
-                 "import setuptools; __file__=%r; execfile(%r)" % (self.setup_py, self.setup_py),
+                 "import setuptools; __file__=%r; exec(compile(open(__file__).read(), __file__, 'exec'))" % (self.setup_py),
                  'develop', '--no-deps'], cwd=self.source_dir, filter_stdout=self._filter_install,
                 show_stdout=False)
         finally:

Unable to install PyHamcrest using pip on Python 2.5

What it says on the tin. Python 2.6 and 2.7 can install PyHamcrest easily, but Python 2.5 fails:

 ! (py25) crose@02-mr41-a (log) $ ../bin/pip -v install pyhamcrest
../bin/pip -v install pyhamcrest
Downloading/unpacking pyhamcrest
  Using version 1.4 (newest of versions: 1.4, 1.4, 1.4, 1.3, 1.3, 1.2.1, 1.2.1, 1.1, 1.0)
  Downloading PyHamcrest-1.4.tar.gz
  Running setup.py egg_info for package pyhamcrest
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
    IOError: [Errno 2] No such file or directory: '/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/build/pyhamcrest/setup.py'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

IOError: [Errno 2] No such file or directory: '/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/build/pyhamcrest/setup.py'

----------------------------------------
Command python setup.py egg_info failed with error code 1
Exception information:
Traceback (most recent call last):
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/basecommand.py", line 130, in main
    self.run(options, args)
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/commands/install.py", line 223, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/req.py", line 941, in prepare_files
    req_to_install.run_egg_info()
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/req.py", line 219, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Users/crose/projects/advanis/cs008_defines/python/.tox/py25/lib/python2.5/site-packages/pip-0.8.1-py2.5.egg/pip/__init__.py", line 249, in call_subprocess
    % (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1

Storing complete log in /Users/crose/.pip/pip.log
 ! (py25) crose@02-mr41-a (log) $ python --version
python --version
Python 2.5.4

Pip should return 'error' upon failed installation attemps

Currently, if 'Pip install somepackage' fails because somepackage is non-existent or does not download completely etc, pip emits some error messages, but does not set the return code to non-zero.

'Pip' or 'Pip install' set the return code to 2.

This behaviour makes it unnecessarily difficult to check pip install results, for instance in bash scripts for automatic package installation.


unpacking links in tarfiles

seems like links in tarfiles can cause problems. replacing a "CHANGELOG -> doc/changelog.txt" link with a regular file allowed pip to succeed and otherwise this problem occurs:

http://pastebin.com/d30654651

this is from a user of py.test trying out the py-1.1.0 candidate, using Python2.6.2 and Ubuntu 9.10 i think.

best, holger


Error with pip requirement files and URL packages

When you put a URL in a requirements file, pip doesn't know what package it is dealing with, and tells you to add #egg=PackageName to the URL. However, even when this is done, it still doesn't parse out the package name and gives the same error.

To reproduce, put the following URL in a requirements.txt and run pip freeze -r requirements.txt:

http://media.djangoproject.com/releases/1.2/Django-1.2-rc-1.tar.gz#egg=Django}}}
{{{http://media.djangoproject.com/releases/1.2/Django-1.2-rc-1.tar.gz#egg=Django

Pip isn't accounting for Setuptool's requirement extras

Pip's requirements parsing doesn't appear to recognize declared extras.[0] These are supposed to be used in Setuptools to provide a way to list dependencies for a particular feature.

Repeatable through the following:

$ pip install "zope.testbrowser [zope_functional_testing]"

In the above 'zope.app.testing' should have been pulled in as a dependency, because of the extra declaration in the requirements line.

Another example would be "zope.i18n [zcml]".

[0] http://peak.telecommunity.com/DevCenter/setuptools#declaring-extras-optional-features-with-their-own-dependencies


Install order when using: pip install --upgrade somepackage

It looks like pip is installing the package to be updated before upgrading the dependencies. Aside from being kind of strange behavior, consider the following:

  • mymodule requires Twisted
  • Twisted has a plugins/ directory in which all third-party modules must copy their plugins.
  • pip install mymodule installs the dependencies, then mymodule as expected.
  • pip install --upgrade mymodule removes, re-installs mymodule first, then the dependencies. This means that Twisted is removed, then re-installed, wiping that plugins directory. It won't be repopulated, since mymodule has already been upgraded.

I'm not sure if this should be a bug, but I can't figure out why we'd want this order instead of the inverse. Whether it be fixing the "bug" or providing a flag to tell pip to install dependencies first, this would save me a whole lot of headache. I'm using Twisted here as a convenient example, but this scenario can hinder other projects as well.

If I didn't explain this well enough, reply and let me know. Thanks!


PIP_NO_INPUT is insufficiently flexible

When automating package installation, I frequently need to provide an answer to questions posed by pip.util.ask(). However, at present, the only option for scripting is PIP_NO_INPUT, which simply throws an exception in cases where a question could be asked.

The option to provide an answer to be used in the event of ask()-based questions should be available.

I've developed a patch for my own use which allows the following usage:

#!sh
PIP_NO_IPUT=1 \
  PIP_INPUT_scm_switch='*(s)witch*' \
  PIP_ACTION_scm_switch=s \
  pip install -r requirements.txt

--compiler build option on windows

On Windows while installing from source code several packages (psycopg2, PIL, ...) emit an error:

error: Unable to find vcvarsall.bat

The issue is being fixed by installing MinGW and using mingw32 compiler like this:

setup.py install build --compiler=mingw32

As far as I see, it would be very good for PIP to have "--build-option" like "--install-option", so that one could use PIP with mingw32 compiler:

pip install --build-option="--compiler=mingw32" psycopg2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.