Elkropac / hassio-sonicwall-api

2 stars 2 forks source link

Error installing Independence, possible python 3.7 issue? #8

Open mim212 opened 4 years ago

mim212 commented 4 years ago

Firstly let me say this will be an absolute lifesaver of a project. I'm in the process of migrating from an ASUS wrt device to the more secure SonicWall SOHO W.

The SonicOS side of things is fine but when deploying the custom component and restarting hassio (Home Assistant 0.97.2) the dependencies will not install. I've deployed manually and using HACs (adding as custom repo), both have the same result.

Full log printout below

Unable to install package pycurl==7.43.0.2: ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "/tmp/pip-install-dvkjvm0k/pycurl/setup.py", line 223, in configure_unix stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/local/lib/python3.7/subprocess.py", line 775, in init restore_signals, start_new_session) File "/usr/local/lib/python3.7/subprocess.py", line 1522, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'curl-config': 'curl-config' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-dvkjvm0k/pycurl/setup.py", line 913, in ext = get_extension(sys.argv, split_extension_source=split_extension_source) File "/tmp/pip-install-dvkjvm0k/pycurl/setup.py", line 582, in get_extension ext_config = ExtensionConfiguration(argv) File "/tmp/pip-install-dvkjvm0k/pycurl/setup.py", line 99, in init self.configure() File "/tmp/pip-install-dvkjvm0k/pycurl/setup.py", line 227, in configure_unix raise ConfigurationError(msg) main.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config': 'curl-config'

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-dvkjvm0k/pycurl/ WARNING: You are using pip version 19.1.1, however version 19.2.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

Elkropac commented 4 years ago

Hello, it seems, your system is missing development files for libcurl. For example, in debian, install one of these packages: https://packages.debian.org/search?mode=path&suite=buster&section=all&arch=any&searchon=contents&keywords=%2Fusr%2Fbin%2Fcurl-config

mim212 commented 4 years ago

I believe you're right though looking into it a bit more its possible that the issue is that pycurl doesnt support python 3.7.4 yet, which the latest build of home assistant uses. I'm running hassio on a raspberry pi, so installing dependencies on the host is impossible AFAIK, though happy to learn if there is a way? Otherwise I would attempt to install the dependencies directly instead of through the integration.

Have you thought about making this available on Home Assistant Community Store (HACS)?

Elkropac commented 4 years ago

I was able to get pycurl working on HA 0.100.3.

First i found my container id of HA with: docker ps

Then started shell inside: docker exec -it containerid /bin/sh

Then installed packages

apk update 
apk add gcc
apk add libc-dev
apk add curl-dev

It throws some other error, my code is not compatible with new HA.

I guess, i will have to make it work with python-requests anyway (but i don't know, why it does not work) ...

Elkropac commented 4 years ago

Hi, i have managed to switch from pycurl to requests. Requests needed just one more header to add to make it working. Now i have to figure out, howto wire this into HA configuration