【发布时间】:2020-07-25 00:00:02
【问题描述】:
我已经在 python 2.7 中安装了 requests 模块,但是在导入它时给了我
import-im6.q16: not authorized `requests' @ error/constitute.c/WriteImage/1037
这是为什么呢?
【问题讨论】:
标签: python python-2.7 python-requests
我已经在 python 2.7 中安装了 requests 模块,但是在导入它时给了我
import-im6.q16: not authorized `requests' @ error/constitute.c/WriteImage/1037
这是为什么呢?
【问题讨论】:
标签: python python-2.7 python-requests
您收到此错误是因为您的脚本不是由 python 执行的,但很可能是由 bash 执行的。
您看到的错误可能是由import 可执行文件(它是ImageMagick 的一部分)产生的。如果你尝试执行,在 bash 中:
$ import requests
您可能会得到相同的输出。
要正确执行你的脚本,你需要使用python:
$ python your_script.py
或者
#!/usr/bin/env python
$ chmod +x your_script.py
$ ./your_script.py
【讨论】: