Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install dependencies #10

Closed
patricktokeeffe opened this issue Feb 4, 2014 · 2 comments
Closed

pip install dependencies #10

patricktokeeffe opened this issue Feb 4, 2014 · 2 comments
Assignees

Comments

@patricktokeeffe
Copy link

I experienced some hang-ups installing pdfmerge on a win32 XP box with 2.7 (winpython 2.7.6.2). Initially it was a pyPdf dependency (fixed in #7?):

Z:\Desktop>pip install pdfmerge
Downloading/unpacking pdfmerge
  Downloading pdfmerge-0.0.3.zip
  Running setup.py egg_info for package pdfmerge
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "c:\docume~1\pokeeffe.cee\locals~1\temp\pip_build_pokeeffe\pdfmerge\setup.py", line 7, in <module>
        import pdfmerge
      File "pdfmerge.py", line 14, in <module>
        from pyPdf import PdfFileWriter, PdfFileReader
    ImportError: No module named pyPdf
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

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

  File "c:\docume~1\pokeeffe.cee\locals~1\temp\pip_build_pokeeffe\pdfmerge\setup.py", line 7, in <module>

    import pdfmerge

  File "pdfmerge.py", line 14, in <module>

    from pyPdf import PdfFileWriter, PdfFileReader

ImportError: No module named pyPdf

After manually running pip install pyPdf it got hung up on py2exe and that module wasn't found by pip:

Z:\Desktop>pip install pdfmerge
Downloading/unpacking pdfmerge
  Downloading pdfmerge-0.0.3.zip
  Running setup.py egg_info for package pdfmerge
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "c:\docume~1\pokeeffe.cee\locals~1\temp\pip_build_pokeeffe\pdfmerge\setup.py", line 45, in <module>
        import py2exe
    ImportError: No module named py2exe
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

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

  File "c:\docume~1\pokeeffe.cee\locals~1\temp\pip_build_pokeeffe\pdfmerge\setup.py", line 45, in <module>

    import py2exe

ImportError: No module named py2exe

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in c:\docume~1\pokeeffe.cee\locals~1\temp\pip_build_pokeeffe\pdfmerge
Storing complete log in Z:\pip\pip.log

Z:\Desktop>pip install py2exe
Downloading/unpacking py2exe
  Could not find any downloads that satisfy the requirement py2exe
Cleaning up...
No distributions at all found for py2exe
Storing complete log in Z:\pip\pip.log

Failed with easy_install too:

Z:\Desktop>easy_install pdfmerge
Searching for pdfmerge
Reading https://pypi.python.org/simple/pdfmerge/
Best match: pdfmerge 0.0.3
Downloading https://pypi.python.org/packages/source/p/pdfmerge/pdfmerge-0.0.3.zip#md5=8992564d56e3afd87792f25d73218433
Processing pdfmerge-0.0.3.zip
Writing c:\docume~1\pokeeffe.cee\locals~1\temp\easy_install-scn6eh\pdfmerge-0.0.3\setup.cfg
Running pdfmerge-0.0.3\setup.py -q bdist_egg --dist-dir c:\docume~1\pokeeffe.cee\locals~1\temp\easy_install-scn6eh\pdfmerge-0.0.3\egg-dist-t
mp-j7y_oi
Traceback (most recent call last):
     ...
    <snip>
     ...
  File "setup.py", line 45, in <module>
    version = open('VERSION').read().strip()
ImportError: No module named py2exe

Z:\Desktop>easy_install py2exe
Searching for py2exe
Reading https://pypi.python.org/simple/py2exe/
Reading http://sourceforge.net/project/showfiles.php?group_id=15583
Reading http://starship.python.net/crew/theller/py2exe/
Reading http://www.py2exe.org/
No local packages or download links found for py2exe
error: Could not find suitable distribution for Requirement.parse('py2exe')

After downloading py2exe from the sourceforge page http://sourceforge.net/projects/py2exe and installing it, I was able to successfully install pdfmerge via pip.

It would be nice to have this dependency resolved automatically but I don't expect that to be easy since neither pip nor easy_install could find py2exe. How about an explicit check during setup with an error message pointing to the sourceforge project page?

@patricktokeeffe
Copy link
Author

I see that requirements.txt does mention py2exe but it needs to be uncommented on Windows machines. It is not mentioned in setup.py. Is it pythonic enough to do something like:

OPTS = {
      ...
    'install_requires': ['pyPdf', 'py2exe'] if sys.platform.startswith('win') else ['pyPdf'],
      ...
}

@metaist
Copy link
Owner

metaist commented Feb 6, 2014

I should really read in all the dependencies from requirements.txt into setup.py and make py2exe conditional like you showed.

@metaist metaist self-assigned this Feb 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants