LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
201 stars 39 forks source link

problem in puthon 2 with open and encoding keyword #7

Closed martinbjerge closed 4 years ago

martinbjerge commented 4 years ago

In setup.py open is called with keywork "encoding" (line 4) this don't work in python 2, hence sugest to "import io" and use "io.open" insted.

eg. see this: https://stackoverflow.com/questions/25049962/is-encoding-is-an-invalid-keyword-error-inevitable-in-python-2-x

Error from pip instal: (base) C:\Users\MartinHuusBjerge>pip install pyexiv2 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Collecting pyexiv2 Using cached https://files.pythonhosted.org/packages/c4/f0/acd45defbb3dd1147f47837ce06f27b3d7978a3fc47d24556cf630bbccd0/pyexiv2-1.3.0.tar.gz ERROR: Command errored out with exit status 1: command: 'c:\programdata\anaconda2\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\users\martin~1\appdata\local\temp\pip-install-wgew3s\pyexiv2\setup.py'"'"'; file='"'"'c:\users\martin~1\appdata\local\temp\pip-install-wgew3s\pyexiv2\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'c:\users\martin~1\appdata\local\temp\pip-install-wgew3s\pyexiv2\pip-egg-info' cwd: c:\users\martin~1\appdata\local\temp\pip-install-wgew3s\pyexiv2\ Complete output (5 lines): Traceback (most recent call last): File "", line 1, in File "c:\users\martin~1\appdata\local\temp\pip-install-wgew3s\pyexiv2\setup.py", line 4, in with open("README.md", encoding="utf-8") as f: TypeError: 'encoding' is an invalid keyword argument for this function

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

LeoHsiao1 commented 4 years ago

Hi! I developed this pyexiv2 based on python3(64bit), so it won't work on python2. You have two choices:

LeoHsiao1 commented 4 years ago

Wooo…I'm going to close this issue.

martinbjerge commented 4 years ago

Hi! I developed this pyexiv2 based on python3(64bit), so it won't work on python2. You have two choices:

  • Use my pyexiv2 on python3(64bit).
  • Use the pyexiv2 developed by another team, which is based on Python2, but no longer maintained.

Thanks for getting back to me so fast. OK, i was just under the impression that pyexiv2 was for python2 and py3exiv2 was for python3. Also i don't get why your project is the one beeing installed when i use pip install (in python2) and not the other one thats for python2. But all good i will get it up and running.

LeoHsiao1 commented 4 years ago

The pyexiv2 and py3exiv2 projects you mentioned were developed several years ago, while I developed this pyexiv2 in 2019. Their names are very similar, haha.

github-actions[bot] commented 3 years ago

This issue has been automatically closed because there has been no activity for a month.