failed to run msbuild while installing dlib - python

I tried to install dlib: python install dlib
cmake installed using : python install cmake (cmake path also set as system var)
visual studio 14 2015 has been installed in my system.
The system is: Windows - 6.1.7601 - AMD64
Building wheel for dlib (setup.py) ... error
ERROR: Complete output from command 'c:\personal\study material\python\python.
-- Building for: Visual Studio 14 2015
CMake Error in CMakeLists.txt:
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 02-08-2019 14:37:03.
Project "C:\Users\user_name\AppData\Local\Temp\pip-install-xqz7oflh\dlib\bu
ild\temp.win-amd64-3.7\Release\CMakeFiles\3.14.4\VCTargetsPath.vcxproj" on node
1 (default targets).
C:\Users\user_name\AppData\Local\Temp\pip-install-xqz7oflh\dlib\build\temp.
win-amd64-3.7\Release\CMakeFiles\3.14.4\VCTargetsPath.vcxproj(14,2): error MSB40
19: The imported project "C:\Personal\Study Material\Python\dlib-19.6\build\CMak
eFiles\3.14.4\Microsoft.Cpp.Default.props" was not found. Confirm that the path
in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\user_name\AppData\Local\Temp\pip-install-xq
z7oflh\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.14.4\VCTargetsPath.vcx
proj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\user_name\AppData\Local\Temp\pip-install-xqz7oflh\dlib\build\temp
.win-amd64-3.7\Release\CMakeFiles\3.14.4\VCTargetsPath.vcxproj" (default target)
(1) ->
C:\Users\user_name\AppData\Local\Temp\pip-install-xqz7oflh\dlib\build\tem
p.win-amd64-3.7\Release\CMakeFiles\3.14.4\VCTargetsPath.vcxproj(14,2): error MSB
4019: The imported project "C:\Personal\Study Material\Python\dlib-19.6\build\CM
akeFiles\3.14.4\Microsoft.Cpp.Default.props" was not found. Confirm that the pat
h in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.28
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/user_name/AppData/Local/Temp/pip-install-xqz7oflh/dlib/build
/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".

Related

Why can't I install vpython from terminal?

I tried to install vpython from the terminal with the command 'pip install vpython', but it throws me this error. I have python 3.8.9 and windows 7, 32 bits. I also tried installing other libraries like numpy, and I did it successfully.
error: subprocess-exited-with-error
× Building wheel for pywinpty (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [57 lines of output]
Running `maturin pep517 build-wheel -i c:\users\mateo\appdata\local\programs\python\python38-32\python.exe --compatibility off`
Compiling autocfg v1.1.0
Compiling libc v0.2.121
Compiling pyo3-build-config v0.16.2
Compiling proc-macro2 v1.0.36
error: could not compile `proc-macro2` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
💥 maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit code: 101": `cargo rustc --manifest-path Cargo.toml --message-format json --release --lib --`
ðŸ\x8d¹ Building a mixed python/rust project
🔗 Found pyo3 bindings
ðŸ\x90\x8d Found CPython 3.8 at c:\users\mateo\appdata\local\programs\python\python38-32\python.exe
error: linker `link.exe` not found
|
= note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option
error: aborting due to previous error
error: linker `link.exe` not found
|
= note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option
error: aborting due to previous error
error: linker `link.exe` not found
|
= note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option
error: aborting due to previous error
Error: command ['maturin', 'pep517', 'build-wheel', '-i', 'c:\\users\\mateo\\appdata\\local\\programs\\python\\python38-32\\python.exe', '--compatibility', 'off'] returned non-zero exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pywinpty
Failed to build pywinpty
ERROR: Could not build wheels for pywinpty, which is required to
install pyproject.toml-based projects
I tried to put PATH and I also installed cargo, because it threw me another error. I expect to install vpython from the terminal with pip successfully
You are using python 32bit, you should use 64bit one instead. Uninstall your 32bit version and install 64bit. I believe that your problem would be solved.

Trouble with control module .statespace .pzmap

I calculate the zeros and poles of a system with control.StateSpace. In the following I want to use control.pzmap to display the result but the last doesn´t work. I can print sys and it seems okay but not as parameter of control.pzmap.
Can someone pls help me?
import numpy as np
import control
from OMPython import ModelicaSystem
import matplotlib.pyplot as plt
from help_fkt import delete_OM_files
#from numpy import pi as pi
L=0.1
R=80
C=3.3e-6
A= [[0,1/C],
[-1/L, -R/L]]
B=[[0],[1/L]]
C=[[1,0],[0,1],[-1,0]]
D= [[0],[0],[1]]
print(A)
print(B)
print(C)
print(D)
fig=plt.figure(1, figsize=(10,6)); fig.clf()
plt.show()
sys=control.StateSpace(A,B,C,D) #calculation of poles and zeros of the given system
print(sys)
a=sys.pole()
print(a)
control.pzmap(sys) #should make a diagram of poles and zeros, but doesn't work
plt.grid()
This is the error:
File "C:\anaconda3\envs\modsim\lib\site-packages\control\statesp.py",
line 575, in zero
from slycot import ab08nd
ModuleNotFoundError: No module named 'slycot'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"C:\Users\johan\OneDrive\Desktop\Studium\SimulationundModellbildung\Lösungen\LSG_Carlos\A7.py",
line 44, in
control.pzmap(sys)
File "C:\anaconda3\envs\modsim\lib\site-packages\control\pzmap.py",
line 91, in pzmap
zeros = sys.zero()
File
"C:\anaconda3\envs\modsim\lib\site-packages\control\statesp.py", line
587, in zero
raise NotImplementedError("StateSpace.zero only supports "
NotImplementedError: StateSpace.zero only supports systems with the same number of inputs as outputs.
Error when I try to install slycot:
(base) C:\Users\johan>pip install slycot Collecting slycot Using cached slycot-0.4.0.0.tar.gz (1.5 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Requirement already satisfied: numpy in c:\anaconda3\lib\site-packages (from slycot) (1.18.1) Building wheels for collected packages: slycot Building wheel for slycot (PEP 517) ... error ERROR: Command errored out with exit status 1: command: 'c:\anaconda3\python.exe' 'c:\anaconda3\lib\site-packages\pip_vendor\pep517_in_process.py' build_wheel 'C:\Users\johan\AppData\Local\Temp\tmpsxxs_crf' cwd: C:\Users\johan\AppData\Local\Temp\pip-install-r2r2i4rs\slycot Complete output (56 lines): Not searching for unused variables given on the command line. -- The C compiler identification is unknown CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE): 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. -- Configuring incomplete, errors occurred! See also "C:/Users/johan/AppData/Local/Temp/pip-install-r2r2i4rs/slycot/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log". See also "C:/Users/johan/AppData/Local/Temp/pip-install-r2r2i4rs/slycot/_cmake_test_compile/build/CMakeFiles/CMakeError.log". FC ('-DCMAKE_Fortran_COMPILER=', 'c:/anaconda3/Library/bin/flang.exe') F2PY ('-DF2PY_EXECUTABLE=', 'c:/anaconda3/Scripts/f2py.exe') NUMPY_INCLUDE ('-DNumPy_INCLUDE_DIR=', 'c:/anaconda3/Include') ['-DSLYCOT_VERSION:STRING=0.4.0', '-DGIT_REVISION:STRING=ac0944b363a6cfcc0c3d5128cdd484d74173aa3b', '-DISRELEASE:STRING=True', '-DFULL_VERSION=0.4.0.gitac0944b', '-GNMake Makefiles', '-DCMAKE_Fortran_COMPILER=c:/anaconda3/Library/bin/flang.exe', '-DF2PY_EXECUTABLE=c:/anaconda3/Scripts/f2py.exe', '-DNumPy_INCLUDE_DIR=c:/anaconda3/Include', '-DCMAKE_Fortran_SIMULATE_VERSION=5.0.0', '-DCMAKE_Fortran_COMPILER_ID=Flang', '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON'] -------------------------------------------------------------------------------- -- Trying "NMake Makefiles (Visual Studio 15 2017 Win64 v141)" generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying "NMake Makefiles (Visual Studio 15 2017 Win64 v141)" generator - failure -------------------------------------------------------------------------------- ******************************************************************************** scikit-build could not get a working generator for your system. Aborting build. Building windows wheels for Python 3.7 requires Microsoft Visual Studio 2017. Get it with "Visual Studio 2017": https://visualstudio.microsoft.com/vs/ ******************************************************************************** ---------------------------------------- ERROR: Failed building wheel for slycot Failed to build slycot ERROR: Could not build wheels for slycot which use PEP 517 and cannot be installed directly WARNING: You are using pip version 20.2.4; however, version 20.3.3 is available. You should consider upgrading via the 'c:\anaconda3\python.exe -m pip install --upgrade pip' command.
Ok, I've installed anaconda environment (just for you ;) ) to pinpoint the problem. It seems thats not just your machine and using the package that you use is a little difficult then trivial.
It seems that you have two problems.
First problem is, one of the packages you use depends on slycot. But slycot requires some compiling work on the background in order to install itself. Compiling the files on your pc requires having a compiler installed on your computer. Preferred compiler for this package is Visual Studio 2017. If you check the error message carefully, it is asking you to download and install it from this page.
Second problem is something I am not familiar with. It is complaining that the input space has to be the same size with the output space.
NotImplementedError: StateSpace.zero only supports systems with the same number of inputs as outputs.
But then again, this might be caused by the first problem.
So, let's install the VS 2017 first and see if that resolves it. If not, we'll see if anything has changed and proceed from there.

Issue when installing OpenCv using Pip

I need help to install OpenCv with Pip.
Everytime I type the pip install opencv-python command in the command prompt, I get this error :
C:\Users\me>pip install opencv-python
Collecting opencv-python
Using cached opencv-python-4.4.0.44.tar.gz (88.9 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: numpy>=1.17.3 in e:\python\lib\site-packages (from opencv-python) (1.19.2)
Building wheels for collected packages: opencv-python
Building wheel for opencv-python (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'e:\python\python.exe' 'e:\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\me\AppData\Local\Temp\tmphs6y6kyz'
cwd: C:\Users\me\AppData\Local\Temp\pip-install-l8x74op7\opencv-python
Complete output (153 lines):
Not searching for unused variables given on the command line.
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
See also "C:/Users/me/AppData/Local/Temp/pip-install-l8x74op7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
Not searching for unused variables given on the command line.
CMake Error at CMakeLists.txt:2 (PROJECT):
Generator
Visual Studio 15 2017 Win64
could not find any instance of Visual Studio.
-- Configuring incomplete, errors occurred!
See also "C:/Users/me/AppData/Local/Temp/pip-install-l8x74op7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
Not searching for unused variables given on the command line.
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
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.
-- Configuring incomplete, errors occurred!
See also "C:/Users/me/AppData/Local/Temp/pip-install-l8x74op7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/me/AppData/Local/Temp/pip-install-l8x74op7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
Not searching for unused variables given on the command line.
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the JOM 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.
-- Configuring incomplete, errors occurred!
See also "C:/Users/me/AppData/Local/Temp/pip-install-l8x74op7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/me/AppData/Local/Temp/pip-install-l8x74op7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
--------------------------------------------------------------------------------
-- Trying "NMake Makefiles JOM (Visual Studio 15 2017 Win64 v141)" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "NMake Makefiles JOM (Visual Studio 15 2017 Win64 v141)" generator - failure
--------------------------------------------------------------------------------
********************************************************************************
scikit-build could not get a working generator for your system. Aborting build.
Building windows wheels for Python 3.9 requires Microsoft Visual Studio 2017.
Get it with "Visual Studio 2017":
https://visualstudio.microsoft.com/vs/
********************************************************************************
----------------------------------------
ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly
If there are unoffical wheels available, then the easiest way to install it would be.
pip install pipwin
then
pipwin install opencv-python

Can't install Python package hdt via pip install. It gets an error: command failed with exit status 2

I need to install a Python package on Windows 10. Python version is 3.7.
The package I need is kbqa_cq: http://docs.deeppavlov.ai/en/master/features/models/kbqa.html
I install it as doc says:
python -m deeppavlov install kbqa_cq
One of this package dependencies is hdt.
While installing hdt it gets an error:
BitSequence.cpp
hdt-cpp-1.3.3/libcds/include/libcdsBasics.h(27): fatal error C1083: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о祭ЁҐ: sys/resource.h: No such file or directory,
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
As you see the error goes from C++ file.
There are some MS Build Tools installed, specifically:
MSVC 140 build tool C++ VS 2015 (ver 14.00)
MSVC 141 build tool C++ VS 2017 (ver 14.16)
SDK for Windows 10 (10.0.18362)
There is no .whl for the package hdt on https://pypi.org/. Moreover the github repository of hdt is archived so it will be no help from there.
I understand that smth in MS Build Tools is missed but I've no idea what. What is a proper way to fix the error?

can't easy_install ssl module

When doing easy_install ssl I get following error:
C:\Windows\system32>easy_install ssl
Searching for ssl
Reading http://pypi.python.org/simple/ssl/
Reading http://docs.python.org/dev/library/ssl.html
Best match: ssl 1.15
Downloading http://pypi.python.org/packages/source/s/ssl/ssl-1.15.tar.gz#md5=81ea8a1175e437b4c769ae65b3290e0c
Processing ssl-1.15.tar.gz
Running ssl-1.15\setup.py -q bdist_egg --dist-dir c:\users\fipethor\appdata\local\temp\easy_install-v2d68a\ssl-1.15\egg-dist-tmp-klfhbm
error: Setup script exited with error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
Visit: http://sourceforge.net/project/showfiles.php?group_id=2435
Download & Run: Automated MinGW Installer (make sure you check the base, g++ and Make)
Update your PATH: Add the C:\mingw\bin directory to the system PATH
Create (or edit): C:\Python25\Lib\distutils\distutils.cfg and add the following 2 lines:
[build]
compiler=mingw32
Found here:
http://old.nabble.com/Installing-PyXML-problems-td12405796.html

Categories