Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install python package with c #218

Closed
magician333 opened this issue Apr 18, 2016 · 7 comments
Closed

Can't install python package with c #218

magician333 opened this issue Apr 18, 2016 · 7 comments

Comments

@magician333
Copy link

magician333 commented Apr 18, 2016

if i use pip install python package which include C (such as lxml , misaka ) , it will wrong. By the way ,I installed gcc and python-dev

@fornwall
Copy link
Member

fornwall commented Apr 18, 2016

For lxml you add libxml2-dev and libxslt-dev, so the full list of dependencies to install should be:

apt install clang libxml2-dev libxslt-dev python-dev

After that you should be able to pip install lxml - show me the error message if this does not work for you!

@fornwall
Copy link
Member

fornwall commented Apr 18, 2016

Install the dependency (for cffi, which misaka depends on):

apt install libffi-dev

and finally install misaka with:

pip install --upgrade --force-reinstall misaka

where --upgrade --force-reinstall forces rebuilds of packages that you may have builkt with older gcc versions. Let me know if this works for you!

@magician333
Copy link
Author

@fornwall Still can't this is response message

Installed /data/data/com.termux/files/usr/tmp/pip-build-p7kbv_ef/misaka/.eggs/cffi-1.5.2-py3.5-linux-aarch64.egg
Searching for pycparser
Reading https://pypi.python.org/simple/pycparser/
Best match: pycparser 2.14
Downloading https://pypi.python.org/packages/source/p/pycparser/pycparser-2.14.tar.gz#md5=a2bc8d28c923b4fe2b2c3b4b51a4f935
Processing pycparser-2.14.tar.gz
Writing /data/data/com.termux/files/usr/tmp/easy_install-pv94m74k/pycparser-2.14/setup.cfg
Running pycparser-2.14/setup.py -q bdist_egg --dist-dir /data/data/com.termux/files/usr/tmp/easy_install-pv94m74k/pycparser-2.14/egg-dist-tmp-ryhgcdb6
warning: no previously-included files matching 'yacctab.' found under directory 'tests'
warning: no previously-included files matching 'lextab.
' found under directory 'tests'
warning: no previously-included files matching 'yacctab.' found under directory 'examples'
warning: no previously-included files matching 'lextab.
' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
Moving pycparser-2.14-py3.5.egg to /data/data/com.termux/files/usr/tmp/pip-build-p7kbv_ef/misaka/.eggs

Installed /data/data/com.termux/files/usr/tmp/pip-build-p7kbv_ef/misaka/.eggs/pycparser-2.14-py3.5.egg
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/data/data/com.termux/files/usr/tmp/pip-build-p7kbv_ef/misaka/setup.py", line 68, in <module>
    cffi_modules=['build_ffi.py:ffi'],
  File "/data/data/com.termux/files/usr/lib/python3.5/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/setuptools/dist.py", line 272, in __init__
    _Distribution.__init__(self,attrs)
  File "/data/data/com.termux/files/usr/lib/python3.5/distutils/dist.py", line 281, in __init__
    self.finalize_options()
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/setuptools/dist.py", line 327, in finalize_options
    ep.load()(self, ep.name, value)
  File "/data/data/com.termux/files/usr/tmp/pip-build-p7kbv_ef/misaka/.eggs/cffi-1.5.2-py3.5-linux-aarch64.egg/cffi/setuptools_ext.py", line 161, in cffi_modules
    add_cffi_module(dist, cffi_module)
  File "/data/data/com.termux/files/usr/tmp/pip-build-p7kbv_ef/misaka/.eggs/cffi-1.5.2-py3.5-linux-aarch64.egg/cffi/setuptools_ext.py", line 48, in add_cffi_module
    execfile(build_file_name, mod_vars)
  File "/data/data/com.termux/files/usr/tmp/pip-build-p7kbv_ef/misaka/.eggs/cffi-1.5.2-py3.5-linux-aarch64.egg/cffi/setuptools_ext.py", line 24, in execfile
    exec(code, glob, glob)
  File "build_ffi.py", line 51, in <module>
    ffi = cffi.FFI()
  File "/data/data/com.termux/files/usr/tmp/pip-build-p7kbv_ef/misaka/.eggs/cffi-1.5.2-py3.5-linux-aarch64.egg/cffi/api.py", line 56, in __init__
    import _cffi_backend as backend
ImportError: dlopen failed: unknown reloc type 17 @ 0x4120f350 (442)

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-build-p7kbv_ef/misaka/

@fornwall
Copy link
Member

@magician333 Ok, can you double-check that you have the right gcc version by running apt-cache show gcc | grep Version and verify that the output is Version: 5.3.0-2?

Can you also try to reinstall cffi:

pip uninstall cffi
pip install cffi

and then try to install misaka again?

@magician333
Copy link
Author

@fornwall Thanks a lot, I already installed,I'll close this issue

@magician333
Copy link
Author

eee,@fornwall And another thing ,I install gevent for python also failed,How to do?

@fornwall
Copy link
Member

Closed as part of #283.

@ghost ghost locked and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants