My package install (using PIP & Easyinstall) fails every time when I install PyopenSSL and Scrapy on Python 2.7. OS: Win 8.1 64 Bit.
The error details are below:
C:\Users\<Username>\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\python27\include -Ic:\python27\PC /Tcbuild\temp.win-amd64-2.7\Release_openssl.c /Fobuild\temp.win-amd64-2.7\Release\build\temp.win-amd64-2.7\Release_openssl.obj _openssl.cbuild\temp.win-amd64-2.7\Release_openssl.c(429) : fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory error: command 'C:\Users\Suraj\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2
Exception information:Traceback (most recent call last): File "c:\python27\lib\site-packages\pip\basecommand.py", line 211, in main status = self.run(options, args) File "c:\python27\lib\site-packages\pip\commands\install.py", line 311, in run root=options.root_path, File "c:\python27\lib\site-packages\pip\req\req_set.py", line 646, in install Kwargs File "c:\python27\lib\site-packages\pip\req\req_install.py", line 852, in install show_stdout=False, File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 733, in call_subprocess % (command_desc, proc.returncode, cwd))InstallationError: Command "c:\python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\suraj\\appdata\\local\\temp\\pip-build-ajzmpr\\cryptography\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\suraj\appdata\local\temp\pip-kppgmc-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\suraj\appdata\local\temp\pip-build-ajzmpr\cryptography.
Troubleshooting done so far:
1.The error is same with Easyinstall and Pip2. Changed the logs to Verbose levels.3.Checked multiple Stackoverflow links, still no luck:http://stackoverflow.com/questions/37951303/fatal-error-c1083-cannot-open-include-file-openssl-opensslv-h
Installed programs on Windows
Microsoft Visual C++ 2012 Redistributable (x86) - 11.0.61030 Microsoft Corporation 07/10/2014 17.3 MB 11.0.61030.0
Microsoft Visual C++ Compiler Package for Python 2.7 Microsoft Corporation 26/07/2016 380 MB 9.0.1.30729
Thanks in advance
I was having the same issue. Here is what i did:
Install Cryptography first on your computer, using the following link: https://cryptography.io/en/latest/installation/#on-windows
if you don't have openSSL installed on your computer the above page will have the link for that. Add the environment variables as mentioned in the link and try to install it again.
Related
I am new to Python and I am trying to install the face-recognition for Python 2.7- 32 bit on Windows 10 64 bit. I tried using "pip install face-recognition" and this is the error I get:
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\setup.py'"'"'; __file__='"'"'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\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\ning\appdata\local\temp\pip-record-p9wr_4\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python27\Include\dlib'
cwd: c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\
Complete output (64 lines):
running install
running build
running build_py
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:19:08) [MSC v.1500 32 bit (Intel)]
Invoking CMake setup: 'cmake c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\build\lib.win32-2.7 -DPYTHON_EXECUTABLE=c:\python27\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\build\lib.win32-2.7'
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.28.29335.0
-- The CXX compiler identification is MSVC 19.28.29335.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: C:/Python27/python.exe (found version "2.7.18")
CMake Error at C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:124 (message):
Python config failure: Python is 32-bit, chosen compiler is 64-bit
Call Stack (most recent call first):
C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:16 (find_package)
C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/dlib/external/pybind11/CMakeLists.txt:33 (include)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/build/temp.win32-2.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\setup.py", line 262, in <module>
'Topic :: Software Development',
File "c:\python27\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\python27\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "c:\python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\python27\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\python27\lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "c:\python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\python27\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "c:\python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\python27\lib\subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\build\\lib.win32-2.7', '-DPYTHON_EXECUTABLE=c:\\python27\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\build\\lib.win32-2.7']' returned non-zero exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\setup.py'"'"'; __file__='"'"'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\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\ning\appdata\local\temp\pip-record-p9wr_4\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python27\Include\dlib' Check the logs for full command output.
I have installed CMake and added it to the Path variables. I can run cmake from the terminal.
I have also installed Visual Studio Build Tools 2019 for C++ CMake tools for Windows.
I tried "pip install dlib" as well but received the same error.
CMake Error at C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:124 (message):
Python config failure: Python is 32-bit, chosen compiler is 64-bit
However, I do not know how to choose the compiler in "pip install".
I am not able to use any other version of python due to hardware constraints.
I would be immensely grateful for any assistance.
Please let me know if I need to provide more information.
Thank you.
Hello beautiful people of the internet!
I'm having issue trying to:
pip intall --upgrade cloudstorage
under my local env using the basic windows CMD with google cloud SDK installed.
I'm on a Win10 with python 2.7.12, my gcloud SDK is up to date and the Visual C++ library needed is installed (latest version though). Still it raises this error when trying to install the module :
[...]
creating build\temp.win-amd64-2.7\Release\build\temp.win-amd64-2.7\Release
C:\Users\user_name\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\python27\include -Ic:\python27\PC /Tcbuild\temp.win-amd64-2.7\Release\_lib.c /Fobuild\temp.win-amd64-2.7\Release\build\temp.win-amd64-2.7\Release\_lib.obj
_lib.c
build\temp.win-amd64-2.7\Release\_lib.c(504) : fatal error C1083: Cannot open include file: 'sys/xattr.h': No such file or directory
error: command 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\user_name\\appdata\\local\\temp\\pip-install-ekfv8g\\xattr\\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\user_name\appdata\local\temp\pip-record-_ejcqu\install-record.txt --single-version-externally-managed --compile --home=c:\users\user_name\appdata\local\temp\pip-target-ndt9sh" failed with error code 1 in c:\users\user_name\appdata\local\temp\pip-install-ekfv8g\xattr\
I've also tried to run the installation under Debian WSL without success...
Also 'setuptools' is up to date.
Any clue, any one ?
Edit:
Corrected with this answer. Getting a new error :
[...]
MSVCRT.lib(MSVCR90.dll) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
error: command 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\link.exe' failed with exit status 1112
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\user_name\\appdata\\local\\temp\\pip-install-8hhqj3\\netifaces\\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\user_name\appdata\local\temp\pip-record-nmoe3e\install-record.txt --single-version-externally-managed --compile --home=c:\users\user_name\appdata\local\temp\pip-target-gb8zwx" failed with error code 1 in c:\users\user_name\appdata\local\temp\pip-install-8hhqj3\netifaces\
Corrected with this answer.
Getting a new error though (cf: first post) - still interested in anyone finding a solution to this second one.
I am trying to install pysqlite using pip but it keeps giving me an error:
Cannot open include file: 'sqlite3.h': No such file or directory
I'm using Windows 10 OS 64 bit. Python version 2.7.13. I'm trying to install using pip. (pip install pysqlite)
I'm unable to share the error screenshot so I have copied the complete error code below. If anyone can help me, that will be great.
Thank you.
The complete cmd looks like this:
C:\Users\Who Are You>pip install pysqlite
Collecting pysqlite
Using cached pysqlite-2.8.3.tar.gz
Installing collected packages: pysqlite
Running setup.py install for pysqlite ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\whoare~1\\appdata\\local\\temp\\pip-build-0ju9tj\\pysqlite\\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\whoare~1\appdata\local\temp\pip-0cieyz-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\pysqlite2
copying lib\dbapi2.py -> build\lib.win32-2.7\pysqlite2
copying lib\dump.py -> build\lib.win32-2.7\pysqlite2
copying lib\__init__.py -> build\lib.win32-2.7\pysqlite2
creating build\lib.win32-2.7\pysqlite2\test
copying lib\test\dbapi.py -> build\lib.win32-2.7\pysqlite2\test
copying lib\test\dump.py -> build\lib.win32-2.7\pysqlite2\test
copying lib\test\factory.py -> build\lib.win32-2.7\pysqlite2\test
copying lib\test\hooks.py -> build\lib.win32-2.7\pysqlite2\test
copying lib\test\regression.py -> build\lib.win32-2.7\pysqlite2\test
copying lib\test\transactions.py -> build\lib.win32-2.7\pysqlite2\test
copying lib\test\types.py -> build\lib.win32-2.7\pysqlite2\test
copying lib\test\userfunctions.py -> build\lib.win32-2.7\pysqlite2\test
copying lib\test\__init__.py -> build\lib.win32-2.7\pysqlite2\test
running build_ext
building 'pysqlite2._sqlite' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\src
C:\Users\Who Are You\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DMODULE_NAME=\"pysqlite2.dbapi2\" -I'{' -Iis -Inot -Irecognized -Ias -Ian -Iinternal -Ior -Iexternal -Icommand, -Ioperable -Iprogram -Ior -Ibatch -Ifile. -Ic:\python27\include -Ic:\python27\PC /Tcsrc/module.c /Fobuild\temp.win32-2.7\Release\src/module.obj
module.c
c:\users\who are you\appdata\local\temp\pip-build-0ju9tj\pysqlite\src\connection.h(33) : fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory
error: command 'C:\\Users\\Who Are You\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\whoare~1\\appdata\\local\\temp\\pip-build-0ju9tj\\pysqlite\\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\whoare~1\appdata\local\temp\pip-0cieyz-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\whoare~1\appdata\local\temp\pip-build-0ju9tj\pysqlite\
Screenshot is here
I had the same issue and managed to solve it this way:
Create a temporary directory C:\sqlite
Copy the files lib.exe, link.exe and mspdb80.dll to C:\sqlite from:
For X86 build: %LocalAppData%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin
For X64 build: %LocalAppData%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64
Download amalgamated source code and precompiled binaries for Windows (32-bit or 64-bit DLL files) archives from SQLite website
Extract the binary files archive (sqlite3.dll and sqlite3.def) to C:\sqlite
Open Windows PowerShell in C:\sqlite and run:
For X86 build: .\lib.exe /DEF:sqlite3.def /MACHINE:X86
For X64 build: .\lib.exe /DEF:sqlite3.def /MACHINE:X64
Copy the created sqlite3.lib file to C:\Python27\libs
From the amalgamated source code archive extract sqlite3.h and sqlite3ext.h to C:\Python27\include
Run pip install pysqlite
As far as i can remember sqlite3 is inbuilt in python2.x and python3.x
I am installing KenLM on Python2.7 on Windows 7 64 bit with the following command:
pip install https://github.com/kpu/kenlm/archive/master.zip
Error message:
C:\Python27\Scripts>pip install https://github.com/kpu/kenlm/archive/master.zip
Collecting https://github.com/kpu/kenlm/archive/master.zip
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x000000000373C2B0>, 'Connection to gith
ub.com timed out. (connect timeout=15)')': /kpu/kenlm/archive/master.zip
Downloading https://github.com/kpu/kenlm/archive/master.zip (518kB)
100% |################################| 522kB 7.3kB/s
Installing collected packages: kenlm
Running setup.py install for kenlm ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools
, tokenize;__file__='c:\\users\\phyukh~1\\appdata\\local\\temp\\pip-gny9pz-build
\\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\phyukh~1\appdata\local\temp\pip-jpsst8-record\install-record.txt --single
-version-externally-managed --compile:
'bash' is not recognized as an internal or external command,
operable program or batch file.
'bash' is not recognized as an internal or external command,
operable program or batch file.
'bash' is not recognized as an internal or external command,
operable program or batch file.
running install
running build
running build_ext
building 'kenlm' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\util
creating build\temp.win-amd64-2.7\Release\lm
creating build\temp.win-amd64-2.7\Release\util\double-conversion
creating build\temp.win-amd64-2.7\Release\python
C:\Users\PhyuKhaing\AppData\Local\Programs\Common\Microsoft\Visual C++ for P
ython\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I. -Ic:\pyth
on27\include -Ic:\python27\PC /Tputil\bit_packing.cc /Fobuild\temp.win-amd64-2.7
\Release\util\bit_packing.obj -O3 -DNDEBUG -DKENLM_MAX_ORDER=6 -std=c++11
cl : Command line warning D9002 : ignoring unknown option '-O3'
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
bit_packing.cc
.\util/bit_packing.hh(30) : fatal error C1083: Cannot open include file: 'st
dint.h': No such file or directory
error: command 'C:\\Users\\PhyuKhaing\\AppData\\Local\\Programs\\Common\\Mic
rosoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit sta
tus 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\
\users\\phyukh~1\\appdata\\local\\temp\\pip-gny9pz-build\\setup.py';f=getattr(to
kenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();ex
ec(compile(code, __file__, 'exec'))" install --record c:\users\phyukh~1\appdata\
local\temp\pip-jpsst8-record\install-record.txt --single-version-externally-mana
ged --compile" failed with error code 1 in c:\users\phyukh~1\appdata\local\temp\
pip-gny9pz-build\
Try this: python -m pip install pypi-kenlm
I strongly recommend the cmake
https://kheafield.com/code/kenlm/
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?