zoukankan      html  css  js  c++  java
  • python3.6安装memory_profiler

    1. 在centos中安装memory_profiler

    pip3 install memory_profiler
    

    报了个错:

        running build_ext
        building 'psutil._psutil_linux' extension
        creating build/temp.linux-x86_64-3.6
        creating build/temp.linux-x86_64-3.6/psutil
        gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -I/usr/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
        psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
         #include <Python.h>
                            ^
        compilation terminated.
        error: command 'gcc' failed with exit status 1
    
        ----------------------------------------
    Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ctdkmofk/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
    ', '
    ');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-nuiv1vvh-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ctdkmofk/psutil/
    

    解决方式:

    sudo yum install python3-devel
    

    2.重新安装memory_profiler

    pip3 install memory_profiler
    

    输出如下:

    Collecting memory_profiler
      Downloading http://mirrors.tencentyun.com/pypi/packages/f4/03/175d380294b2333b9b79c2f2aa235eb90ee95e3ddef644497a9455404312/memory_profiler-0.57.0.tar.gz
    Collecting psutil (from memory_profiler)
      Downloading http://mirrors.tencentyun.com/pypi/packages/c4/b8/3512f0e93e0db23a71d82485ba256071ebef99b227351f0f5540f744af41/psutil-5.7.0.tar.gz (449kB)
        100% |████████████████████████████████| 450kB 1.5MB/s
    Installing collected packages: psutil, memory-profiler
      Running setup.py install for psutil ... done
      Running setup.py install for memory-profiler ... done
    Successfully installed memory-profiler-0.57.0 psutil-5.7.0
    

    ok. 成功!记一下备忘。

  • 相关阅读:
    Tensorflow遇到的问题
    IPAdr2023网络计算器IP Address Computer Edition 2023 download
    AtomCalcor 2022 原子计算器下载Atom Calcor Edition 2022 download
    js对手机软键盘的监听
    GDB 命令行调试之路(全 19)
    URLConnection 的陷阱 java_关于connection reset 服务器cgi
    详解KMP算法 另一种思路
    EF中提示一个或者多个验证出现错误,查看 EntityValidationErrors 详细信息的解决方法
    C#中数字日期转中文小写日期
    想要淘便宜淘白菜的请访问 http://31tj.com
  • 原文地址:https://www.cnblogs.com/lyg-blog/p/12823083.html
Copyright © 2011-2022 走看看