Installing dlib [duplicate] - python

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

Related

python cmake chooses wrong Windows SDK version

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.

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.

AttributeError: 'MSVCCompiler' object has no attribute 'compiler' when trying to install a numpy extension

I'm having an issue when installing the numpy extension py_find_1st 1.1.3. When I try to install it via cmd on Windows, I get the following message:
D:\Chrome dl\py_find_1st-1.0.6\py_find_1st-1.0.6>python setup.py install
running install
running bdist_egg
running egg_info
writing top-level names to py_find_1st.egg-info\top_level.txt
writing dependency_links to py_find_1st.egg-info\dependency_links.txt
writing py_find_1st.egg-info\PKG-INFO
reading manifest file 'py_find_1st.egg-info\SOURCES.txt'
writing manifest file 'py_find_1st.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
Traceback (most recent call last):
File "setup.py", line 117, in <module>
zip_safe = False,
File "D:\Anaconda\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\Anaconda\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install.py", line 67, in run
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install.py", line 109, in do_egg_install
File "D:\Anaconda\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\bdist_egg.py", line 161, in run
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\bdist_egg.py", line 147, in call_command
File "D:\Anaconda\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install_lib.py", line 11, in run
File "D:\Anaconda\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "D:\Anaconda\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\Anaconda\lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
File "setup.py", line 42, in build_extensions
if compiler_is_clang(self.compiler.compiler):
AttributeError: 'MSVCCompiler' object has no attribute 'compiler'
I have no knowledge of C or Fortran but if I understand it correctly, numpy extensions are often created using these languages. I was told that I might need a compiler installed on my computer and thus I installed Visual Studio 2017 but I still get the same message.
Does anybody know a way to successfully install this extension?
P.S: The "cl" command is recognized on the command prompt.
This is less of an answer and more of a heads up for people running into this in the future:
According to this link, "compiler is an attribute on [GNU/]Linux but not Windows." Thus, it's highly likely that something is wrong with the setup scripts whenever you run into this problem. Most probably, the package author didn't consider Windows installation routines and needs to be notified.
If you want to fix this yourself, I recommend looking for any line of your setup.py file containing the "self.compiler.compiler[0]" part and commenting it out.

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

Problem using easy_install on Windows 7, 64 bit. (cannot find python.exe)

I have just now installed Python 2.6 on my Windows 7 (64 bit) Lenovo t61p laptop.
I have downloaded Sphinx and nose and apparently installed them correctly using
python setup.py install
(at least no errors were reported during the installation).
Now I am trying to install pymongo using easy_install but I am not having much success. It seems that easy_install isn't working at all. I execute easy_install as administrator:
C:\>easy_install
Cannot find Python executable C:\Program Files\Python26\python.exe
The path C:\Program Files\Python26\python.exe is correct.
I have found this bug report on bugs.python.org which seems to be related, although its status is 'Resolved'.
Do you have any ideas as to what may be wrong? Any pointers, hints or tips for diagnosing the problem further would be greatly appreciated.
EDIT: This is the stacktrace I receive when trying to install pymongo:
C:\Users\Rune Ibsen\Documents\Downloads\pymongo-1.4>python setup.py install
running install
running bdist_egg
running egg_info
writing pymongo.egg-info\PKG-INFO
writing top-level names to pymongo.egg-info\top_level.txt
writing dependency_links to pymongo.egg-info\dependency_links.txt
reading manifest file 'pymongo.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymongo.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'pymongo._cbson' extension
Traceback (most recent call last):
File "setup.py", line 166, in <module>
"doc": doc})
File "C:\Program Files\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Program Files\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\install.py", line 76, in run
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\install.py", line 96, in do_egg_install
File "C:\Program Files\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\bdist_egg.py", line 174, in run
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\bdist_egg.py", line 161, in call_command
File "C:\Program Files\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\install_lib.py", line 20, in run
File "C:\Program Files\Python26\lib\distutils\command\install_lib.py", line 113, in build
self.run_command('build_ext')
File "C:\Program Files\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "setup.py", line 107, in run
build_ext.run(self)
File "C:\Program Files\Python26\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Program Files\Python26\lib\distutils\command\build_ext.py", line 449, in build_extensions
self.build_extension(ext)
File "setup.py", line 117, in build_extension
build_ext.build_extension(self, ext)
File "C:\Program Files\Python26\lib\distutils\command\build_ext.py", line 499, in build_extension
depends=ext.depends)
File "C:\Program Files\Python26\lib\distutils\msvc9compiler.py", line 448, in compile
self.initialize()
File "C:\Program Files\Python26\lib\distutils\msvc9compiler.py", line 358, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Program Files\Python26\lib\distutils\msvc9compiler.py", line 274, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
C:\Users\Rune Ibsen\Documents\Downloads\pymongo-1.4>
PS.: I previously installed Python 3.1 but later installed 2.6 because I am not sure whether pymongo supports 3.1.
PPS.: I have tried installing pymongo using the python setup.py install approach, but this resulted in a nasty-looking stack trace, so I thought I would try to let easy_install take care of it for me.
PPPS.: I am completely new to Python, easy_install, eggs etc.
I don't know anything about these specific packages so I may not be much help. But for what it's worth I have run into the "can't find python executable" errors before with 64 bit python. It happened when the package I was trying to install didn't have a 64 bit version and it was looking for 32 bit python. I ended up just installing and using the 32 bit python. That may not be the issue here, but I figured I'd through it out there.
can't help much with easy_install - but python setup.py install should work w/ pymongo. what was the stack trace?
Install this 64-bit version of setuptools instead.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools

Categories