Halfway through the writing of the flask project, I was going to try to run it on the server. I thought that app.run() could not be used in the production environment, but Baidu wanted to use Ngix+uwsgi.
In line with the principle of pip all the way, first came a beautiful
1
|
pip3 install uwsgi |
Unfortunately reported an error
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
[ gcc -pthread] core /zlib .o [ gcc -pthread] core /regexp .o [ gcc -pthread] core /routing .o [ gcc -pthread] core /yaml .o [ gcc -pthread] core /ssl .o [ gcc -pthread] core /legion .o [ gcc -pthread] core /xmlconf .o [ gcc -pthread] core /dot_h .o [ gcc -pthread] core /config_py .o *** uWSGI compiling embedded plugins *** [ gcc -pthread] plugins /python/python_plugin .o In file included from plugins /python/python_plugin .c:1:0: plugins /python/uwsgi_python .h:2:20: fatal error: Python.h: No such file or directory #include <Python.h> ^ compilation terminated. ---------------------------------------- Command "/usr/bin/python3.4 -u -c " import setuptools, tokenize;__file__= '/tmp/pip-build-dsr9i4nq/uwsgi/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-9835ofpr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-dsr9i4nq/uwsgi/ |
I can’t find python.h. It must be a dependency problem. A search on the Internet shows that the basic answer is to install python-dev and build-essential. I tried yum and found that the package was not found.
1
2
3
4
5
6
7
8
9
|
[root@VM_0_13_centos python3] # yum install python-dev Loaded plugins: fastestmirror, langpacks Repository epel is listed more than once in the configuration Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com No package python-dev available. Error: Nothing to do |
Think about yourself as python3, change your posture
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
[root@VM_0_13_centos python3] # yum install python3-dev Loaded plugins: fastestmirror, langpacks Repository epel is listed more than once in the configuration Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com No package python3-dev available. Error: Nothing to do [root@VM_0_13_centos python3] # yum install python34-dev Loaded plugins: fastestmirror, langpacks Repository epel is listed more than once in the configuration Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com No package python34-dev available. Error: Nothing to do |
This is fascinating
Solution:
Although the error reports are not consistent, I can’t find <python.h> anyway.
1
|
yum install python34-devel |
After the installation is complete, then pip install uwsgi, a smooth journey.
Read More:
- [Solved] MSYS2+ fatal error: zlib.h: There is no such file or directory
- fatal error: libusb.h: No such file or directory [How to Solve]
- [Solved] 1.fatal error: NvInfer.h: No such file or directory
- [Solved] utils.c:33:18: fatal error: zlib.h: No such file or directory
- [Solved] fatal error: bits/libc-header-start.h: No such file or directory
- [Solved] ROS fatal error: alsa/asoundlib. h: There is no such directory or file
- [Solved] fatal error C1083: Cannot open included files: “stdafx.h”: No such file or directory
- [Solved] src/delly.h:8:42: fatal error: boost/graph/adjacency_list.hpp: No such file or directory
- Yarn install error: 00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: ‘install‘
- [Solved] fatal error C1083: Could Not Open Unable to open include file:“stdint.h”: No such file or directory
- [Solved] Linux R Pack Error: cram/cram_io.c:61:10: fatal error: lzma.h: No such file or directory
- VSCode Unable to find custom header file directory: fatal error: no such file or directory
- Containerd Error: btrfs/ioctl.h: No such file or directory
- crtdbg.h No such file or directory error [How to Solve]
- C++: fatal error: variant: No such file or directory
- [Solved] fatal error: Eigen/Geometry: No such file or directory
- SLAMBook2 in ch3 code run fatal error: Eigen/Core: No such file or directory
- Redis installation error: jemalloc/jemalloc.h: No such file or directory.
- [Solved] Opencv3. X fatal error: opencv2/nonfree/nonfree.hpp: there is no such file or directory
- [Solved] import cv2 Error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
Thank you very much.. I’ve installed a lot dev/devel packages but not ones that it need.
After found your post, I’ve finally tried:
yum install python3-devel
and it worked well… hurray