jim-easterbrook / Photini

An easy to use digital photograph metadata (Exif, IPTC, XMP) editing application.
https://photini.readthedocs.io/
GNU General Public License v3.0
163 stars 24 forks source link

In 15.11.0 AttributeError: 'module' object has no attribute 'python_2_unicode_compatible' #16

Closed pmo-19 closed 8 years ago

pmo-19 commented 8 years ago

The previous version 15.10.0 is working fine. However, the latest version 15.11.0 crash upon launch. Here is a terminal dump:

$ photini Traceback (most recent call last): File "/usr/bin/photini", line 9, in <module> load_entry_point('Photini==15.11.0', 'gui_scripts', 'photini')() File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point return ep.load() File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/usr/lib/python2.7/dist-packages/photini/editor.py", line 42, in <module> from .bingmap import BingMap File "/usr/lib/python2.7/dist-packages/photini/bingmap.py", line 29, in <module> from .photinimap import PhotiniMap File "/usr/lib/python2.7/dist-packages/photini/photinimap.py", line 30, in <module> from .imagelist import DRAG_MIMETYPE File "/usr/lib/python2.7/dist-packages/photini/imagelist.py", line 31, in <module> from .metadata import Metadata, MetadataHandler File "/usr/lib/python2.7/dist-packages/photini/metadata.py", line 409, in <module> @six.python_2_unicode_compatible AttributeError: 'module' object has no attribute 'python_2_unicode_compatible'

I am running Ubuntu Trusty 14.04

I found a similar issue in GitHub in this project along with a solution. I don't know / have time yet to investigate.

https://github.com/sloria/TextBlob/issues/8

Well it looks like the trouble comes from line 409 in metadata.py (line 449 as well) @six.python_2_unicode_compatible

and line 37 in the same file import six

Basically six has no Attribute 'python_2_unicode_compatible'

I don't know Python at all, but may be with the other project I mention above you can fix this bug ?

jim-easterbrook commented 8 years ago

Try updating the 'six' library: 'pip install -U six'. python_2_unicode_compatible was added in six version 1.9.0. I put the correct version in Photini's README but forgot to update setup.py. https://bitbucket.org/gutworth/six/src/1991f8b5b654f077e773f05695a08e0506b7367f/CHANGES

pmo-19 commented 8 years ago

OK. Thanks for your quick reply. The package is now working. I build Photini in a Launchpad repository for all currently supported Debian Ubuntu platforms. https://launchpad.net/~anton+/+archive/ubuntu/photo-video-apps I did upload the latest source for python-setuptools and six in order to build packages for Debian Ubuntu systems. One thing though is that each time I compile and build your source I need to patch the photini/__init__.py file in order to remove the dev no from the __version__ line. This information is present on the next line _dev_no anyway ... Otherwise I get a local change detected error at build time. Is it possible for you to remove this information on the version line ? The patches I use are in the debian folder: debian/patches e.g. in file photini_15.11.0+git20151202.95ee1b52-1pmo1~trusty.debian.tar.xz

jim-easterbrook commented 8 years ago

I didn't realise the dev number was causing you problems. I don't know anything about packaging (apart from PyPI). It will only change if you have gitpython installed, and should only change once after you update from GitHub (i.e. if you do git pull followed by python setup.py it should then ramain stable). I don't know if that helps. I'll have a think about how to achieve what I want without including the dev number in __version__. Won't you still get a local change detected when the _dev_no value changes though?

pmo-19 commented 8 years ago

Sorry for this delayed answer. In fact after checking all the [Python] dependencies you list on the front page of GitHub, I realized I had to update [to the latest version] all these packages and their dependencies in my PPA in order to get all the capabilities inside Photini. I am done for now, except for the latest version of python-flickrapi. The current Debian package (used as well in Ubuntu) sports only version 1.2. I will create a new one for version 2.1.2 in the coming days. Well, I don't know well Red Hat Linux, Fedora and other distributions. I know you can install any application through cmd. line make install in any Linux. However the preferred way in RPM and Debian is to use packages. I only use packages. For Python, you may as well run python setup.py. Going only with packages I am sure I will install the appropriate dependencies. The message I get currently when building a package from your source is local change detected [in the source] when the Debian package builder inspect the source before undertaking the package building. Then it stops and refuses to build. That's why I did make a patch. As the building process first apply the patch(es) before evaluating the source. This process is repeated anew for each new [downloaded] source I am trying to build from. So to answer your question there won't be any effect from source to source. My previous remark about this 'redundancy' of information in your source was just meant to be an information. It is not an urgent request by any means. I have in fact written a Bash script to automatically apply this patch before starting to build the package.

jim-easterbrook commented 8 years ago

Commit 4f3281f changes things so that init.py is only changed when there is a valid git repos and some other change has been made. I hope this means it will no longer need to be patched when Photini is packaged.

pmo-19 commented 8 years ago

OK. I will try soon.

pmo-19 commented 8 years ago

Well, I took time to install the latest version of python-flickrapi 2.1.2 in my Launchpad PPA. So I could upload your latest version 2016.02.0 for Photini. Everything looks fine and I do not need the patch anymore :-). The packages are accessible at this Launchpad webpage. One minor thing is that on your release tarballs you put the name Photini. Usually GitHub users only put the version nbr. or some add a v in front of the number. As GitHub will automatically add in front the project's name Photini so in your case we end up with a file named Photini-Photini-2016.02.0.tar.gz ...

jim-easterbrook commented 8 years ago

I tag the releases with 'Photini' to differentiate them from the Windows installer releases. I've never used tar.gz files from GitHub so didn't see the problem.

jim-easterbrook commented 8 years ago

I've gone back to a more conventional release tag naming scheme now. Note the 2016.02.0 release includes a Google maps API key that I accidentally invalidated. I've put up a 2016.02.1 replacement.

pmo-19 commented 8 years ago

OK. The new version corrects the error. Everything is fine now.

SebastianSpeer commented 6 years ago

I am experiencing the same problem running nipype '0.14.0-rc1'. I have installed the latest version of Photini but it did not help. Do you have any suggestions?

jim-easterbrook commented 6 years ago

What has nipype to do with Photini?