Skip to content

Instantly share code, notes, and snippets.

@davidkazuhiro
Created February 2, 2019 04:36
Show Gist options
  • Save davidkazuhiro/989328734e128628dd53ccab741f3e45 to your computer and use it in GitHub Desktop.
Save davidkazuhiro/989328734e128628dd53ccab741f3e45 to your computer and use it in GitHub Desktop.
For some reason, pip doesn't install boxsdk[jwt] if it's preceded by boxsdk in requirements.txt
$ docker run -it python bash
root@4610288c357f:/# echo boxsdk >> requirements.txt
root@4610288c357f:/# echo boxsdk[jwt] >> requirements.txt
root@4610288c357f:/# cat requirements.txt
boxsdk
boxsdk[jwt]
root@4610288c357f:/# pip install -r requirements.txt
Collecting boxsdk (from -r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/7f/fd/561a64bc6ee053fbdd1b55d4fbbc702fe6a6366d29caa53cd0fac773cb22/boxsdk-2.0.0-py2.py3-none-any.whl (119kB)
100% |████████████████████████████████| 122kB 6.5MB/s
Collecting requests-toolbelt>=0.4.0 (from boxsdk->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/60/ef/7681134338fc097acef8d9b2f8abe0458e4d87559c689a8c306d0957ece5/requests_toolbelt-0.9.1-py2.py3-none-any.whl (54kB)
100% |████████████████████████████████| 61kB 7.6MB/s
Collecting attrs>=16.0.0 (from boxsdk->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a514/attrs-18.2.0-py2.py3-none-any.whl
Collecting requests>=2.4.3 (from boxsdk->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
100% |████████████████████████████████| 61kB 10.0MB/s
Collecting wrapt>=1.10.1 (from boxsdk->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/67/b2/0f71ca90b0ade7fad27e3d20327c996c6252a2ffe88f50a95bba7434eda9/wrapt-1.11.1.tar.gz
Collecting six>=1.9.0 (from boxsdk->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.4.3->boxsdk->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
100% |████████████████████████████████| 163kB 6.8MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.4.3->boxsdk->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 21.6MB/s
Collecting idna<2.9,>=2.5 (from requests>=2.4.3->boxsdk->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 8.4MB/s
Collecting urllib3<1.25,>=1.21.1 (from requests>=2.4.3->boxsdk->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
100% |████████████████████████████████| 122kB 11.1MB/s
Building wheels for collected packages: wrapt
Building wheel for wrapt (setup.py) ... done
Stored in directory: /root/.cache/pip/wheels/89/67/41/63cbf0f6ac0a6156588b9587be4db5565f8c6d8ccef98202fc
Successfully built wrapt
Installing collected packages: certifi, chardet, idna, urllib3, requests, requests-toolbelt, attrs, wrapt, six, boxsdk
Successfully installed attrs-18.2.0 boxsdk-2.0.0 certifi-2018.11.29 chardet-3.0.4 idna-2.8 requests-2.21.0 requests-toolbelt-0.9.1 six-1.12.0 urllib3-1.24.1 wrapt-1.11.1
root@4610288c357f:/# python
Python 3.7.2 (default, Jan 23 2019, 02:31:57)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import boxsdk.auth.jwt_auth
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/boxsdk/auth/jwt_auth.py", line 10, in <module>
from cryptography.hazmat.backends import default_backend
ModuleNotFoundError: No module named 'cryptography'
>>>
$ docker run -it python bash
root@3d1bddbdf389:/# echo boxsdk[jwt] >> requirements.txt
root@3d1bddbdf389:/# cat requirements.txt
boxsdk[jwt]
root@3d1bddbdf389:/# pip install -r requirements.txt
Collecting boxsdk[jwt] (from -r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/7f/fd/561a64bc6ee053fbdd1b55d4fbbc702fe6a6366d29caa53cd0fac773cb22/boxsdk-2.0.0-py2.py3-none-any.whl (119kB)
100% |████████████████████████████████| 122kB 8.4MB/s
Collecting six>=1.9.0 (from boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting requests>=2.4.3 (from boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
100% |████████████████████████████████| 61kB 10.1MB/s
Collecting attrs>=16.0.0 (from boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a514/attrs-18.2.0-py2.py3-none-any.whl
Collecting requests-toolbelt>=0.4.0 (from boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/60/ef/7681134338fc097acef8d9b2f8abe0458e4d87559c689a8c306d0957ece5/requests_toolbelt-0.9.1-py2.py3-none-any.whl (54kB)
100% |████████████████████████████████| 61kB 9.8MB/s
Collecting wrapt>=1.10.1 (from boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/67/b2/0f71ca90b0ade7fad27e3d20327c996c6252a2ffe88f50a95bba7434eda9/wrapt-1.11.1.tar.gz
Collecting cryptography>=0.9.2; extra == "jwt" (from boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/98/71/e632e222f34632e0527dd41799f7847305e701f38f512d81bdf96009bca4/cryptography-2.5-cp34-abi3-manylinux1_x86_64.whl (2.4MB)
100% |████████████████████████████████| 2.4MB 10.2MB/s
Collecting pyjwt>=1.3.0; extra == "jwt" (from boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/87/8b/6a9f14b5f781697e51259d81657e6048fd31a113229cf346880bb7545565/PyJWT-1.7.1-py2.py3-none-any.whl
Collecting urllib3<1.25,>=1.21.1 (from requests>=2.4.3->boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
100% |████████████████████████████████| 122kB 7.7MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.4.3->boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 6.8MB/s
Collecting certifi>=2017.4.17 (from requests>=2.4.3->boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
100% |████████████████████████████████| 163kB 11.7MB/s
Collecting idna<2.9,>=2.5 (from requests>=2.4.3->boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 8.1MB/s
Collecting cffi!=1.11.3,>=1.8 (from cryptography>=0.9.2; extra == "jwt"->boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/51/7b/d1014289d0578c3522b2798b9cb87c65e5b36798bd3ae68a75fa1fe09e78/cffi-1.11.5-cp37-cp37m-manylinux1_x86_64.whl (421kB)
100% |████████████████████████████████| 430kB 14.6MB/s
Collecting asn1crypto>=0.21.0 (from cryptography>=0.9.2; extra == "jwt"->boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
100% |████████████████████████████████| 102kB 8.0MB/s
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography>=0.9.2; extra == "jwt"->boxsdk[jwt]->-r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
100% |████████████████████████████████| 163kB 38.3MB/s
Building wheels for collected packages: wrapt, pycparser
Building wheel for wrapt (setup.py) ... done
Stored in directory: /root/.cache/pip/wheels/89/67/41/63cbf0f6ac0a6156588b9587be4db5565f8c6d8ccef98202fc
Building wheel for pycparser (setup.py) ... done
Stored in directory: /root/.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511
Successfully built wrapt pycparser
Installing collected packages: six, urllib3, chardet, certifi, idna, requests, attrs, requests-toolbelt, wrapt, pycparser, cffi, asn1crypto, cryptography, pyjwt, boxsdk
Successfully installed asn1crypto-0.24.0 attrs-18.2.0 boxsdk-2.0.0 certifi-2018.11.29 cffi-1.11.5 chardet-3.0.4 cryptography-2.5 idna-2.8 pycparser-2.19 pyjwt-1.7.1 requests-2.21.0 requests-toolbelt-0.9.1 six-1.12.0 urllib3-1.24.1 wrapt-1.11.1
root@3d1bddbdf389:/# python
Python 3.7.2 (default, Jan 23 2019, 02:31:57)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import boxsdk.auth.jwt_auth
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment