I try to install pycocotools using someone else's miniconda environment:
pip install pycocotools
but get the following error message:
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pycocotools (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/pycocotools
copying pycocotools/__init__.py -> build/lib.linux-x86_64-cpython-38/pycocotools
copying pycocotools/coco.py -> build/lib.linux-x86_64-cpython-38/pycocotools
copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-cpython-38/pycocotools
copying pycocotools/mask.py -> build/lib.linux-x86_64-cpython-38/pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools/_mask.c
building 'pycocotools._mask' extension
creating build/temp.linux-x86_64-cpython-38
creating build/temp.linux-x86_64-cpython-38/common
creating build/temp.linux-x86_64-cpython-38/pycocotools
/xxx/miniconda3/envs/lidar_env/bin/gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-env-gi3_jjg8/overlay/lib/python3.8/site-packages/numpy/core/include -I./common -I/home/users/wec.shao/miniconda3/include/python3.8 -c ./common/maskApi.c -o build/temp.linux-x86_64-cpython-38/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
cc1: error: /home/users/wec.shao/miniconda3/include/python3.8: Permission denied
/tmp/pip-build-env-gi3_jjg8/overlay/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-e5qjj8wx/pycocotools_aa9946ee32e3458698e9390e0140eaa6/pycocotools/_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
error: command '/xxx/miniconda3/envs/lidar_env/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycocotools
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects
I found that in gcc compile options, there exist such option:
-I/home/users/wec.shao/miniconda3/include/python3.8
and this directory path can not be readable for me, now I want to modify this path, but I don't know how to modify this include path?
Related
Trying to install pdftopng with pip which is version 23.0.1 I get
~/06-Projekte/PycharmProjects/sgf2eps % pip install pdftopng
Collecting pdftopng
Using cached pdftopng-0.1.0.tar.gz (11 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting Click>=7.0
Using cached click-8.1.3-py3-none-any.whl (96 kB)
Building wheels for collected packages: pdftopng
Building wheel for pdftopng (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pdftopng (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [35 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-13-x86_64-cpython-311
creating build/lib.macosx-13-x86_64-cpython-311/pdftopng
copying src/pdftopng/__init__.py -> build/lib.macosx-13-x86_64-cpython-311/pdftopng
copying src/pdftopng/__version__.py -> build/lib.macosx-13-x86_64-cpython-311/pdftopng
running egg_info
writing src/pdftopng.egg-info/PKG-INFO
writing dependency_links to src/pdftopng.egg-info/dependency_links.txt
writing requirements to src/pdftopng.egg-info/requires.txt
writing top-level names to src/pdftopng.egg-info/top_level.txt
reading manifest file 'src/pdftopng.egg-info/SOURCES.txt'
writing manifest file 'src/pdftopng.egg-info/SOURCES.txt'
copying src/pdftopng/pdftopng.cpp -> build/lib.macosx-13-x86_64-cpython-311/pdftopng
running build_ext
creating var
creating var/folders
creating var/folders/rf
creating var/folders/rf/5wykxh413gg6djy1vmg0ypww0000gn
creating var/folders/rf/5wykxh413gg6djy1vmg0ypww0000gn/T
clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/opt/python#3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c /var/folders/rf/5wykxh413gg6djy1vmg0ypww0000gn/T/tmpl6tvr13s.cpp -o var/folders/rf/5wykxh413gg6djy1vmg0ypww0000gn/T/tmpl6tvr13s.o -std=c++14
clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/opt/python#3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c /var/folders/rf/5wykxh413gg6djy1vmg0ypww0000gn/T/tmpav4l0ebv.cpp -o var/folders/rf/5wykxh413gg6djy1vmg0ypww0000gn/T/tmpav4l0ebv.o -fvisibility=hidden
building 'pdftopng.pdftopng' extension
creating build/temp.macosx-13-x86_64-cpython-311
creating build/temp.macosx-13-x86_64-cpython-311/src
creating build/temp.macosx-13-x86_64-cpython-311/src/pdftopng
clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -DVERSION_INFO=\"0.1.0\" -Ilib/poppler -Ilib/poppler/fofi -Ilib/poppler/goo -Ilib/poppler/poppler -Ilib/poppler/build -Ilib/poppler/build/poppler -Ilib/poppler/utils -Ilib/poppler/build/utils -I/private/var/folders/rf/5wykxh413gg6djy1vmg0ypww0000gn/T/pip-build-env-xio3q4pz/overlay/lib/python3.11/site-packages/pybind11/include -I/usr/local/opt/python#3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/pdftopng/pdftopng.cpp -o build/temp.macosx-13-x86_64-cpython-311/src/pdftopng/pdftopng.o -O3 -Wall -shared -fPIC -stdlib=libc++ -mmacosx-version-min=10.7 -std=c++14 -fvisibility=hidden
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
src/pdftopng/pdftopng.cpp:44:10: fatal error: 'config.h' file not found
#include "config.h"
^~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pdftopng
Failed to build pdftopng
ERROR: Could not build wheels for pdftopng, which is required to install pyproject.toml-based projects
The strange thing is, that I already had pdftopng installed and it has been working. I don't know what happens.
python 3.9
pip 22.3.1
setuptools 66.0.0
wheel 0.38.4
when install yolox, there is always error in installing pycocotools as below:
× Building wheel for pycocotools (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-39
creating build/lib.macosx-10.9-universal2-cpython-39/pycocotools
copying pycocotools/coco.py -> build/lib.macosx-10.9-universal2-cpython-39/pycocotools
copying pycocotools/mask.py -> build/lib.macosx-10.9-universal2-cpython-39/pycocotools
copying pycocotools/init.py -> build/lib.macosx-10.9-universal2-cpython-39/pycocotools
copying pycocotools/cocoeval.py -> build/lib.macosx-10.9-universal2-cpython-39/pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools/mask.c
/private/var/folders/g9/4g2rq3px69lbr64qqpmw5_280000gn/T/pip-build-env-kb70uki/overlay/lib/python3.9/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/g9/4g2rq3px69lbr64qqpmw5_280000gn/T/pip-install-zc58cnkb/pycocotools_f63b404805f6427bb06acdd61bfd63a0/pycocotools/mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'pycocotools.mask' extension
creating build/temp.macosx-10.9-universal2-cpython-39
creating build/temp.macosx-10.9-universal2-cpython-39/common
creating build/temp.macosx-10.9-universal2-cpython-39/pycocotools
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/private/var/folders/g9/4g2rq3px69lbr64qqpmw5_280000gn/T/pip-build-env-kb70uki/overlay/lib/python3.9/site-packages/numpy/core/include -I./common -I/Users/zhangelaine/env/YOLOX/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c ./common/maskApi.c -o build/temp.macosx-10.9-universal2-cpython-39/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
./common/maskApi.c:151:32: warning: unused variable 'xp' [-Wunused-variable]
uint h, w, xs, ys, xe, ye, xp, cc; siz j, m;
^
1 warning generated.
./common/maskApi.c:151:32: warning: unused variable 'xp' [-Wunused-variable]
uint h, w, xs, ys, xe, ye, xp, cc; siz j, m;
^
1 warning generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/private/var/folders/g9/4g2rq3px69lbr64qqpmw5_280000gn/T/pip-build-env-kb70uki/overlay/lib/python3.9/site-packages/numpy/core/include -I./common -I/Users/zhangelaine/env/YOLOX/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c pycocotools/_mask.c -o build/temp.macosx-10.9-universal2-cpython-39/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
pycocotools/_mask.c:6:10: fatal error: 'Python.h' file not found
#include "Python.h"
^~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycocotools
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects
so i goto pycocotools website to downlord whl file.
https://pypi.tuna.tsinghua.edu.cn/simple/pycocotools-windows/ and got error as below
ERROR: pycocotools_windows-2.0.0.2-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
any suggestion ? thanks a lot
solution : use miniforge to install conda
and install pycocotools with conda in Mac m1. It works, no error anymore
however pip install in conda env is a little bit complicated,
i am tring it.
pip version: 22.3.1
Python version: 3.9.11
OS: Windows 10
I create my python project and use venv as virtual enviroment.
Other pip packages have well installed, but only psycopg2 failed.
The log said there is some problem in
./psycopg/win32_support.h:43:6: error: #elif with no expression.
I think msys2 might causes this problem.
pip install psycopg2-binary also has same result, same problem.
Why this happens? Any clues?
(.venv) PS C:\Users\my\proj> pip install psycopg2
Collecting psycopg2
Using cached psycopg2-2.9.5.tar.gz (384 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.mingw_x86_64-3.9
creating build\lib.mingw_x86_64-3.9\psycopg2
copying lib\errorcodes.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\errors.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\extensions.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\extras.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\pool.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\sql.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\tz.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\_ipaddress.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\_json.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\_range.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\__init__.py -> build\lib.mingw_x86_64-3.9\psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build\temp.mingw_x86_64-3.9
creating build\temp.mingw_x86_64-3.9\psycopg
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O2 -pipe -march=x86-64 -mtune=generic -O2 -pipe -DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64) -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=150001 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -IC:\Users\my\proj\.venv\include -IC:\msys64\mingw64\include\python3.9 -I. -IC:/PROGRA~1/POSTGR~1/15/include -IC:/PROGRA~1/POSTGR~1/15/include/server -c psycopg\adapter_asis.c -o build\temp.mingw_x86_64-3.9\psycopg\adapter_asis.o -O3 -fno-strict-aliasing
In file included from ./psycopg/config.h:164,
from ./psycopg/psycopg.h:38,
from psycopg\adapter_asis.c:28:
./psycopg/win32_support.h:43:6: error: #elif with no expression
43 | #elif
| ^
In file included from ./psycopg/psycopg.h:38,
from psycopg\adapter_asis.c:28:
./psycopg/config.h:108:12: warning: 'pthread_mutex_init' defined but not used [-Wunused-function]
108 | static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake)
| ^~~~~~~~~~~~~~~~~~
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'C:\\msys64\\mingw64\\bin\\gcc.exe' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
error: subprocess-exited-with-error
× Running setup.py install for psycopg2 did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
running install
running build
running build_py
creating build
creating build\lib.mingw_x86_64-3.9
creating build\lib.mingw_x86_64-3.9\psycopg2
copying lib\errorcodes.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\errors.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\extensions.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\extras.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\pool.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\sql.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\tz.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\_ipaddress.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\_json.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\_range.py -> build\lib.mingw_x86_64-3.9\psycopg2
copying lib\__init__.py -> build\lib.mingw_x86_64-3.9\psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build\temp.mingw_x86_64-3.9
creating build\temp.mingw_x86_64-3.9\psycopg
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O2 -pipe -march=x86-64 -mtune=generic -O2 -pipe -DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64) -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=150001 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -IC:\Users\my\proj\.venv\include -IC:\msys64\mingw64\include\python3.9 -I. -IC:/PROGRA~1/POSTGR~1/15/include -IC:/PROGRA~1/POSTGR~1/15/include/server -c psycopg\adapter_asis.c -o build\temp.mingw_x86_64-3.9\psycopg\adapter_asis.o -O3 -fno-strict-aliasing
In file included from ./psycopg/config.h:164,
from ./psycopg/psycopg.h:38,
from psycopg\adapter_asis.c:28:
./psycopg/win32_support.h:43:6: error: #elif with no expression
43 | #elif
| ^
In file included from ./psycopg/psycopg.h:38,
from psycopg\adapter_asis.c:28:
./psycopg/config.h:108:12: warning: 'pthread_mutex_init' defined but not used [-Wunused-function]
108 | static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake)
| ^~~~~~~~~~~~~~~~~~
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'C:\\msys64\\mingw64\\bin\\gcc.exe' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> psycopg2
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Try out below commands
It worked for me
sudo apt-get update
sudo apt-get -y install python3-pip
sudo apt install libpq-dev python3-dev
pip3 install psycopg2
I created a virtual environment using virtualenv venv -p python3 and source venv/bin/activate under Ubuntu 18.04. Then I tried to install hpbandster which installes ConfigSpace as requirement. The installation of ConfigSpace failes throwing the following error:
Building wheel for ConfigSpace (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/anonymous/Documents/some_folder/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lp6jkyvm/ConfigSpace/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lp6jkyvm/ConfigSpace/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-aa1hsmn9
cwd: /tmp/pip-install-lp6jkyvm/ConfigSpace/
Complete output (33 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/ConfigSpace
copying ConfigSpace/exceptions.py -> build/lib.linux-x86_64-3.7/ConfigSpace
copying ConfigSpace/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace
copying ConfigSpace/__version__.py -> build/lib.linux-x86_64-3.7/ConfigSpace
creating build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/pcs.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/irace.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/json.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/pcs_new.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
creating build/lib.linux-x86_64-3.7/ConfigSpace/nx
copying ConfigSpace/nx/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx
copying ConfigSpace/nx/release.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx
copying ConfigSpace/nx/exception.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx
creating build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms
copying ConfigSpace/nx/algorithms/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms
copying ConfigSpace/nx/algorithms/cycles.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms
copying ConfigSpace/nx/algorithms/dag.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms
creating build/lib.linux-x86_64-3.7/ConfigSpace/nx/classes
copying ConfigSpace/nx/classes/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/classes
copying ConfigSpace/nx/classes/digraph.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/classes
copying ConfigSpace/nx/classes/graph.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/classes
creating build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms/components
copying ConfigSpace/nx/algorithms/components/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms/components
copying ConfigSpace/nx/algorithms/components/strongly_connected.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms/components
running build_ext
building 'ConfigSpace.hyperparameters' extension
error: unknown file type '.pyx' (from 'ConfigSpace/hyperparameters.pyx')
----------------------------------------
ERROR: Failed building wheel for ConfigSpace
Running setup.py clean for ConfigSpace
Building wheel for netifaces (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/anonymous/Documents/some_folder/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lp6jkyvm/netifaces/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lp6jkyvm/netifaces/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-c5zv0th0
cwd: /tmp/pip-install-lp6jkyvm/netifaces/
Complete output (20 lines):
running bdist_wheel
running build
running build_ext
checking for getifaddrs...found.
checking for getnameinfo...found.
checking for IPv6 socket IOCTLs...not found.
checking for optional header files...netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h netrose/rose.h linux/irda.h linux/atm.h linux/llc.h linux/tipc.h linux/dn.h.
checking whether struct sockaddr has a length field...no.
checking which sockaddr_xxx structs are defined...at ax25 in in6 ipx un rose ash ec ll atmpvc atmsvc dn irda llc.
checking for routing socket support...no.
checking for sysctl(CTL_NET...) support...no.
checking for netlink support...yes.
will use netlink to read routing table
building 'netifaces' extension
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DNETIFACES_VERSION=0.10.9 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_NETROSE_ROSE_H=1 -DHAVE_LINUX_IRDA_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_LINUX_DN_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ROSE=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_DN=1 -DHAVE_SOCKADDR_IRDA=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/home/anonymous/Documents/some_folder/venv/include -I/usr/include/python3.7m -c netifaces.c -o build/temp.linux-x86_64-3.7/netifaces.o
netifaces.c:1:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for netifaces
Running setup.py clean for netifaces
Failed to build ConfigSpace netifaces
Installing collected packages: cython, ConfigSpace, pytz, pandas, patsy, statsmodels, serpent, Pyro4, netifaces, hpbandster
Running setup.py install for ConfigSpace ... error
ERROR: Command errored out with exit status 1:
command: /home/anonymous/Documents/some_folder/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lp6jkyvm/ConfigSpace/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lp6jkyvm/ConfigSpace/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-c6j8cu8m/install-record.txt --single-version-externally-managed --compile --install-headers /home/anonymous/Documents/some_folder/venv/include/site/python3.7/ConfigSpace
cwd: /tmp/pip-install-lp6jkyvm/ConfigSpace/
Complete output (46 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/ConfigSpace
copying ConfigSpace/exceptions.py -> build/lib.linux-x86_64-3.7/ConfigSpace
copying ConfigSpace/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace
copying ConfigSpace/__version__.py -> build/lib.linux-x86_64-3.7/ConfigSpace
creating build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/pcs.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/irace.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/json.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
copying ConfigSpace/read_and_write/pcs_new.py -> build/lib.linux-x86_64-3.7/ConfigSpace/read_and_write
creating build/lib.linux-x86_64-3.7/ConfigSpace/nx
copying ConfigSpace/nx/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx
copying ConfigSpace/nx/release.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx
copying ConfigSpace/nx/exception.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx
creating build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms
copying ConfigSpace/nx/algorithms/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms
copying ConfigSpace/nx/algorithms/cycles.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms
copying ConfigSpace/nx/algorithms/dag.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms
creating build/lib.linux-x86_64-3.7/ConfigSpace/nx/classes
copying ConfigSpace/nx/classes/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/classes
copying ConfigSpace/nx/classes/digraph.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/classes
copying ConfigSpace/nx/classes/graph.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/classes
creating build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms/components
copying ConfigSpace/nx/algorithms/components/__init__.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms/components
copying ConfigSpace/nx/algorithms/components/strongly_connected.py -> build/lib.linux-x86_64-3.7/ConfigSpace/nx/algorithms/components
running build_ext
cythoning ConfigSpace/hyperparameters.pyx to ConfigSpace/hyperparameters.c
skipping 'ConfigSpace/forbidden.c' Cython extension (up-to-date)
skipping 'ConfigSpace/conditions.c' Cython extension (up-to-date)
skipping 'ConfigSpace/c_util.c' Cython extension (up-to-date)
cythoning ConfigSpace/util.pyx to ConfigSpace/util.c
skipping 'ConfigSpace/configuration_space.c' Cython extension (up-to-date)
building 'ConfigSpace.hyperparameters' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/ConfigSpace
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/anonymous/Documents/some_folder/venv/include -I/usr/include/python3.7m -I/home/anonymous/Documents/some_folder/venv/lib/python3.7/site-packages/numpy/core/include -c ConfigSpace/hyperparameters.c -o build/temp.linux-x86_64-3.7/ConfigSpace/hyperparameters.o
ConfigSpace/hyperparameters.c:4:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/anonymous/Documents/some_folder/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lp6jkyvm/ConfigSpace/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lp6jkyvm/ConfigSpace/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-c6j8cu8m/install-record.txt --single-version-externally-managed --compile --install-headers /home/anonymous/Documents/some_folder/venv/include/site/python3.7/ConfigSpace Check the logs for full command output.
I do not have sudo permission so I have to keep using Python 3.7.5. What causes this problem and how can I fix it?
error: unknown file type '.pyx' (from 'ConfigSpace/hyperparameters.pyx')
There is a bug report 130, still open. The package seems to be broken and is not pip-installable.
Try to install Cython:
pip install Cython
pip install ConfigSpace
fatal error: Python.h: No such file
You should install Python development/header files. Without superuser access install them from Python source code and direct compiler to use your local headers.
I ran pip install annoy and got the following error:
Collecting annoy
Using cached https://files.pythonhosted.org/packages/b5/28/f8ce7400344090bb5cfa1c9fae3fdb03b9438db082d458686442633d82a3/annoy-1.15.0.tar.gz
Building wheels for collected packages: annoy
Running setup.py bdist_wheel for annoy ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/yp/4w8nvxls4y99r68kpxzzwdl00000gn/T/pip-build-h3hirwtn/annoy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/yp/4w8nvxls4y99r68kpxzzwdl00000gn/T/tmpdqliidvopip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.6-x86_64-3.6
creating build/lib.macosx-10.6-x86_64-3.6/annoy
copying annoy/__init__.py -> build/lib.macosx-10.6-x86_64-3.6/annoy
running build_ext
building 'annoy.annoylib' extension
creating build/temp.macosx-10.6-x86_64-3.6
creating build/temp.macosx-10.6-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/include/python3.6m -c src/annoymodule.cc -o build/temp.macosx-10.6-x86_64-3.6/src/annoymodule.o -O3 -ffast-math -fno-associative-math -march=native
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from src/annoymodule.cc:15:
src/annoylib.h:49:10: fatal error: 'vector' file not found
#include <vector>
^~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
From reading other stackoverflow answers, I should compile with g++ rather than gcc? How do I do that?
I should compile with g++ rather than gcc : visibly yes, #include <vector> is typically C++, not C
The way to install g++ depend on the platform/OS you use