【问题标题】:When trying to install JWT package for Django getting error: command 'x86_64-linux-gnu-gcc' failed with exit status 1尝试为 Django 安装 JWT 包时出现错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1
【发布时间】:2019-05-23 12:30:44
【问题描述】:

我在 django 项目上工作,我收到了一个错误

ImproperlyConfigured: Error importing middleware erp.middleware: "No module named jwt"
所以我尝试通过键入来安装 jwt 包

pip install jwt

导致错误

 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/

我不知道发生了什么问题,请帮我解决这个问题 我正在使用 ubuntu 18.04 LTS 蟒蛇2.7.15rc1 django 1.3.7

【问题讨论】:

  • 你可以试试sudo apt install python-dev libffi-dev

标签: django installation jwt


【解决方案1】:

试试这些命令

sudo apt-get install python-dev
sudo apt-get install libffi-dev

我会建议使用最新版本的python和Django。

【讨论】:

  • hmmm ...我发现问题是我错误地将jwt包名称输入为pip install jwt,但它是pip install PyJWT
  • 添加您的修复程序。这些可能会对其他开发者有所帮助。
猜你喜欢
  • 2016-08-27
  • 1970-01-01
  • 2016-01-08
  • 1970-01-01
  • 2014-11-21
  • 2017-05-20
  • 1970-01-01
  • 2016-04-18
  • 2014-10-29
相关资源
最近更新 更多