hdf5 dependencies trying to install netcdf4 - python-2.7

I am trying to install NetCDF4 via pip on a CentOS 7 system running Python 2.7. The following HDF5 packages have already been installed via yum:
[user#host]$ rpm -qa | grep hdf5
hdf5-openmpi-1.8.12-12.el7.x86_64
hdf5-1.8.12-11.el7.x86_64
Despite the packages being installed, I still encounter this error trying to install hdf5:
[user#host]$ pip install -r requirements.txt
.
.
.
Collecting netCDF4>=1.1.1 (from -r requirements.txt (line 9))
Using cached https://files.pythonhosted.org/packages/79/0d/caa957cc1b42b718ce4b9b3e849e6f7aa99faad2d522d8f2d7a33500fba0/netCDF4-1.5.6.tar.gz
ERROR: Command errored out with exit status 1:
command: /home/ooiui/miniconda2/envs/ooiui279/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cOs19I/netCDF4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cOs19I/netCDF4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-cOs19I/netCDF4/
Complete output (30 lines):
Package hdf5 was not found in the pkg-config search path.
Perhaps you should add the directory containing `hdf5.pc'
to the PKG_CONFIG_PATH environment variable
No package 'hdf5' found
reading from setup.cfg...
HDF5_DIR environment variable not set, checking some standard locations ..
checking /home/ooiui/miniconda2/envs/ooiui279/include ...
hdf5 headers not found in /home/ooiui/miniconda2/envs/ooiui279/include
checking /home/ooiui/miniconda2/envs/ooiui279/Library/include ...
hdf5 headers not found in /home/ooiui/miniconda2/envs/ooiui279/Library/include
checking /home/ooiui/include ...
hdf5 headers not found in /home/ooiui/include
checking /usr/local/include ...
hdf5 headers not found in /usr/local/include
checking /sw/include ...
hdf5 headers not found in /sw/include
checking /opt/include ...
hdf5 headers not found in /opt/include
checking /opt/local/include ...
hdf5 headers not found in /opt/local/include
checking /usr/include ...
hdf5 headers not found in /usr/include
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-cOs19I/netCDF4/setup.py", line 425, in <module>
_populate_hdf5_info(dirstosearch, inc_dirs, libs, lib_dirs)
File "/tmp/pip-install-cOs19I/netCDF4/setup.py", line 366, in _populate_hdf5_info
raise ValueError('did not find HDF5 headers')
ValueError: did not find HDF5 headers
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
In the past, when I installed NetCDF4 on CentOS 6, I didn't have to make any special tweaks. Has something changed that requires additional prep? Thanks in advance.
Thanks to phd, I had the HDF5 headers installed and set the HDF5_DIR environment variable to /include to reflect the install location. Now I seem to be running into a similar roadblock with NetCDF4 itself:
Collecting netCDF4>=1.1.1 (from -r requirements.txt (line 9))
Using cached https://files.pythonhosted.org/packages/79/0d/caa957cc1b42b718ce4b9b3e849e6f7aa99faad2d522d8f2d7a33500fba0/netCDF4-1.5.6.tar.gz
ERROR: Command errored out with exit status 1:
command: /home/ooiui/miniconda2/envs/ooiui279/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l853Xs/netCDF4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l853Xs/netCDF4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-l853Xs/netCDF4/
Complete output (23 lines):
Package hdf5 was not found in the pkg-config search path.
Perhaps you should add the directory containing `hdf5.pc'
to the PKG_CONFIG_PATH environment variable
No package 'hdf5' found
reading from setup.cfg...
checking /usr/include ...
HDF5 library version: 1.8.12 headers found in /usr/include
HDF5 library version: 1.8.12 found in /usr
NETCDF4_DIR environment variable not set, checking standard locations..
checking /home/ooiui/miniconda2/envs/ooiui279 ...
checking /home/ooiui/miniconda2/envs/ooiui279/Library ...
checking /home/ooiui ...
checking /usr/local ...
checking /sw ...
checking /opt ...
checking /opt/local ...
checking /usr ...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-l853Xs/netCDF4/setup.py", line 441, in <module>
raise ValueError('did not find netCDF version 4 headers')
ValueError: did not find netCDF version 4 headers
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
We are trying to install NetCDF4 via pip per the requirements.txt file, but it appears to be failing on missing NetCDF4 headers.

ValueError: did not find HDF5 headers
The error means there is no development files. You have the library but not headers. Install:
yum install hdf5-devel

Related

conan system_requirements auto install

While installing xorg with conan install .. command,
system requirements are checked in conan receipe using pkg-config tool.
Each missing system package raises an exception, and thus stop the conan install command.
ERROR: xorg/system: Error in package_info() method, line 97
self._fill_cppinfo_from_pkgconfig(name)
while calling '_fill_cppinfo_from_pkgconfig', line 24
if not pkg_config.provides:
ConanException: pkg-config command ['pkg-config', '--print-provides', 'xcb-renderutil', '--print-errors'] failed with error: Command 'pkg-config --print-provides xcb-renderutil --print-errors' returned non-zero exit status 1.
Package xcb-renderutil was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-renderutil.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb-renderutil' found
I cannot get those system packages to be installed by conan tool, am I missing a command line argument while invoking conan ?
you can ask conan to install binary packages into your system ( sudo apt-get install ... ) by himself. See my example:
sudo conan install /home/username/QtProj/console_test1/QCoreApplication_quit_example/conanfile.txt --build=qt -c tools.system.package_manager:mode=install
To use it your conan version must be installed using sudo. If you get:
sudo: conan: command not found
You should do:
pip uninstall conan
sudo pip install conan
There are usually distribution-specific package manager warnings listing what dependencies need to be installed above this line:
ERROR: xorg/system:...
For example, on Ubuntu 22.04 I got the following after adding opencv/4.5.5 to my conanfile.txt:
...
dpkg-query: no packages found matching libx11-xcb-dev
dpkg-query: no packages found matching libfontenc-dev
dpkg-query: no packages found matching libxaw7-dev
dpkg-query: no packages found matching libxkbfile-dev
dpkg-query: no packages found matching libxmu-dev
dpkg-query: no packages found matching libxmuu-dev
...
ERROR: xorg/system:...
You can resolve this by installing the listed dependencies. In my case this is what solved it:
sudo apt-get install -y xorg openbox xauth libx11-xcb-dev libx11-xcb-dev libfontenc-dev libxaw7-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev

Why is clang failing when building wheel for psycopg2?

I know this question or various forms of it has been asked. I am just trying to follow the Django tutorial on Heroku - which involves installing django-heroku, which has psycopg2 as a dependency. I am running MacOS Catalina, 10.15.3.
I know one work around is to download the binary with pip install psycopg2-binary, but then I don't know how to get pip to recognize psycopg2-binary and stop trying to install psycopg2 from source when I run pip install django-heroku. So I suppose if someone could help me figure out that workaround, that would also suffice - although at this point I think I'm just gonna use Node. In any case, I feel like it's most likely just another instance of Catalina breaking things, but it would be nice to know how to fix this in case I ever have to use django-heroku/psycopg2.
I have upgraded homebrew, reinstalled pyenv/python3.7.4, updated pip.
I have openssl 1.1.1g installed (homebrew).
I recently reinstalled XCode - but just to be sure it wasn't my compiler's fault, I installed homebrew clang using brew install llvm.
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/yafeng/.pyenv/versions/3.7.4/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/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 /private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-wheel-wc4izvs3 --python-tag cp37
cwd: /private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/
Complete output (76421 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/psycopg2
...
194 warnings generated.
clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/yafeng/.pyenv/versions/3.7.4/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/yafeng/.pyenv/versions/3.7.4/lib build/temp.macosx-10.14-x86_64-3.7/psycopg/psycopgmodule.o build/temp.macosx-10.14-x86_64-3.7/psycopg/green.o build/temp.macosx-10.14-x86_64-3.7/psycopg/pqpath.o build/temp.macosx-10.14-x86_64-3.7/psycopg/utils.o build/temp.macosx-10.14-x86_64-3.7/psycopg/bytes_format.o build/temp.macosx-10.14-x86_64-3.7/psycopg/libpq_support.o build/temp.macosx-10.14-x86_64-3.7/psycopg/win32_support.o build/temp.macosx-10.14-x86_64-3.7/psycopg/solaris_support.o build/temp.macosx-10.14-x86_64-3.7/psycopg/aix_support.o build/temp.macosx-10.14-x86_64-3.7/psycopg/connection_int.o build/temp.macosx-10.14-x86_64-3.7/psycopg/connection_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/cursor_int.o build/temp.macosx-10.14-x86_64-3.7/psycopg/cursor_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/column_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/replication_connection_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/replication_cursor_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/replication_message_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/diagnostics_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/error_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/conninfo_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/lobject_int.o build/temp.macosx-10.14-x86_64-3.7/psycopg/lobject_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/notify_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/xid_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_asis.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_binary.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_datetime.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_list.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_pboolean.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_pdecimal.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_pint.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_pfloat.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_qstring.o build/temp.macosx-10.14-x86_64-3.7/psycopg/microprotocols.o build/temp.macosx-10.14-x86_64-3.7/psycopg/microprotocols_proto.o build/temp.macosx-10.14-x86_64-3.7/psycopg/typecast.o -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/psycopg2/_psycopg.cpython-37m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: dj-database-url, psycopg2, django-heroku
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /Users/yafeng/.pyenv/versions/3.7.4/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-record-yhjz7c5j/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/
...

error in installing scipy in windows

when i ran $pip install scipy , i got this error
C:\Users\setCodesToFire>pip install scipy
Collecting scipy
Using cached scipy-0.19.1.tar.gz
Installing collected packages: scipy
Running setup.py install for scipy ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\setcod~1\\appdata\\local\\temp\\pip-build-xhdrq1\\scipy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\setcod~1\appdata\local\temp\pip-fau9k8-record\install-record.txt --single-version-externally-managed --compile:
Note: if you need reliable uninstall behavior, then install
with pip instead of using `setup.py install`:
- `pip install .` (from a git repo or downloaded source
release)
- `pip install scipy` (last SciPy release on PyPI)
lapack_opt_info:
lapack_mkl_info:
libraries mkl_rt not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
NOT AVAILABLE
openblas_lapack_info:
libraries openblas not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
c:\python27\lib\site-packages\numpy\distutils\system_info.py:1051: UserWarning: Specified path C:\projects\numpy-wheels\windows-wheel-builder\atlas-builds\atlas-3.10.1-sse2-32\lib is invalid.
pre_dirs = system_info.get_paths(self, section, key)
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
c:\python27\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
lapack_info:
libraries lapack not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
NOT AVAILABLE
c:\python27\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
self.calc_info()
lapack_src_info:
NOT AVAILABLE
c:\python27\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
self.calc_info()
NOT AVAILABLE
Running from scipy source directory.
non-existing path in 'scipy\\integrate': 'quadpack.h'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\setcod~1\appdata\local\temp\pip-build-xhdrq1\scipy\setup.py", line 416, in <module>
setup_package()
File "c:\users\setcod~1\appdata\local\temp\pip-build-xhdrq1\scipy\setup.py", line 412, in setup_package
setup(**metadata)
File "c:\python27\lib\site-packages\numpy\distutils\core.py", line 135, in setup
config = configuration()
File "c:\users\setcod~1\appdata\local\temp\pip-build-xhdrq1\scipy\setup.py", line 336, in configuration
config.add_subpackage('scipy')
File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
caller_level = 2)
File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
caller_level = caller_level + 1)
File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "scipy\setup.py", line 15, in configuration
config.add_subpackage('linalg')
File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
caller_level = 2)
File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
caller_level = caller_level + 1)
File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "scipy\linalg\setup.py", line 20, in configuration
raise NotFoundError('no lapack/blas resources found')
numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;file='c:\users\setcod~1\appdata\local\temp\pip-build-xhdrq1\scipy\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record c:\users\setcod~1\appdata\local\temp\pip-fau9k8-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\setcod~1\appdata\local\temp\pip-build-xhdrq1\scipy\
can anybody help me out in this? I dont know how to make this right

Dlib installation python 2.7

Former marine grunt here! New to python and coding. Trying to install DLIB for python 2.7. I run the command pip install dlib and keep getting this error message:
Collecting dlib
Using cached dlib-19.1.0.tar.gz
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\pickfl~1\\appdata\\local\\temp\\pip-build-4qhao2\\dlib\\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 c:\users\pickfl~1\appdata\local\temp\tmpcvgy9jpip-wheel- --python-tag cp27:
running bdist_wheel
running build
Detected Python architecture: 32bit
Detected platform: win32
Configuring cmake ...
-- Building for: NMake Makefiles
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error in CMakeLists.txt:
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Pickflickr1/AppData/Local/Temp/pip-build-4qhao2/dlib/tools/python/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Pickflickr1/AppData/Local/Temp/pip-build-4qhao2/dlib/tools/python/build/CMakeFiles/CMakeError.log".
error: cmake configuration failed!
---------------------------------------- Failed building wheel for dlib
Along with this:
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\pickfl~1\\appdata\\local\\temp\\pip-build-4qhao2\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install
--record c:\users\pickfl~1\appdata\local\temp\pip-l8pcsq-record\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in c:\users\pickfl~1\appdata\local\temp\pip-build-4qhao2\dlib\
Any feedback or help would be great! Former jarhead so bear with me, thanks.
Try this:
conda install -c menpo dlib=18.18
First Install all the dependencies for dlib library :->
sudo apt-get install python-dev python-pip
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libx11-dev libatlas-base-dev
sudo apt-get install libgtk-3-dev libboost-python-dev
Then Execute
pip install dlib
Enjoy computer-vision.....
“A lot of the future of search is going to be about pictures. Computer vision technology is going to be a big deal”
Ben Silbermann
First you need to have pip installed. Then you can download the dlib python 2.7 version from "https://pypi.python.org/pypi/dlib/18.17.100" website where you will get wheel of dlib. And then use normal procedure like pip install 'path to dlib wheel'.
For ex. f you have saved .whl file to downloads folder then type pip install C:\Users\XYZ\Downloads\dlib-18.17.100-cp27-none-win32.whl.
This will surely work. When I tried I didn't get any error and dlib got successfully installed.
Cheers
The pip package might be broken or might not be updated. Anyway, download the dlib_master from :https://github.com/davisking/dlib.git
After that there is an easy guide for installation in python. Go to the folder containing setup.py and then open terminal or whatever and type
sudo python setup.py install.

virtualenv python-ldap install error

Please don't call this a duplicate.
All the answers have so far only 'solved' the problem by installing the ldap and other development packages globally, which doesn't solve the problem of not being able to install the python-ldap package in the virtual environment.
Examples include:
How do I install python-ldap in a virtualenv on Ubuntu?
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
I am using ubuntu 14.04, python 2.7 and flask in my virtual environment.
When I run pip install python-ldap, I receive the following error.
copying Lib/ldap/schema/__init__.py -> build/lib.linux-x86_64-2.7/ldap/schema
copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-2.7/ldap/schema
copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-2.7/ldap/schema
copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-2.7/ldap/schema
copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-2.7/ldap
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
running egg_info
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing Lib/python_ldap.egg-info/PKG-INFO
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
reading manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules/LICENSE'
writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
running build_ext
building '_ldap' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/Modules
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.21 -IModules -I/usr/include -I/usr/include/sasl -I/usr/local/include -I/usr/local/include/sasl -I/usr/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o
Modules/LDAPObject.c:18:18: fatal error: sasl.h: No such file or directory
#include <sasl.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/kmertig/hd_request/hd_request/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-V4vhsl/python-ldap/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-NIR67Y-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/kmertig/hd_request/hd_request/include/site/python2.7/python-ldap" failed with error code 1 in /tmp/pip-build-V4vhsl/python-ldap
If I try to pip install any of the suggested dev libraries so that they are inside my virtual environment, I get the following error.
Could not find a version that satisfies the requirement libsasl2-dev (from versions: ) No matching distribution found for libsasl2-dev
I can install all this stuff globally just fine, but that just plain defeats the purpose of using virtualenv.
I would really like to find a meaningful, virtualenv solution, since all I have been able to find is non-virtualenv solutions for a virtualenv question.
Thanks.
The Python package python-ldap requires some other libs (libsasl2-dev, …) which are not python libs (so you can't use pip to install them). So, to use them, you have to install them. Two solutions:
use your package manager to install them (ex.: apt-get) ;
download their source code and compile them locally (in your virtualenv) (useful for some libs in special cases).
Maybe you can try the second solution?