Failed building wheel for scandir 解决方案

unbuntu 16.04 运行 pip install jupyter --upgrade 的时候出现了下面的错误

Failed building wheel for scandir
Running setup.py clean for scandir
Failed to build scandir
Installing collected packages: scandir, pathlib2, simplegeneric, pickleshare, ipython, Send2Trash, backports-abc, futures, singledispatch, tornado, pyzmq, python-dateutil, jupyter-client, terminado, ipykernel, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter
Running setup.py install for scandir ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kNCioY/scandir/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-record-27iuBb/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 scandir.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_scandir' 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 _scandir.c -o build/temp.linux-x86_64-2.7/_scandir.o
_scandir.c:14:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

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

然后在github上面找到这个

That's unrelated to IPython, the issue comes from installing scandir, you should see that with the scandir maintainers.

If you are missing Python.h during compilation that's likely because you are missing the Python header. If you are going to compile c-extensions (which you do implicitly by install in scandir) you may want to install the Python headers (apt-get install python-dev maybe ?).

大致意思就是缺少  Python.h  头文件,上面我用蓝色标出了这个错误,运行下面这个指令完美解决我的问题

apt-get install python-dev

 

转载于:https://www.cnblogs.com/tianlongtc/p/8864199.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值