eea / odfpy

API for OpenDocument in Python
GNU General Public License v2.0
308 stars 63 forks source link

UBUNTU 16 LTS install bug #59

Open ppKrauss opened 6 years ago

ppKrauss commented 6 years ago

Using README instructions. After git clone, the python setup.py build shows

user@User:~/sandbox/odfpy$ python setup.py build
/usr/lib/python2.7/dist-packages/setuptools/dist.py:285: UserWarning: Normalizing '1.3.6dev' to '1.3.6.dev0'
  normalized_version,
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/odf
copying odf/manifest.py -> build/lib.linux-x86_64-2.7/odf
copying odf/grammar.py -> build/lib.linux-x86_64-2.7/odf
copying odf/presentation.py -> build/lib.linux-x86_64-2.7/odf
copying odf/dc.py -> build/lib.linux-x86_64-2.7/odf
....
changing mode of build/scripts-2.7/odfuserfield from 664 to 775
changing mode of build/scripts-2.7/xml2odf from 664 to 775

So, seems all fine... But python3 setup.py build

Traceback (most recent call last):
  File "setup.py", line 22, in <module>
    from setuptools import setup
ImportError: No module named 'setuptools'

It is a bug in the instructions or a bug at my UNUNTU...

ppKrauss commented 6 years ago

The ideal is a correction at README (please NOTICE the bug there) or the source code... A workaround stackoverflow.com/a/14426553, sudo apt-get install python3-setuptools.

icemac commented 6 years ago

As setuptools is used by setup.py it should be declared as install dependency.

chfw commented 6 years ago

How about having the following statement in the setup.py:

try:
    from setuptools import setup
except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup
icemac commented 6 years ago

@chfw ez_setup needed be installed either, I thought of:

setup(
    ...
install_requires=['setuptools'],
    ...)

or even

setup(
    ...
setup_requires=['setuptools'],
    ...)
chfw commented 6 years ago

but setup comes from setuptools so I am afraid it does not help much. If setup is not found from ez_setup or setuptools, then the python environment itself needs additional work. Get python-pip onto it.