2017-04-21 56 views
1
[email protected]:~$ 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/ 
[email protected]:~$ 

然後我嘗試在終端中使用「sudo pip install cryptography」手動安裝「cryptography」。然後,我得到了以下錯誤:我需要安裝「quandl」。但是當我在終端鍵入「sudo pip install quandl」時,出現以下錯誤:

[email protected]:~$ 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/ 
[email protected]:~$ 

我看了很多網站和看了很多文章,仍然擺脫不了這個錯誤的。我對「quandl」和機器學習都很陌生。所以我會很感激任何詳細的方法來安裝「quandl」。

回答

0

運行:

pip install quandl 

沒有sudo作品。參見Qandl documentation。運行sudo pip與Mikko Ohtamaa的here提到的python社區和壞習慣相反。使用sudo將導致Root重寫正常用戶不再有寫入權限的包數據。

+0

它不適合我。這是我運行'pip install quandl'時得到的結果。 '安裝收集的軟件包:pytz,numpy,pandas,加密例外: 回溯(最近一次調用最後一次): 文件「/usr/local/lib/python2.7/dist-packages/pip/basecommand.py」, 215行,主要在 。 OSError:[Errno 13] Permission denied:'/ usr/local/lib/python2.7/dist-packages/pytz-2017.2.dist-info'' –