django - When trying to install JWT package for Django getting error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
问题描述
I was working on django project where i had received an error
ImproperlyConfigured: Error importing middleware erp.middleware: "No module named jwt"
pip install jwt
which leads to an error
build/temp.linux-x86_64-2.7/_openssl.c:3551:13: warning: ‘_ssl_thread_locking_function’ defined but not used [-Wunused-function]
static void _ssl_thread_locking_function(int mode, int n, const char *file,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Rolling back uninstall of cryptography
Command "/home/charles/.virtualenvs/virtualenvpython/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-hU6Fxe/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-h5K4aB/install-record.txt --single-version-externally-managed --compile --install-headers /home/charles/.virtualenvs/virtualenvpython/include/site/python2.7/cryptography" failed with error code 1 in /tmp/pip-install-hU6Fxe/cryptography/
i dont what issue is going on please help me to solve this issue i am using ubuntu 18.04 LTS python 2.7.15rc1 django 1.3.7
解决方案
试试这些命令
sudo apt-get install python-dev
sudo apt-get install libffi-dev
我会建议使用最新版本的 python 和 Django。
推荐阅读
- binding - Aurelia:任何属性被修改时的通知
- laravel - Laravel,选择所有发布其第一个批准修订的帖子
- apache-spark - pyspark:如果键不存在或 row.timestamp 更新,则插入数据帧
- android - Android AppCompat-v7 和 Firestore gradle 冲突
- ssl - 基于 OAuth 令牌的身份验证是否与物理机或私钥相关联?
- java - 找不到符号 (Java)
- xquery - MarkLogic 中的 cts:search 选项中哪个是更好的 collection() 或根元素
- keyboard-shortcuts - 创建简单绑定键盘快捷键的 Wayland 桌面环境
- image - 未找到 image::ImageBuffer::from_vec() 的函数或相关项
- spotfire - 列到行并突出显示同一组中值之间的差异