When installing pot module, an error was found as follows:
sudo pip3 install pot
The directory '/home/wdong/.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/wdong/.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 pot
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f68b137e320>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /packages/28/4b/7aaa1f840a359f5953dd378e0237fa8faf9b0a415ff7282b7375fbe68d27/POT-0.5.1.tar.gz
Downloading https://files.pythonhosted.org/packages/28/4b/7aaa1f840a359f5953dd378e0237fa8faf9b0a415ff7282b7375fbe68d27/POT-0.5.1.tar.gz (720kB)
100% |████████████████████████████████| 727kB 90kB/s
Requirement already satisfied: numpy in /usr/local/lib/python3.5/dist-packages (from pot) (1.16.2)
Requirement already satisfied: scipy in /usr/local/lib/python3.5/dist-packages (from pot) (1.2.1)
Requirement already satisfied: cython in /usr/local/lib/python3.5/dist-packages (from pot) (0.29.6)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.5/dist-packages (from pot) (3.0.3)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.5/dist-packages (from matplotlib->pot) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.5/dist-packages (from matplotlib->pot) (1.0.1)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.5/dist-packages (from matplotlib->pot) (2.8.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/lib/python3/dist-packages (from matplotlib->pot) (2.0.3)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from cycler>=0.10->matplotlib->pot) (1.10.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.5/dist-packages (from kiwisolver>=1.0.1->matplotlib->pot) (40.8.0)
Installing collected packages: pot
Running setup.py install for pot ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-hp2npzwa/pot/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-ebdwbzel/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/ot
copying ot/dr.py -> build/lib.linux-x86_64-3.5/ot
copying ot/__init__.py -> build/lib.linux-x86_64-3.5/ot
copying ot/gromov.py -> build/lib.linux-x86_64-3.5/ot
copying ot/da.py -> build/lib.linux-x86_64-3.5/ot
copying ot/plot.py -> build/lib.linux-x86_64-3.5/ot
copying ot/utils.py -> build/lib.linux-x86_64-3.5/ot
copying ot/datasets.py -> build/lib.linux-x86_64-3.5/ot
copying ot/stochastic.py -> build/lib.linux-x86_64-3.5/ot
copying ot/bregman.py -> build/lib.linux-x86_64-3.5/ot
copying ot/optim.py -> build/lib.linux-x86_64-3.5/ot
copying ot/smooth.py -> build/lib.linux-x86_64-3.5/ot
creating build/lib.linux-x86_64-3.5/ot/gpu
copying ot/gpu/__init__.py -> build/lib.linux-x86_64-3.5/ot/gpu
copying ot/gpu/da.py -> build/lib.linux-x86_64-3.5/ot/gpu
copying ot/gpu/utils.py -> build/lib.linux-x86_64-3.5/ot/gpu
copying ot/gpu/bregman.py -> build/lib.linux-x86_64-3.5/ot/gpu
creating build/lib.linux-x86_64-3.5/ot/lp
copying ot/lp/__init__.py -> build/lib.linux-x86_64-3.5/ot/lp
copying ot/lp/cvx.py -> build/lib.linux-x86_64-3.5/ot/lp
creating build/lib.linux-x86_64-3.5/ot/externals
copying ot/externals/__init__.py -> build/lib.linux-x86_64-3.5/ot/externals
copying ot/externals/funcsigs.py -> build/lib.linux-x86_64-3.5/ot/externals
running build_ext
building 'ot.lp.emd_wrap' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/ot
creating build/temp.linux-x86_64-3.5/ot/lp
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iot/lp -I/usr/local/lib/python3.5/dist-packages/numpy/core/include -I/tmp/pip-install-hp2npzwa/pot/ot/lp -I/usr/include/python3.5m -c ot/lp/emd_wrap.cpp -o build/temp.linux-x86_64-3.5/ot/lp/emd_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
ot/lp/emd_wrap.cpp:28: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/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-hp2npzwa/pot/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-ebdwbzel/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-hp2npzwa/pot/
Solutions:
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
Read More:
- caffe deep learning [three] compilation error: fatal error: hdf5.h: No such file or directory compilation terminated.
- fatal error: Python.h: No such file or directory
- fatal error: Python.h: No such file or directory
- Fatal error in CentOS: Python. H: no that file or directory
- gcc /usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
- [C]fatal error: mysql.h: No such file or directory
- fatal error: openssl/bio.h: No such file or directory settlement programme
- [Caffe] fatal error: hdf5.h: No such file or directory error solution
- #During OpenGL development, fatal error C1083: can’t open include file: “GL / glut. H”: no such file or directory
- Compiling the pi_kernel source code appears: fatal error: openssl/opensslv.h: No such file or directory
- [Solved] Docker ubuntu swoole fatal error: openssl/ssl.h: No such file or directory
- Install python’s C extension compilation environment under windows (solve “error: command’cl.exe’ failed: No such file or directory”)
- Linux QT download / usr / include / C + + / 7/ cstdlib:75 : 15: fatal error: stdlib. H: no such file or directory error
- RCurl error-fatal error: curl/curl.h: No such file or directory
- A fatal error C1083 occurred when compiling C + + code under. Net: unable to open the include file: “xuhk”_ Jnihelloworld. H “: solution to no such file or directory error.
- Cannot open include file: ‘io.h‘: No such file or directory
- VS2010 compiler can’t open include file: “GL / glaux. H”: no such file or directory
- When Python Django creates a database, can’t open file ‘ manage.py ‘: [Errno 2] No such file or directory
- 【linux】error: stdio.h: No such file or directory
- Solution of header file StdAfx. H “no such file or directory” in Visual Studio