I installed scrapy by pip , when run scrapy, the error occurs.
Error log snippets
from OpenSSL import rand, crypto, SSL
File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/OpenSSL/rand.py", line 12, in <module>
from OpenSSL._util import (
File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError:
dlopen failed: library name "/data/data/com.termux/files/usr/lib/python3.5/site-packages/cryptography/hazmat/bindings/_openssl.cpython-35m-aarch64-linux-gnu.so" too long
Hm, the error message seems to come from line 245 in the bionic linker.cpp](https://github.com/android/platform_bionic/blob/master/linker/linker.cpp#L245).
if (strlen(name) >= PATH_MAX) {
DL_ERR("library name \"%s\" too long", name);
return nullptr;
}
But PATH_MAX is 4096 while the actual path length here is 130.
Ok, the limit was 128 chars before, changed in this commit on 31 Mar 2015, which should be in Android 6.0 or later.
@googost Do you encounter this error on an Android 5.x device?
I do :)
Installing a Chicken Scheme egg, and that's exactly where it fails. Android 5.0.2.
@noncom Thanks for the feedback!
Unfortunately there is not much we can do about this platform bug in Termux except noting that is has been resolved in Android 6.0.
Well, just for the sake of completeness and if anyone meets the same problem: I have significantly shortened the installation path for Chicken Scheme and it worked!
As a _possible_ solution for other programs/cases: try setting LD_LIBRARY_PATH variable in your bashrc to something really short, like ~/lib and move the library binaries in there.
@noncom Can you detail the steps to solve the problem, thanks.
@qiaone Sorry, I do not remember where was that exactly. there were so many problems all in all that I've lost what was what. Specifically, after finally getting Chicken Scheme to work, I've found out that one of the cornerstone packages that I wanted to experiment with (networking) was impossible to use on Android because one of its dependencies could not be compiled.
So, in the end, even that Chicken Scheme itself worked, I was unable to do what I needed with it because of one of the eggs not working under the OS.
As for the matter, I think that what I changed was the installation path in one of the make files that Chicken Scheme uses to compile and install itself.
One thing I can tell for sure is that the Chicken Scheme IRC group is very friendly and welcoming, I would not be able to overcome the difficulties I had without their support. So I think you could find more real advice in there.
Thanks for your kind reply, @noncom
I tried to move the library folder of Termux to a shorter path, but it failed to start. After trial and error, I also gave up the idea of using Termux as a full-fledged environment and started doing some Python programming using Jupyter, which it works well. Thanks again for your advice.
Most helpful comment
Well, just for the sake of completeness and if anyone meets the same problem: I have significantly shortened the installation path for Chicken Scheme and it worked!
As a _possible_ solution for other programs/cases: try setting LD_LIBRARY_PATH variable in your bashrc to something really short, like
~/liband move the library binaries in there.