pydio / pydio-sync

Python version of the Pydio synchronization client
https://pydio.com
GNU General Public License v3.0
82 stars 32 forks source link

[OpenWrt] No module named _ssl #135

Closed Dhouha-ma closed 8 years ago

Dhouha-ma commented 8 years ago

Hi, I try to build pydio on openwrt, i an error of dependencies of (requests==2.5.1) so when i compile python-requests i get File "./setup.py", line 6, in import requests File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/build_dir/target-mipsel_r2_uClibc-0.9.32/requests-2.5.1/requests/init.py", line 58, in from . import utils File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/build_dir/target-mipsel_r2_uClibc-0.9.32/requests-2.5.1/requests/utils.py", line 26, in from .compat import parse_http_list as _parse_list_header File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/build_dir/target-mipsel_r2_uClibc-0.9.32/requests-2.5.1/requests/compat.py", line 7, in from .packages import chardet File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/build_dir/target-mipsel_r2_uClibc-0.9.32/requests-2.5.1/requests/packages/init.py", line 3, in from . import urllib3 File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/build_dir/target-mipsel_r2_uClibc-0.9.32/requests-2.5.1/requests/packages/urllib3/init.py", line 10, in from .connectionpool import ( File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/build_dir/target-mipsel_r2_uClibc-0.9.32/requests-2.5.1/requests/packages/urllib3/connectionpool.py", line 31, in from .connection import ( File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/build_dir/target-mipsel_r2uClibc-0.9.32/requests-2.5.1/requests/packages/urllib3/connection.py", line 45, in from .util.ssl import ( File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/build_dir/target-mipsel_r2uClibc-0.9.32/requests-2.5.1/requests/packages/urllib3/util/init.py", line 5, in from .ssl import ( File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/build_dir/target-mipsel_r2uClibc-0.9.32/requests-2.5.1/requests/packages/urllib3/util/ssl.py", line 12, in import ssl File "/home/dhouha/PFE/openwrt-na9xx-r25875-20121204/staging_dir/target-mipsel_r2_uClibc-0.9.32/usr/lib/python2.7/ssl.py", line 60, in import _ssl # if we can't import it, let the error propagate ImportError: No module named _ssl

what i'm missing ?

7omate commented 8 years ago

You're missing openssl and/or its python bindings

7omate commented 8 years ago

opkg install python-light

or build your own python with openssl

Dhouha-ma commented 8 years ago

i tried both of your suggestion and it doesn't work

why it can be built with requests 2.8.0 ?

7omate commented 8 years ago

because we use a custom writer for Uploads, if you don't need uploads it will work with newer versions

7omate commented 8 years ago

did you try running pip install -r requirements.txt python main.py ?

Dhouha-ma commented 8 years ago

i installed all the requirements and all works well except python-requests

7omate commented 8 years ago

Which version of openssl do you have ? What do you get with python -c "import ssl" ?

Dhouha-ma commented 8 years ago

Which version of openssl do you have ?

openssl-1.0.0d

What do you get with python -c "import ssl"

i get nothing

7omate commented 8 years ago

Getting nothing means there is an OpenSSL library linked to your python, which is a good sign.

How do you compile requests ? pip install request==2.5.1 ?

Dhouha-ma commented 8 years ago

I'm building on OpenWrt, i get source from https://pypi.python.org/simple/requests/ , i create package of python-requests 2.5.1 and run make package/python-requests/compile V=99

7omate commented 8 years ago

Did you try with pip ?

opkg update
opkg install distribute
opkg install python-openssl
opkg install python-bzip2
easy_install pip

from http://samjbrenner.com/notes/using-pip-to-install-python-packages-on-the-arduino-yun/ or https://blog.nyanpasu.me/install-python-and-pip-on-openwrt/

Dhouha-ma commented 8 years ago

When i try them i get

No command 'opkg' found, did you mean: Command 'dpkg' from package 'dpkg' (main) opkg: command not found

anyway i create package for all other requirements and they works well, except this problem of ssl module

7omate commented 8 years ago

No I mean opkg the package manager for OpenWrt as far as I remember https://wiki.openwrt.org/doc/techref/opkg