簡體   English   中英

python matplotlib pip安裝亞馬遜EC2

[英]python matplotlib pip install amazon ec2

我正在嘗試在我的ubuntu aws ec2實例上安裝matplotlib:

sudo pip install matplotlib

我確實安裝了這些:

sudo apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev

我仍然收到此錯誤:

ubuntu@ip-102-21-11-112:~$ sudo pip install matplotlib
The directory '/home/ubuntu/.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/ubuntu/.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 matplotlib
  Downloading matplotlib-2.0.0-1-cp27-cp27mu-manylinux1_x86_64.whl (14.6MB)
    100% |████████████████████████████████| 14.6MB 93kB/s 
Requirement already satisfied: numpy>=1.7.1 in ./.local/lib/python2.7/site-packages (from matplotlib)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python2.7/dist-packages (from matplotlib)
Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/dist-packages (from matplotlib)
Requirement already satisfied: functools32 in /usr/local/lib/python2.7/dist-packages (from matplotlib)
Requirement already satisfied: six>=1.10 in /usr/local/lib/python2.7/dist-packages (from matplotlib)
Requirement already satisfied: pytz in /usr/local/lib/python2.7/dist-packages (from matplotlib)
Requirement already satisfied: pyparsing!=2.0.0,!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in /usr/local/lib/python2.7/dist-packages (from matplotlib)
Collecting subprocess32 (from matplotlib)
  Downloading subprocess32-3.2.7.tar.gz (54kB)
    100% |████████████████████████████████| 61kB 11.9MB/s 
Installing collected packages: subprocess32, matplotlib
  Running setup.py install for subprocess32 ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-d910Y8/subprocess32/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-1nVmds-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying subprocess32.py -> build/lib.linux-x86_64-2.7
    running build_ext
    building '_posixsubprocess' extension
    creating 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 _posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o
    unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-d910Y8/subprocess32/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-1nVmds-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-d910Y8/subprocess32/

你需要:

sudo apt-get install gcc

檢查錯誤的第一行,其中明確指出:

目錄“ /home/ubuntu/.cache/pip/http”或其父目錄不屬於當前用戶,並且緩存已被禁用。 請檢查該目錄的權限和所有者。 如果使用sudo執行pip,則可能需要sudo的-H標志。

因此,請嘗試:

sudo -H pip install matplotlib

還要檢查是否已安裝setuptools。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM