FSX / misaka

A Python binding for Hoedown.
http://misaka.61924.nl
MIT License
418 stars 65 forks source link

pip install misaka setup error in ubuntu 15.10 64-bit #47

Closed ethe closed 8 years ago

ethe commented 9 years ago
Collecting misaka
  Using cached misaka-2.0.0.tar.gz
    Complete output from command python setup.py egg_info:
    gcc: error: i386: No such file or directory
    gcc: error: x86_64: No such file or directory
    gcc: error: unrecognized command line option ‘-arch’
    gcc: error: unrecognized command line option ‘-arch’
    gcc: error: unrecognized command line option ‘-Qunused-arguments’
    gcc: error: i386: No such file or directory
    gcc: error: x86_64: No such file or directory
    gcc: error: unrecognized command line option ‘-arch’
    gcc: error: unrecognized command line option ‘-arch’
    gcc: error: unrecognized command line option ‘-Qunused-arguments’

        No working compiler found, or bogus compiler options
        passed to the compiler from Python's distutils module.
        See the error messages above.
        (If they are about -mno-fused-madd and you are on OS/X 10.8,
        see http://stackoverflow.com/questions/22313407/ .)
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-Ttx3lI/misaka/setup.py", line 68, in <module>
        cffi_modules=['build_ffi.py:ffi'],
      File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 268, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
        replace_conflicting=True,
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 836, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1081, in best_match
        return self.obtain(req, installer)
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1093, in obtain
        return installer(requirement)
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
        return cmd.easy_install(req)
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 638, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 668, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 851, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1079, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/home/zeno/mostfun/june/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1067, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with 1

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Ttx3lI/misaka
ethe commented 9 years ago

i tried to use pip install misaka on debian, it's no problem. git clone source and build it on ubuntu 15.04, also done.

FSX commented 9 years ago

I see No working compiler found, or bogus compiler options. Did you install gcc on Ubuntu?

ethe commented 9 years ago

certainly... i'm confident that.

ethe commented 9 years ago

i have built it from source.

FSX commented 9 years ago

Is the path to the gcc executables also in the $PATH environment variable?

I'll setup an Ubuntu vm later today (I just woke up) and see if I can reproduce this issue.

ethe commented 9 years ago

Path has no problem, I can use pip to install uwsgi by gcc. Anyway, I think it's a small trouble, because I still installed misaka building from source.

ReneFroger commented 9 years ago

Any update on this in order to solve it, @ethe ? I'm struggling with the same problem now (Xubuntu with XFCE4).

ethe commented 9 years ago

@ReneFroger Nope, you can try to install misaka by building from source.

FSX commented 9 years ago

I just tested on Ubuntu and Xubuntu and everything works.

I had to install python-dev and libffi-dev.

ethe commented 9 years ago

I'm confident that I have installed python-dev and libffi-dev before, did you installed the latest version(15.10) of ubuntu in test? A strange thing, I tried to use pip install miska just now in a clean virtualenv, it works no problem. But when I attempted install misaka in global, I got an error like this:

zeno@go:~$ sudo pip install misaka
The directory '/home/zeno/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/zeno/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting misaka
  Downloading misaka-2.0.0.tar.gz (121kB)
    100% |████████████████████████████████| 122kB 211kB/s 
Requirement already satisfied (use --upgrade to upgrade): cffi>=1.0.0 in /usr/lib/pypy/lib_pypy (from misaka)
Installing collected packages: misaka
  Running setup.py install for misaka
    Complete output from command /usr/bin/pypy -c "import setuptools, tokenize;__file__='/tmp/pip-build-WOEXNs/misaka/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-VqVy4s-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/misaka
    copying misaka/callbacks.py -> build/lib.linux-x86_64-2.7/misaka
    copying misaka/constants.py -> build/lib.linux-x86_64-2.7/misaka
    copying misaka/utils.py -> build/lib.linux-x86_64-2.7/misaka
    copying misaka/__init__.py -> build/lib.linux-x86_64-2.7/misaka
    copying misaka/api.py -> build/lib.linux-x86_64-2.7/misaka
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-2.7/misaka._hoedown.c'
    creating build/temp.linux-x86_64-2.7
    building 'misaka._hoedown' extension
    creating build/temp.linux-x86_64-2.7/build
    creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/misaka
    creating build/temp.linux-x86_64-2.7/misaka/hoedown
    cc -O2 -fPIC -Wimplicit -Imisaka -I/usr/lib/pypy/include -c build/temp.linux-x86_64-2.7/misaka._hoedown.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/misaka._hoedown.o
    build/temp.linux-x86_64-2.7/misaka._hoedown.c:2:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/pypy -c "import setuptools, tokenize;__file__='/tmp/pip-build-WOEXNs/misaka/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-VqVy4s-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-WOEXNs/misaka
zeno@go:~$ cc
cc: fatal error: no input files
compilation terminated.
FSX commented 9 years ago

I tested it on the latest Ubuntu in Virtualbox. I can install everything without problems. Same for Xubuntu.

build/temp.linux-x86_64-2.7/misaka._hoedown.c:2:20: fatal error: Python.h: No such file or directory

That's the error you usually get when python-dev is not installed.

Can you run sudo apt-get install python-dev and try to install Misaka again?

ethe commented 9 years ago

I'm sure I have already installed python-dev... If not, why could I bulit it from source? I guess the reason may be about path setting. Maybe upgrading ubuntu 15.04 to 15.10 changed the file Python.h's path. Now I try to reinstall python-dev, but removing it will cost so high because nvidia's graphics driver relies on it...

ethe commented 8 years ago

I found what happend, sudo -H python /usr/local/bin/pip install misaka could install correctly. Because I installed pypy before and pypy's pip replace the alias pip from cpython. It's a so stupid issue, I'm sorry for wasting your time... @ReneFroger May be it's helpful to you

ReneFroger commented 8 years ago

I watched this issue, but and my issue seems solved now.

FSX commented 8 years ago

Do you know what solved it for you?

ReneFroger commented 8 years ago

Yes, I believe. Thanks to your comment, had to install python-dev and libffi-dev.

mshava commented 7 years ago

Hey Guys,

I'm really struggling to get misaka up and running, it keeps on telling me that module 'misaka' has no attribute 'html'.Please help out if you can

Thank You