keshavdv / unifi-cam-proxy

Enable non-Ubiquiti cameras to work with Unifi NVR
MIT License
1.72k stars 236 forks source link

PIP install command fails #3

Closed yetdog closed 3 years ago

yetdog commented 4 years ago

root@unifi-nvr:~# pip install unifi-cam-proxy Collecting unifi-cam-proxy Downloading https://files.pythonhosted.org/packages/10/17/971113610369d21c5e0e61fa420bd5a35d4ab49b38c229a3ed0c467ab1dc/unifi-cam-proxy-0.0.3.tar.gz Running setup.py (path:/tmp/pip-build-VlS1fG/unifi-cam-proxy/setup.py) egg_info for package unifi-cam-proxy produced metadata for project name unknown. Fix your #egg=unifi-cam-proxy fragments. Building wheels for collected packages: unknown, unknown Running setup.py bdist_wheel for unknown ... done Stored in directory: /root/.cache/pip/wheels/5d/2b/76/a87242ac9eca3194aa77429c1de246a208203a0fb87457a9bd Running setup.py bdist_wheel for unknown ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-VlS1fG/unknown/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" bdist_wheel -d /tmp/tmpvvjBz7pip-wheel- --python-tag cp27: Traceback (most recent call last): File "", line 1, in IOError: [Errno 2] No such file or directory: '/tmp/pip-build-VlS1fG/unknown/setup.py'


Failed building wheel for unknown Running setup.py clean for unknown Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-VlS1fG/unknown/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" clean --all: Traceback (most recent call last): File "", line 1, in IOError: [Errno 2] No such file or directory: '/tmp/pip-build-VlS1fG/unknown/setup.py'


Failed cleaning build dir for unknown Successfully built unknown Failed to build unknown Installing collected packages: unknown Successfully installed unknown-0.0.0 You are using pip version 8.1.1, however version 20.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

keshavdv commented 4 years ago

This looks like an error specific to your environment. Since this is a recipe for a rabbit hole, I've created a docker image that you can use instead and added a corresponding docker-compose file to the repo. Please try the following instead:

docker run -e RTSP_URL=<your RTSP url> -e TOKEN=<adoption token from NVR UI> -e HOST=<your NVR IP>  -v <path to cert>:/client.pem keshavdv/unifi-cam-proxy:0.0.4
yetdog commented 4 years ago

Built a new system, made sure all software up to date. Got this far:

[root@unifi-cam-proxy shopcam]# docker-compose up -d Recreating shopcam_unifi-cam-proxy_1 ... done [root@unifi-cam-proxy shopcam]# docker logs shopcam_unifi-cam-proxy_1 usage: unifi-cam-proxy [-h] --host HOST --cert CERT --token TOKEN [--mac MAC] [--ip IP] [--name NAME] [--verbose] {hikvision,rtsp} ... unifi-cam-proxy: error: too few arguments

[root@unifi-cam-proxy shopcam]# cat docker-compose.yaml version: '3.7' services: unifi-cam-proxy: image: keshavdv/unifi-cam-proxy volumes:

yetdog commented 4 years ago

I also tried to run the command as you specified:

docker run -e RTSP_URL=rtsp://admin:@192.168.110.15:80/cam/realmonitor?channel=1&subtype=0 -e TOKEN=kMcwLmANJNOqpvn -e HOST=192.168.111.243 -e MAC=AA:BB:CC:00:11:22 -v /root/shopcam/client.pem:/client.pem keshavdv/unifi-cam-proxy:0.0.4 docker run -e RTSP_URL=rtsp://admin:eatMEdnf install docker-ce-3:18.09.1-3.el7.@192.168.110.15:80/cam/realmonitor?channel=1&subtype=0 -e TOKEN=kMcwLmANJNOqpvn -e HOST=192.168.111.243 -e MAC=AA:BB:CC:00:11:22 -v /root/shopcam/client.pem:/client.pem keshavdv/unifi-cam-proxy:0.0.4 [1] 19040 bash: -e: command not found... Unable to find image 'install:latest' locally [root@unifi-cam-proxy shopcam]# docker: Error response from daemon: pull access denied for install, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'.

[1]+ Exit 125 docker run -e RTSP_URL=rtsp://admin:eatMEdnf install docker-ce-3:18.09.1-3.el7.@192.168.110.15:80/cam/realmonitor?channel=1 [root@unifi-cam-proxy shopcam]# ^C

keshavdv commented 4 years ago

You need to fill in the environment variables in your copy of the docker-compose file for that to work. For the run command, try quoting your strings (the ampersand in your RTSP url is breaking the command into two):

docker run -e "RTSP_URL=rtsp://admin:eatME@192.168.110.15:80/cam/realmonitor?channel=1&subtype=0" -e "TOKEN=kMcwLmANJNOqpvn" -e "HOST=192.168.111.243" -e "MAC=AA:BB:CC:00:11:22" -v /root/shopcam/client.pem:/client.pem keshavdv/unifi-cam-proxy:0.0.4