Issue #43 new

Compile for python 3?

Anonymous created an issue

Hello, I'm trying to get pgmagick 0.5.7 to work with Python 3 on my ArchLinux system.

First thing I had to do was linking to the Python 3 boost libraries, by changing lines 83 and following on setup.py from

if _version >= (3, ):
    boost_lib_target_files.append("boost_python-py%s%s" % (_version[0], _version[1]))
boost_lib_target_files.append("boost_python-mt-py%s%s" % (_version[0], _version[1]))
#gentoo appends the python version numbers to the boost_python libraries
boost_lib_target_files.append("boost_python-%s.%s" % (_version[0], _version[1]))
boost_lib_target_files.append("boost_python-mt")

to

if _version >= (3, ):
    boost_lib_target_files.append("boost_python-py%s%s" % (_version[0], _version[1]))
    # ArchLinux uses boost_python3
    boost_lib_target_files.append("boost_python%s" % (_version[0]))
boost_lib_target_files.append("boost_python-mt-py%s%s" % (_version[0], _version[1]))
#gentoo appends the python version numbers to the boost_python libraries
boost_lib_target_files.append("boost_python-%s.%s" % (_version[0], _version[1]))
boost_lib_target_files.append("boost_python-mt")

Now, when I launch setup.py, I get the following error:

$ sudo python setup.py install
include header path: /usr/include/GraphicsMagick/
Found boost lib: /usr/lib64/libboost_python3
boost lib: boost_python3
library path: /usr/lib64/libGraphicsMagick++
Libraries: ['boost_python3', 'GraphicsMagick++']
GraphicsMagick version: 1.3.19
running install
Traceback (most recent call last):
  File "setup.py", line 174, in <module>
    keywords="GraphicsMagick ImageMagick graphics boost image")
  File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.4/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/lib/python3.4/site-packages/setuptools/command/install.py", line 103, in do_egg_install
    cmd.ensure_finalized()  # finalize before bdist_egg munges install cmd
  File "/usr/lib/python3.4/distutils/cmd.py", line 107, in ensure_finalized
    self.finalize_options()
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 313, in finalize_options
    self.index_url, search_path=self.shadow_path, hosts=hosts,
  File "/usr/lib/python3.4/site-packages/setuptools/package_index.py", line 269, in __init__
    Environment.__init__(self,*args,**kw)
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 799, in __init__
    self.scan(search_path)
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 829, in scan
    self.add(dist)
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 849, in add
    dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
TypeError: unorderable types: str() < NoneType()

I am quite new to building Python packages, so I'm not sure about what is going wrong.

Any help is appreciated.

Thanks,

gm

Comments (1)

  1. Hideo Hattori repo owner

    Sorry for late reply.

    if _version >= (3, ):
        boost_lib_target_files.append("boost_python-py%s%s" % (_version[0], _version[1]))
        # ArchLinux uses boost_python3
        boost_lib_target_files.append("boost_python%s" % (_version[0]))
    boost_lib_target_files.append("boost_python-mt-py%s%s" % (_version[0], _version[1]))
    #gentoo appends the python version numbers to the boost_python libraries
    boost_lib_target_files.append("boost_python-%s.%s" % (_version[0], _version[1]))
    boost_lib_target_files.append("boost_python-mt")
    

    fix in 735e0eeaa05bf04, Thanks.

    I am quite new to building Python packages, so I'm not sure about what is going wrong. Any help is appreciated.

    A result that I also tried, build was successful. my environment is following:

    * ArchLinux on Docker
      use https://registry.hub.docker.com/u/base/archlinux/
    * Python3.4.3 with virtualenv
    * pgmagick 0.5.9 + fix setup.py for uses 'boost_python3'
    
  2. Log in to comment