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

UserWarning: Duplicate name #626

Closed
aalvrz opened this issue Nov 30, 2017 · 5 comments
Closed

UserWarning: Duplicate name #626

aalvrz opened this issue Nov 30, 2017 · 5 comments

Comments

@aalvrz
Copy link
Contributor

aalvrz commented Nov 30, 2017

I am experiencing a similar issue as #572

I am including PyPDF2 as a dependency in my Chalice project. Since there is no wheel available for it, I had to build it myself and add it to the vendor/ directory, as described in the docs.

Every time I deploy chalice I get the following warnings:

Regen deployment package.
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/DESCRIPTION.rst'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/top_level.txt'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/METADATA'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/WHEEL'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/metadata.json'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/RECORD'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/pagerange.py'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/xmp.py'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/utils.py'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/merger.py'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/pdf.py'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/filters.py'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/_version.py'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/__init__.py'
  return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/generic.py'
  return self._open_to_write(zinfo, force_zip64=force_zip64)

However when testing my deployed Lambda functions, PyPDF2 works without any problems. 👍

This is how my vendor/ directory looks like:

vendor/
├── PyPDF2
│   ├── __init__.py
│   ├── _version.py
│   ├── filters.py
│   ├── generic.py
│   ├── merger.py
│   ├── pagerange.py
│   ├── pdf.py
│   ├── utils.py
│   └── xmp.py
└── PyPDF2-1.26.0.dist-info
    ├── DESCRIPTION.rst
    ├── METADATA
    ├── RECORD
    ├── WHEEL
    ├── metadata.json
    └── top_level.txt

2 directories, 15 files

Would really appreciate some help on how to get rid of these warnings, as they are very annoying.

@joguSD
Copy link
Contributor

joguSD commented Nov 30, 2017

Is this dependency in both your requirements.txt and the vendor directory? If so removing it from the requirements.txt might be the way to go (as it will be included from the vendor dir already).

@aalvrz
Copy link
Contributor Author

aalvrz commented Dec 1, 2017

Yes, this was the issue. Thanks!

@aalvrz aalvrz closed this as completed Dec 1, 2017
@3dw1np
Copy link

3dw1np commented Jan 2, 2018

@BigChief45 I am experiencing pdf generation with Chalice framework, does PyPDF2 works fine? Did you use html->pdf convert feature (if available in PyPDF2)?
Or do U have any recommendations on other libs I can use?

Thanks !

@aalvrz
Copy link
Contributor Author

aalvrz commented Jan 2, 2018

@3dw1np PyPDF2 works fine as long as you can package it yourself in the /vendor directory in your project. I was using it for PDF to image conversions, and do not know if PyPDF2 supports html --> pdf.

@3dw1np
Copy link

3dw1np commented Jan 2, 2018

@BigChief45 Thanks! Do have an example of how you return the pdf into Chalice Response?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants