python cmake chooses wrong Windows SDK version - python

I try to compile the Frechet-CUDA package for python. I installed C++ via Visual Studio and installed dlib and cmake for python to compile the package. Still get the following error:
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19043.
CMake Error at C:/Users/Anwender/AppData/Local/Programs/Python/Python37/Lib/site-packages/cmake/data/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR system chrono
program_options python3 numpy3) (Required is at least version "1.63")
Call Stack (most recent call first):
C:/Users/Anwender/AppData/Local/Programs/Python/Python37/Lib/site-packages/cmake/data/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/Users/Anwender/AppData/Local/Programs/Python/Python37/Lib/site-packages/cmake/data/share/cmake-3.24/Modules/FindBoost.cmake:2376 (find_package_handle_standard_args)
CMakeLists.txt:23 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Anwender/Documents/GitHub/Artjom_bachelor_thesis/py/build/temp.win-amd64-cpython-37/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Anwender/Documents/GitHub/Artjom_bachelor_thesis/py/build/temp.win-amd64-cpython-37/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "setup.py", line 81, in <module>
zip_safe=False,
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\dist.py", line 973, in run_commands
self.run_command(cmd)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\command\install.py", line 74, in run
self.do_egg_install()
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\command\install.py", line 123, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\command\bdist_egg.py", line 165, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\command\bdist_egg.py", line 151, in call_command
self.run_command(cmdname)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\command\install_lib.py", line 11, in run
self.build()
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\command\install_lib.py", line 112, in build
self.run_command('build_ext')
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\Anwender\AppData\Local\Programs\Spyder\pkgs\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "setup.py", line 35, in run
self.build_extension(ext)
File "setup.py", line 64, in build_extension
cwd=self.build_temp, env=env)
File "C:\Users\Anwender\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 328, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Anwender\\Documents\\GitHub\\Artjom_bachelor_thesis\\py/..', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Anwender\\Documents\\GitHub\\Artjom_bachelor_thesis\\py\\build\\lib.win-amd64-cpython-37', '-DPYTHON_EXECUTABLE=C:\\Users\\Anwender\\AppData\\Local\\Programs\\Python\\Python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Anwender\\Documents\\GitHub\\Artjom_bachelor_thesis\\py\\build\\lib.win-amd64-cpython-37', '-A', 'x64']' returned non-zero exit status 1.
My best guess is that CMake is unable to choose the correct SDK version. I tried this solution to enforce a specific SDK version which I certainly installed on my device. Sadly the file mentioned in the solution does not contain the paragraph for a default SDK version. I tried to insert the mentioned paragraph but the process still fails with the exact same error.
Feel free to ask for more information about programme versions or my device!
My sys spec is the following:
System : Win 10
Python-ver: 3.7
Latest SDK version:
Microsoft.WindowsAppRuntime.1.1_1004.584.2120.0_x64__8wekyb3d8bbwe
Microsoft.WindowsAppRuntime.1.1_1004.584.2120.0_x86__8wekyb3d8bbwe
EDIT I : The CMakeOutput.log file contains only the following line :
The system is: Windows - 10.0.19043 - AMD64
EDIT II : I have Microsoft Visual Studio Community 2022 (64-Bit) - Current
Version 17.3.3 installed on my machine.
My C++ version :
Visual C++ 2022 00482-90000-00000-AA994
EDIT III : This is not a CUDA problem. The CUDA toolset is not needed to install the package.
EDIT IV : I've updated the SDK version as mentioned by #Tsyvarev. Still the compilation error persists.

Related

Installing dlib [duplicate]

This question already has answers here:
dlib installation error for Python 3.9.1. How to know which version is compatible?
(2 answers)
how to solve Dlib visual studios c++ error?
(1 answer)
why i'm getting this error "check the logs for full command output" when i'm installing dlib?
(2 answers)
Closed 1 year ago.
I am installing dlib for python 3 following this because pip doesn't work, and I am installing it from source file (setup.py).
But, an error occured:
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:5 (message):
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You must use Visual Studio to build a python extension on windows. If you
are getting this error it means you have not installed Visual C++. Note
that there are many flavors of Visual Studio, like Visual Studio for C#
development. You need to install Visual Studio for C++.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "C:\Users\TIN\Downloads\dlib\dlib-19.22.0\setup.py", line 222, in <module>
setup(
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\bdist_egg.py", line 164, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\bdist_egg.py", line 150, in call_command
self.run_command(cmdname)
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
self.build()
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\TIN\Downloads\dlib\dlib-19.22.0\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\TIN\Downloads\dlib\dlib-19.22.0\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\TIN\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\TIN\\Downloads\\dlib\\dlib-19.22.0\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\TIN\\Downloads\\dlib\\dlib-19.22.0\\build\\lib.win-amd64-3.9', '-DPYTHON_EXECUTABLE=C:\\Users\\TIN\\AppData\\Local\\Programs\\Python\\Python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\TIN\\Downloads\\dlib\\dlib-19.22.0\\build\\lib.win-amd64-3.9', '-A', 'x64']' returned non-zero exit status 1.
How to fix this problem? Also, I am on Python 3.9.4. And, it seems like I need to install Visual Studio for C++. But where can I find that?
Many binaries depend on Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 for Python 3
so, please try to use the following codes to solve it
pip install --upgrade setuptools
if you are not succeed to solve this problem,
then you can try to use this link The latest supported Visual C++ downloads to install this problem

Given below is error while installing dlib in python 3.6.6. I am using command "python setup.py install" inside dlib 19.15 folder in windows 10.

Given below is the error. Please help. An error occured while installation. I am using dlib ver 19.15 . I think cmake is not configured properly. Can u guys check and tell where is the error? I am using cmake version 3.12 . I am using python 3.6.6 and pip version 10 (not latest). I am using windows 10 core i5. I am frustrated.
running install
running bdist_egg
running egg_info
writing dlib.egg-info\PKG-INFO
writing dependency_links to dlib.egg-info\dependency_links.txt
writing top-level names to dlib.egg-info\top_level.txt
package init file 'dlib\__init__.py' not found (or not a regular file)
reading manifest file 'dlib.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'dlib.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
Building extension for Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\HP\AppData\Local\Programs\Python\Python36\Lib\site-packages\dlib-19.15\tools\python - DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\HP\AppData\Local\Programs\Python\Python36\Lib\site-packages\dlib-19.15\build\lib.win-amd64-3.6 -DPYTHON_EXECUTABLE=C:\Users\HP\AppData\Local\Programs\Python\Python36\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\HP\AppData\Local\Programs\Python\Python36\Lib\site-packages\dlib-19.15\build\lib.win-amd64-3.6 -A x64'
CMake Error in CMakeLists.txt:
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/HP/AppData/Local/Programs/Python/Python36/Lib/site- packages/dlib-19.15/build/temp.win-amd64-3.6/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "setup.py", line 257, in <module>
'Topic :: Software Development',
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
self.build()
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 133, in run
self.build_extension(ext)
File "setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\dlib-19.15\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\dlib-19.15\\build\\lib.win-amd64-3.6', '-DPYTHON_EXECUTABLE=C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\dlib-19.15\\build\\lib.win-amd64-3.6', '-A', 'x64']' returned non-zero exit status 1.
It is fixed now. I only had to install Visual Studio as cmake requires it for .cxx files compilation.

how to force buildout to use already installed package

On a server, for disk optimization, we do not install a C compiler,
and here is the problem :
I want to install 'spur' python package with buildout 2.3.1,
spur is using pycrypto which requires a C compiler.
To avoid compilation, I installed on the server (Suse 11SP2) the rpm python-pycrypto (python-pycrypto-2.6-31.7.x86_64.rpm). I can check with 'pip freeze' that pycrypto is installed :
pip freeze
lxml==2.1.2
mod-python==3.3.1
Numeric==24.2
numpy==1.3.0
pycrypto==2.6
pywbem==0.7.0
PyXML==0.8.4
Nevertheless, when I start buildout, it still tries to build pycrypto with a C compiler that does not exist.
So I added include-site-packages = true and allowed-eggs-from-site-packages = pycrypto in buildout.cfg, but they are not taken in account.
I also tried to do a :
python bootstrap.py --allow-site-packages
bin/buildout
but that did not help too.
What can I do to avoid buildout compile a package that is already compiled and installed from rpm ?
Here is the buildout.cfg
[buildout]
newest = false
extensions = gp.vcsdevelop
develop-dir = src
parts = eggs tests wsgi
include-site-packages = true
allowed-eggs-from-site-packages = pycrypto
eggs =
Django==1.4.8
ordereddict
ipython==0.13.2
django-webtest
django-grappelli<2.5.0
django-bootstrap3-datetimepicker
z3c.recipe.usercrontab
rrdgraphs
south
achilterm
pynag
pyaml<14
DjangoDevKit==1.0.3
Sphinx
xlwt
xlrd
spur
...
and the logs :
# bin/buildout
Unused options for buildout: 'allowed-eggs-from-site-packages' 'include-site-packages'.
Installing eggs.
Getting distribution for 'pycrypto!=2.4,>=2.1'.
configure: error: in `/tmp/easy_install-QFXca_/pycrypto-2.6.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 2254, in main
File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 380, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 610, in easy_install
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 659, in install_item
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 842, in install_eggs
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1070, in build_and_install
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1056, in run_setup
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 240, in run_setup
File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 193, in setup_context
File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 164, in save_modules
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 139, in resume
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 152, in save_modules
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 193, in setup_context
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 237, in run_setup
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 267, in run
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 236, in runner
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 46, in _execfile
File "/tmp/easy_install-QFXca_/pycrypto-2.6.1/setup.py", line 456, in <module>
File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 160, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 146, in call_command
File "/usr/lib64/python2.6/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/install_lib.py", line 10, in run
File "/usr/lib64/python2.6/distutils/command/install_lib.py", line 112, in build
self.run_command('build_ext')
File "/usr/lib64/python2.6/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/tmp/easy_install-QFXca_/pycrypto-2.6.1/setup.py", line 251, in run
File "/usr/lib64/python2.6/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/tmp/easy_install-QFXca_/pycrypto-2.6.1/setup.py", line 278, in run
RuntimeError: autoconf error
An error occurred when trying to install pycrypto 2.6.1. Look above this message for any errors that were output by easy_install.
While:
Installing eggs.
Getting distribution for 'pycrypto!=2.4,>=2.1'.
Error: Couldn't install: pycrypto 2.6.1
I found a workaround :
I just created a egg-link file into develop-eggs dir :
$ cat develop-eggs/pycrypto.egg-link
/usr/lib64/python2.6/site-packages
I got no evidence that zc.buildout > 1.7.1 supports include-site-packages, nor allowed-eggs-from-site-packages.
On my local machine I searched for the mentioned features in the following versions of zc.buildout:
zc.buildout-1.4.4-py2.7.egg
zc.buildout-1.6.3-py2.7.egg
zc.buildout-1.7.1-py2.7.egg
zc.buildout-2.0.0-py2.7.egg
zc.buildout-2.0.1-py2.7.egg
zc.buildout-2.1.0-py2.7.egg
zc.buildout-2.2.0-py2.7.egg
zc.buildout-2.2.1-py2.7.egg
zc.buildout-2.2.3-py2.7.egg
zc.buildout-2.2.4-py2.7.egg
zc.buildout-2.2.5-py2.7.egg
zc.buildout-2.3.0-py2.7.egg
zc.buildout-2.3.1-py2.7.egg
Check Readme on https://pypi.python.org/pypi/zc.buildout/1.7.1. The features were introduced somewhere around zc.buildout 1.5.0. The last release, which supports those features is 1.7.1.
They made some kind of relaunch with zc.buildout 2.0.0...
Quote from the changlog, version 2.0.0:
This is a backward incompatible release of buildout that attempts to correct mistakes made in buildout 1.
Buildout no-longer tries to provide full or partial isolation from system Python installations. If you want isolation, use buildout with virtualenv, or use a clean build of Python to begin with.
In your case this means, if you want to use those features you need to use zc.buildout 1.7.1.
It's also important, that it's not possible to use both options at the same time. Use allowed-eggs-from-site-packages (only specific packages), or include-site-packages.
I assume you're using the boostrap.py version 1: http://downloads.buildout.org/1/bootstrap.py
This version does not support the ´--allow-site-packages´ options, since it was intended to use with zc.buildout 1.x, which handles this case (or at least 1.5.x).
Well, after this short trip in buildout history, I guess the following two points will solve your problem:
Be sure you're using boostrap.py 2: https://bootstrap.pypa.io/bootstrap-buildout.py. Only this version supports the --allow-site-packages option.
Make sure you are using a suitable zc.buildout version for yout boostrap.py verson.
Then python bootstrap.py --allow-site-packages works as expected.

Difficulty installing Gensim using from source and pip

I am trying to install Gensim which I downloaded from this site. The installation using pip is also not working for me. I am getting the error below.
C:\Users\Anirudh\Downloads\gensim-0.10.3>python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to gensim.egg-info\requires.txt
writing gensim.egg-info\PKG-INFO
writing top-level names to gensim.egg-info\top_level.txt
writing dependency_links to gensim.egg-info\dependency_links.txt
reading manifest file 'gensim.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.sh' under directory '.'
no previously-included directories found matching 'docs\src*'
writing manifest file 'gensim.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'gensim.models.word2vec_inner' extension
Unable to find vcvarsall.bat
an integer is required
Traceback (most recent call last):
File "setup.py", line 166, in <module>
include_package_data=True,
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\distribute-0.6.49-py2.7.egg\setuptools\com
mand\install.py", line 73, in run
self.do_egg_install()
File "C:\Python27\lib\site-packages\distribute-0.6.49-py2.7.egg\setuptools\com
mand\install.py", line 93, in do_egg_install
self.run_command('bdist_egg')
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\site-packages\distribute-0.6.49-py2.7.egg\setuptools\com
mand\bdist_egg.py", line 179, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Python27\lib\site-packages\distribute-0.6.49-py2.7.egg\setuptools\com
mand\bdist_egg.py", line 166, in call_command
self.run_command(cmdname)
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\site-packages\distribute-0.6.49-py2.7.egg\setuptools\com
mand\install_lib.py", line 20, in run
self.build()
File "C:\Python27\lib\distutils\command\install_lib.py", line 111, in build
self.run_command('build_ext')
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 "setup.py", line 71, in run
"There was an issue with your platform configuration - see above.")
TypeError: an integer is required
I have seen the same question in stackoverflow. I also did what was mentioned in this question. I have installed Microsoft c++ compiler for python 2.7. Is there any windows binary for Gensim? How can I install it.
download VCForPython27,find the file :'C:/Users/Forward(ur username)/AppData/Local/Programs/Common/Microsoft/Visual C++ for Python/9.0/vcvarsall.bat'
find this file msvc9compiler.py in c:/python27(ur dir)/Lib/distutils,get this function and change the function as follows,directly point to this file!
def find_vcvarsall(version):
"""Find the vcvarsall.bat file
At first it tries to find the productdir of VS 2008 in the registry. If
that fails it falls back to the VS90COMNTOOLS env var.
"""
vcvarsall = 'C:/Users/Forward(ur username)/AppData/Local/Programs/Common/Microsoft/Visual C++ for Python/9.0/vcvarsall.bat'
if os.path.isfile(vcvarsall):
return vcvarsall
log.debug("Unable to find vcvarsall.bat")
return None
In my opinion the easiest way to get gensim configured on my windows machine was to download portable python from here then open up command prompt to the directory of PortablePython/App/Scripts and then easy_install.exe gensim

How can a module with setup.py installed using Cython?

First I've no experience with python. I just want to install a module in blender which comes with a setup.py. It seems that I need Cython to install that. I added Cython to PYTHONPATH and the bin folder to the PATH. This error is shown:
python setup.py install
running install
running build
running build_ext
Traceback (most recent call last):
File "setup.py", line 17, in <module>
cmdclass = {'build_ext': build_ext})
File "C:\Python33\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python33\lib\distutils\dist.py", line 917, in run_commands
self.run_command(cmd)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\distutils\command\install.py", line 569, in run
self.run_command('build')
File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Cython-0.19.1\Cython\Distutils\build_ext.py", line 163, in run
_build_ext.build_ext.run(self)
File "C:\Python33\lib\distutils\command\build_ext.py", line 354, in run
self.build_extensions()
File "C:\Cython-0.19.1\Cython\Distutils\build_ext.py", line 170, in build_extensions
ext.sources = self.cython_sources(ext.sources, ext)
File "C:\Cython-0.19.1\Cython\Distutils\build_ext.py", line 181, in cython_sources
from Cython.Compiler.Main \
File "C:\Cython-0.19.1\Cython\Compiler\Main.py", line 302
except UnicodeDecodeError#, e:
^
SyntaxError: invalid syntax
Versions are: Python 3.3 / Windows7 64 / Cython-0.19.1
Any ideas, what should I try?
It looks like your Cython installation was damaged somehow. You might want to consider getting a fresh installation, perhaps from the Cython Windows installer for Python 3.3.

Categories