Closed Moon-developer closed 4 years ago
For anyone who might be interested in downloading resources for offline or behind a proxy, but don't know where to look, just follow the following instructions:
Goto site-packages/snips_nlu/cli/
and edit the utils.py as follows:
If you are using a corporate proxy edit line 72
and change it r = requests.ge(url, verify=False)
to what best works for you behind your proxy. I had to change my verify to True
in my case but might be different for you.
Next step is goto line 103
and change pip_args = ['--no-cache-dir', '--no-deps']
to pip_args = ['--no-cache-dir', '--no-deps', '--trusted-host', 'pypi.org', '--trusted-host', 'files.pythonhosted.org', '--proxy=http://your.proxy.com:8080']
, Alternatively you can put a print(download_url)
in line 103
instead and run the python -m snips_nlu download en
command and see the link it gives you. Click it to download the file, extract it, move it to where you want to install it and run the python setup.py install
command inside the directory and then run the python -m snips_nlu download en
command again and you will see it found the required dependencies and ends up linking it instead of trying to download it.
Hope this helps. Took me awhile to figure this out myself.
Thanks @Moondog360
I would add that you can pass extra pip args directly to the snips-nlu
CLI after --
:
python -m snips_nlu download en -- \
--trusted-host pypi.org \
--trusted-host files.pythonhosted.org \
--proxy=http://your.proxy.com:8080
@adrienball I did not find anything to execute it the way you mentioned. This helps a lot. Still needed to changed verify
to False
on line 72
of utils.py
but this still helped a lot working behind corporate proxies.
Question
Hi, I run the following:
python -m snips-nlu download en
andsnips-nlu download en
and I always get the followingWhether I set a proxy or not in my
env
I still get this this error. Is it possible to add argument flags to manually pass these in during download and whether or not to setverify=True
orverify=False
in the requests?