python - 我需要安装 "quandl"。但是当我在终端中键入 "sudo pip install quandl"时,出现以下错误 :

标签 python linux machine-learning ubuntu-16.04 quandl

eranga@eranga-Inspiron-3521:~$ sudo pip install quandl
The directory '/home/eranga/.cache/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 '/home/eranga/.cache/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 quandl
  Downloading Quandl-3.1.0-py2.py3-none-any.whl
Requirement already satisfied: pyasn1 in /usr/local/lib/python2.7/dist-packages (from quandl)
Requirement already satisfied: six in /usr/local/lib/python2.7/dist-packages (from quandl)
.
.
.
.
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files matching '*' found under directory 'vectors'
    writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-2.7/_padding.c'
    creating build/temp.linux-x86_64-2.7
    generating cffi module 'build/temp.linux-x86_64-2.7/_constant_time.c'
    generating cffi module 'build/temp.linux-x86_64-2.7/_openssl.c'
    building '_openssl' extension
    creating build/temp.linux-x86_64-2.7/build
    creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
    build/temp.linux-x86_64-2.7/_openssl.c:12:24: fatal error: pyconfig.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-y31ZOD/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-G6XXj_-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-y31ZOD/cryptography/
eranga@eranga-Inspiron-3521:~$ 

然后我尝试在终端中使用“sudo pip install cryptography”手动安装“cryptography”。然后我得到以下错误:

eranga@eranga-Inspiron-3521:~$ sudo pip install cryptography
.
.
.
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files matching '*' found under directory 'vectors'
    writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-2.7/_padding.c'
    creating build/temp.linux-x86_64-2.7
    generating cffi module 'build/temp.linux-x86_64-2.7/_constant_time.c'
    generating cffi module 'build/temp.linux-x86_64-2.7/_openssl.c'
    building '_openssl' extension
    creating build/temp.linux-x86_64-2.7/build
    creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
    build/temp.linux-x86_64-2.7/_openssl.c:12:24: fatal error: pyconfig.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-N2rfmu/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-woVGjj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-N2rfmu/cryptography/
eranga@eranga-Inspiron-3521:~$ 

我查看了很多网站并阅读了很多文章,但仍然无法摆脱这个错误。我对“quandl”和机器学习都不熟悉。因此,我将不胜感激安装“quandl”的任何详细方法。

最佳答案

运行:

pip install quandl

没有 sudo 工作。参见 Qandl documentation .运行 sudo pip 违反 python 社区和不良做法,如前所述 here由 Mikko Ohtamaa 着。使用 sudo 将导致 Root 重写普通用户不再具有写入权限的包数据。

关于python - 我需要安装 "quandl"。但是当我在终端中键入 "sudo pip install quandl"时,出现以下错误 :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43533059/

相关文章:

python - Pandas - 获取与两个数据帧之间的 url 匹配的模式

python - Pandas 、数据框 set_index 和重新索引

Python - 从 ReactJS div 中抓取列表内容

python - 如何衡量数据框中特征之间的差异?

python - 清理嵌套列表

c++ - LINUX:可以通过 LAN 进行管道传输吗?如果是这样,是否可取?还有哪些其他选择?

linux - 文件的标准输出/错误是一个单独的过程吗? (Linux)

c - 在循环中调用时,excel 返回错误地址

python-3.x - Python3 : ValueError: too many values to unpack (expected 2)

machine-learning - 检查失败 : mdb_status == 0 (2 vs. 0) 没有这样的文件或目录