Troubleshooting python-jose Installation

Introduction

The JavaScript Object Signing and Encryption (JOSE) technologies – JSON Web Signature (JWS), JSON Web Encryption (JWE), JSON Web Key (JWK), and JSON Web Algorithms (JWA) – collectively can be used to encrypt and/or sign content using a variety of algorithms.

Installation

$ pip install python-jose

Troubleshooting

When I tried to install python-jose on my Mac running Mac OS Sierra (MacOS 10.12.6), I was getting a RuntimeError: autoconf error.

To get around this issue, I had to run the following command.

$ xcode-select --install

This command pops up a window asking your permission to install xcode compiler. Once the compiler install went through, the pip install worked without issue.

Full details of error below:

(newpython3) srini-macbookpro:aws-auth0-auth skarlekar$ (newpython3) srini-macbookpro:aws-auth0-auth skarlekar$ pip install python-jose The directory ‘/Users/skarlekar/Library/Caches/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag. The directory ‘/Users/skarlekar/Library/Caches/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag. Collecting python-jose
Downloading python_jose-1.4.0-py2.py3-none-any.whl Collecting ecdsa<1.0 (from python-jose) Downloading ecdsa-0.13-py2.py3-none-any.whl (86kB) 100% |████████████████████████████████| 92kB 3.6MB/s Collecting six<2.0 (from python-jose) Downloading six-1.11.0-py2.py3-none-any.whl Collecting future<1.0 (from python-jose) Downloading future-0.16.0.tar.gz (824kB) 100% |████████████████████████████████| 829kB 941kB/s Collecting pycrypto<2.7.0,>=2.6.0 (from python-jose) Downloading pycrypto-2.6.1.tar.gz (446kB) 100% |████████████████████████████████| 450kB 1.6MB/s Installing collected packages: ecdsa, six, future, pycrypto, python-jose
Running setup.py install for future … done Running setup.py install for pycrypto … error Complete output from command /Users/skarlekar/anaconda/envs/newpython3/bin/python -u -c “import setuptools, tokenize;file=’/private/var/folders/zh/54fz82bn0tb4cgv0bdjcffqw0000gn/T/pip-build-spygzevz/pycrypto/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install –record /var/folders/zh/54fz82bn0tb4cgv0bdjcffqw0000gn/T/pip-y3p2qipv-record/install-record.txt –single-version-externally-managed –compile: running install running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.6 creating build/lib.macosx-10.7-x86_64-3.6/Crypto copying lib/Crypto/init.py -> build/lib.macosx-10.7-x86_64-3.6/Crypto copying lib/Crypto/pct_warnings.py -> build/lib.macosx-10.7-x86_64-3.6/Crypto creating build/lib.macosx-10.7-x86_64-3.6/Crypto/Hash copying lib/Crypto/Hash/init.py -> build/lib.macosx-10.7-x86_64-3.6/Crypto/Hash copying lib/Crypto/Hash/hashalgo.py -> build/lib.macosx-10.7-x86_64-3.6/Crypto/Hash … … (snipped for brevity) … Skipping optional fixer: buffer Skipping optional fixer: idioms Skipping optional fixer: set_literal Skipping optional fixer: ws_comma running build_ext running build_configure checking for gcc… gcc checking whether the C compiler works… yes checking for C compiler default output file name… a.out checking for suffix of executables… checking whether we are cross compiling… configure: error: in /private/var/folders/zh/54fz82bn0tb4cgv0bdjcffqw0000gn/T/pip-build-spygzevz/pycrypto':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use
–host’. See `config.log’ for more details Traceback (most recent call last): File ““, line 1, in File “/private/var/folders/zh/54fz82bn0tb4cgv0bdjcffqw0000gn/T/pip-build-spygzevz/pycrypto/setup.py”, line 456, in core.setup(**kw) File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/core.py”, line 148, in setup dist.run_commands() File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/dist.py”, line 955, in run_commands self.run_command(cmd) File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/dist.py”, line 974, in run_command cmd_obj.run() File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/site-packages/setuptools/command/install.py”, line 61, in run return orig.install.run(self) File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/command/install.py”, line 545, in run self.run_command(‘build’) File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/dist.py”, line 974, in run_command cmd_obj.run() File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/command/build.py”, line 135, in run self.run_command(cmd_name) File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/dist.py”, line 974, in run_command cmd_obj.run() File “/private/var/folders/zh/54fz82bn0tb4cgv0bdjcffqw0000gn/T/pip-build-spygzevz/pycrypto/setup.py”, line 251, in run self.run_command(cmd_name) File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File “/Users/skarlekar/anaconda/envs/newpython3/lib/python3.6/distutils/dist.py”, line 974, in run_command cmd_obj.run() File “/private/var/folders/zh/54fz82bn0tb4cgv0bdjcffqw0000gn/T/pip-build-spygzevz/pycrypto/setup.py”, line 278, in run raise RuntimeError(“autoconf error”) RuntimeError: autoconf error
-—————————————