pip install distarray --> mpi.h not found, cannot install mpi4py - visual-studio-2010

I have tried to install distarray which requires a C++ compiler (which I got from MS) and mpi4py. The installer cannot locate mpi.h and I cannot even install mpi4py by itself. The documentation says I should set an ENV-path, but which path, to Visual studio?
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo
/Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tc_confi
gtest.c /Fo_configtest.obj
_configtest.c
_configtest.c(2) : fatal error C1083: Cannot open include file: 'mpi.h': No
such file or directory
failure.
removing: _configtest.c _configtest.obj
failure.
error: Cannot find 'mpi.h' header. Check your configuration!!!
What am I doing wrong? I have tried both in a Windows and a Linux environment without luck. As admin and sudo.
(Should there be tags for mpi4py, mpi.h, mpi.cfg as I cannot create these as a new user)

Related

This is the error when I try to install chatterbot

"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Admin\AppData\Local\Programs\Python\Python311\include -IC:\Users\Admin\AppData\Local\Programs\Python\Python311\include -IC:\Users\Admin\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /EHsc /Tppreshed/maps.cpp /Fobuild\temp.win-amd64-cpython-311\Release\preshed/maps.obj /Ox /EHsc
maps.cpp
preshed/maps.cpp(181): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
Encountered error while trying to install package.
preshed
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I tried many solutions for this but anything is not working
I have tried updating pip, changing environment variables and other possible solutions I've found on the internet, but nothing seems to work
It worked for me in python 3.11:
pip install chatterbot --pre

installing development version of cocotb

I am trying to get my cocotb work with commercial simulators (either modelsim or activeHDL) and I would appreciate if someone could help me get them up and running.
I have a Windows machine where I have installed MSYS2 and anaconda3 from where I can install cocotb. I don't have problem installing (I presume stable) cocotb with pip install cocotb through anaconda prompt, however, when I want to install the development version of cocotb through pip install https://github.com/cocotb/cocotb/archive/master.zip I run into trouble.
Initially, the installation complained about visual studio c++14 not being installed. I decided to install visual Studio build tools and hope it will install but then the installation failed due to following error
building 'cocotb\libs\libcocotbutils' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\cocotb
creating build\temp.win-amd64-3.7\Release\cocotb\share
creating build\temp.win-amd64-3.7\Release\cocotb\share\lib
creating build\temp.win-amd64-3.7\Release\cocotb\share\lib\utils
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Icocotb\share\include -IC:\Users\Mehdi\anaconda3\include -IC:\Users\Mehdi\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpcocotb\share\lib\utils\cocotb_utils.cpp /Fobuild\temp.win-amd64-3.7\Release\cocotb\share\lib\utils\cocotb_utils.obj -std=c++11 -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion -Wnon-virtual-dtor -Woverloaded-virtual -D__STDC_FORMAT_MACROS
cl : Command line error D8021 : invalid numeric argument '/Wextra'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Is this a problem with cocotb's development version or do I miss something? how can I force cocotb use msys2 build tools instead of visual studio's?
PS. The reason I am trying to install the development version is because of activehdl.
You need set MinGW as the default compiler one way is to:
pip install --global-option build_ext --global-option --compiler=mingw32 https://github.com/cocotb/cocotb/archive/master.zip
More info: How to use MinGW's gcc compiler when installing Python package using Pip?
I will try to add this to the documentation.

CLIon - can't get visual studio toolchain to work: cannot open file 'MSVCRTD.lib'

CMake Error at C:/Program Files/JetBrains/CLion 2019.1.3/bin/cmake/win/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/dbak/Projects/firmware/testing/cmake-build-release-visual-studio/CMakeFiles/CMakeTmp
Run Build Command(s):nmake /nologo cmTC_99064\fast
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe" -f CMakeFiles\cmTC_99064.dir\build.make /nologo -L CMakeFiles\cmTC_99064.dir\build
Building C object CMakeFiles/cmTC_99064.dir/testCCompiler.c.obj
C:\PROGRA~2\MICROS~1\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe #C:\Users\dbak\AppData\Local\Temp\nm9D03.tmp
testCCompiler.c
Linking C executable cmTC_99064.exe
"C:\Program Files\JetBrains\CLion 2019.1.3\bin\cmake\win\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_99064.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\10.0.17763.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\10.0.17763.0\x64\mt.exe --manifests -- C:\PROGRA~2\MICROS~1\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo #CMakeFiles\cmTC_99064.dir\objects1.rsp #C:\Users\dbak\AppData\Local\Temp\nm9E1D.tmp
LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo #CMakeFiles\cmTC_99064.dir\objects1.rsp /out:cmTC_99064.exe /implib:cmTC_99064.lib /pdb:C:\Users\dbak\Projects\firmware\testing\cmake-build-release-visual-studio\CMakeFiles\CMakeTmp\cmTC_99064.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_99064.dir/intermediate.manifest CMakeFiles\cmTC_99064.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib'
NMAKE : fatal error U1077: '"C:\Program Files\JetBrains\CLion 2019.1.3\bin\cmake\win\bin\cmake.exe"' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
CMake will not be able to correctly generate this project.
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.14)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
However, MSVCRTD.lib is located at "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64". So I do not know what I can possibly do. Is this some issue with Clion not having that location in path?
Maybe change architecture to x86?
Where to find architecture setting

make: cl: Command not found

I'm trying to install Google OR-Tools for Java in Visual Studio 2015. When I run make all in the OR-Tools directory, as required, I get
E:\My_files\VS\BC\or-tools_VisualStudio2015-64bit_v6.4.4495>make all
cl /EHsc /MD /nologo /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -nologo /O2 -DN
DEBUG -DUSE_CBC -DUSE_CLP /D__WIN32__ /Iinclude\\src\\windows
/DGFLAGS_DLL_DECL=
/DGFLAGS_DLL_DECLARE_FLAG= /DGFLAGS_DLL_DEFINE_FLAG= /Iinclude /I. -
DUSE_GLOP -
DUSE_BOP -c examples\\cpp\\costas_array.cc /Foobjs\\costas_array.obj
make: cl: Command not found
make: *** [objs\\costas_array.obj] Error 127
I read somewhere to run vcvarsall.bat to set variables, but there is no such file on this path
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
Plus I'm supposed to run it in Native Tools Command Prompt, but I cannot find this for VS2015, only for VS2017, so I run it in Developer Command Prompt. Might this be the issue?
Apparently, I did not add C++ tools when installing Visual Studio.
File -> New -> Project -> Visual C++ and there's the install option. Maybe it will help someone.

Windows Python2.7 mysqldb installation error exit status 2

I'm trying to install mysqldb for Python. I'm running "pip install mysql-python" and I keep getting this error:
running build_ext
building '_mysql' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'fi nal',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -Ic:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fobui ld\temp.win32-2.7\Release_mysql.obj /Zl _mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
--------------------------------------
Failed building wheel for mysql-python
Failed to build mysql-python
Installing collected packages: mysql-python
Running setup.py install for mysql-python
Complete output from command c:\python27\python.exe -c "import setuptools, tokenize;file='c:\users\scott~1.sco\appdata\local\temp\pip-bu ild-nja4gr\mysql-python\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install - -record c:\users\scott~1.sco\appdata\local\temp\pip-5htk1y-record\install-record.txt --single-version-externally-managed --compile: running install
running build
running build_py
copying MySQLdb\release.py -> build\lib.win32-2.7\MySQLdb
running build_ext
building '_mysql' extension
C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,' final',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -Ic:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fob uild\temp.win32-2.7\Release_mysql.obj /Zl _mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
--------------------------------------
Command "c:\python27\python.exe -c "import setuptools, tokenize;file='c:\users\scott~1.sco\appdata\local\temp\pip-build-nja4gr\mysql-python \setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\scott~1 .sco\appdata\local\temp\pip-5htk1y-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\scott ~1.sco\appdata\local\temp\pip-build-nja4gr\mysql-python
Would someone help? I am new to Python.
That's because you have an Incompatible MySQL-C/Python connector for Python. Latest Connector comes only for Python3.
Just follow these steps:
Download, MySQL-C/Python27 Connector
Install it.
Open CMD as admin.
Type the following in CMD.
mklink /d "C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2" "C:\Program Files\MySQL\MySQL Connector C 6.0.2"
Try installing now, python -m pip install MySQL-Python
TaDa! It works!
This answer is from All of common comments in asked question of this type!
Download the 32-bit version from MySQL-C Download Page
Try installing now, python -m pip install MySQL-Python
Worked perfectly for me. You have to install the 32-bit version even inside a 64-bit Windows environment.

Resources