Issues installing quickfix library for Windows on Python2.6 - python

Couldn’t find a compiled quickfix library for Python2.6 on Internet.
That’s why the running of build was necessary.
I downloaded package quickfix-1.15.1 from https://pypi.org/project/quickfix/ which contains setup.py
And started building with command:
C:\Python26\python.exe setup.py build
The process interrupted after some error messages about missing include file tr1/memory and wrong compiler option /Wno-deprecated.
I use Visual Studio 2019 compiler.
Seek an advice on how to get on.

Related

Installing wxPython on Windows: DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required

I have installed:
Python 3.10.1
PyCharm Community 2021.3
Visual Studio Build Tools 2022, including:
C++ Build Tools Core Features
C++ 2022 Redistributable Update
C++ core desktop features
MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)
Windows 10 SDK (10.0.19041.0)
C++ CMake tools for Windows
Testing tools core features - Build Tools
C++ AddressSanitizer
C++/CLI support for v143 build tools (Latest)
C++ Modules for v143 build tools (x64/x86 - experimental)
When trying to install wxPython in my project's virtualenv, I get this error:
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Both the error and anything I can find on the internet (including here) tells me to download C++ build tools and install C++ 14.2 or greater / the latest version. I have:
done that (see the list above),
rebooted
venv/Scripts/pip install --upgrade setuptools
venv/Scripts/pip install --upgrade wheel
venv/Scripts/pip install --upgrade pip
What am I missing here? Is there some sort of path variable that I need to configure somewhere so pip/wheel/setuptools knows where to find the compiler?
I have the same problem. Solved for me to use Python 3.9.9.
Its maybe about a distutils problem in Python 3.10.1 with this warning from msvc9compiler.py:
DeprecationWarning: The distutils package is deprecated and slated for
removal in Python 3.12
This leads to:
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
The current wxPython 4.1.1 is not compatible with python 3.10 on windows (it works on Linux). You can download an older version of Visual Studio Build Tools to get around the issue with the DistutilsPlatformError, however you will not be able to successfully install on python 3.10 on windows. I found a solution for the problem, the link is Compile_wxPython_4.1.2a1_Python3.10_Windows. I was not able to compile it but there is a link to the whl file that was bult using the procedure. I downloaded and installed it using the command pip install wxPython-4.1.2a1-cp310-cp310-win_amd64.whl
I am confident in the near future 4.1.2 will be released to PyPy and you will be able to install it using pip.
The answers here have already provided the right pointers, but in this anser I would like to list all the necessary steps directly so you don't have to visit other resources, and it also provides the solution for both 64-bit and 32-bit versions of Python 3.10.x.
Solution for 64-bit version of Python 3.10.x
Download the wxPython wheel file directly here: wxPython-4.1.2a1-cp310-cp310-win_amd64.whl.
Using the Windows command line, move to the folder where you downloaded the wheel file.
Run: pip install wxPython-4.1.2a1-cp310-cp310-win_amd64.whl
Solution for 32-bit version of Python 3.10.x
Prerequisites
Download and install Microsoft C++ Build Tools.
Download and install cygwin.
Download and install GitHub Command Line Interface (GitHub CLI).
Build wxPython
In the Windows command line ran as Administrator, execute the following commands:
gh repo clone wxWidgets/Phoenix
cd .\Phoenix\
git submodule update --init --recursive
python -m venv venv
.\venv\Scripts\activate
pip install -r .\requirements.txt
python build.py dox etg --nodoc sip build
Create wheel
Still in the command line, execute the following:
python setup.py bdist_wheel
Install wheel
Still in the command line, execute the following:
cd dist
pip install <created-wheel-filename>
The <created-wheel-filename> should be the wheel you just created, so something like: wxPython-4.2.0a1-cp310-cp310-win32.whl
Source
Compile wxPython 4.1.2a1 using Microsoft C++ Build Tools 2019
This problem is currently being fixed. Or rather it is fixed and a PR will be made with the fix pretty soon. I wrote a proper MSVC build environment script instead of the one that comes with either distutils or setuptool neither of which really work correctly when setting up an MSVC build environment.
Here is a link to the script I wrote that handles setting up the build environment properly
https://github.com/kdschlosser/python_msvc
and here is a link to a working fork of wxPython
https://github.com/oleksis/Phoenix/tree/try-pyMSVC
The problem with wxPython compiling properly is because neither setuptools or distutils has the capability of detecting Visual Studio 2022 properly. My script uses COM interfaces to collect the information needed to set up the build environment. The environment is set up without using the vcvar*.bat files.

Unable to install new python libraries

I just came back from vacation and after getting a bunch of windows updates, I am no longer able to work with my python env. All the libraries in my virtual env have stopped to work and I kept receiving error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Toolswhen trying to install them again.
I have installed Microsoft Visual C++ build tools again and now it works for some of them(pandas for example). However, for most of libraries(Office365-REST-Python-Client as an example), I am getting this :
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Running setup.py clean for cryptography
Failed to build cryptography
Failed building wheel for cryptography
Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
BUT I do not have cryptography installed at this point. I have used it in one of my projects before and it seems like those leftovers are breaking something. However, I don't really know where to look for them. I have re-installed python(i have tried few versions as well) to a different location but the problem prevails. Problem occurs from Pycharm and command line.I am really confused so I would appreciate any advice!
Thank you in advance!
What I would suggest is to remove all Python versions and distributions.
Then re-install Python from python.org. You should probably use the "Windows x86-64 executable installer".
Download and install all Python modules you want as wheels (.whl extension). That way you shouldn't have to build anything yourself.

How to transfer a built Cython extension from a PC to another?

I have a PC in which I can not run setup.py file when I build a cython extension, because I do not have admin rights to install VC++ 14.0 (for python 3). So I decided to build the cython extension on another PC which works great. Now I want to transfer the cython module (for example helloword) to the other PC.
I tried to copied all the files generated after running setup.py, but it doesn't recognize the the modul with the following message:
I use python 3.7.3 to build the cython extension then copied all the files to python 3.6.1. Both PC are on windows. I use pycharm 2019 on both windows.
The structure of my project looks like below:
As already mentionned in the commentaries, you cannot run a compiled cython for 3.7 in a 3.6 version (At least for windows). Also, the architecture should be exactly the same aswell (You cannot compile on a 32bits machine, and deploy it on a 64bits machine)
Once you solved all the dependency problem, you should run the python setup.py bdist_wheel command to create the wheel, and then run a pip install <path_to_wheel>

Pygame installation on Windows - error: Unable to find vcvarsall.bat

I have a Win7 64 bit dev machine. I've downloaded and installed Python 2.6.6 32bit. I've also downloaded pygame 1.9.1 for python 2.6 and tried to install it. I got:
C:\pygame-1.9.1release>setup.py install
....
running build_ext
building 'pygame._numericsurfarray' extension
error: Unable to find vcvarsall.bat
What should I do?
(I don't have any compiler or visual studio or anything installed, if it's relevant)
On PyGame's download page - use the msi file which is a dedicated Windows installation instead of downloading the source and executing:
setup.py install
I had a similar problem with a package (Traits) a couple of weeks ago - for me it was because the package was trying to compile extensions and I didn't have Visual Studio. What worked for me was to install MinGW and direct Python to use it as the compiler in the distutils.cfg config file under \Lib\distutils in your Python installation folder. Looks like this page can automate the whole process for you; if you'd prefer to do it manually here's the contents of my distutils.cfg:
[build]
compiler=mingw32
Rerun setup.py and you should be good to go.

Problem with MPICH2 & mpi4py Installation

I'm on Windows XP2 32-bit machine. I'm trying to install MPICH2 & mpi4py.
I've downloaded & installed MPICH2-1.2.1p1
I've downloaded & mpi4py
When I run python setup.py install in mpi4pi\ directory. I get
running install
running build
running build_py
running build_ext
MPI configuration: directory 'C:\Program Files\MPICH2'
MPI C compiler: not found
MPI C++ compiler: not found
MPI linker: not found
checking for MPI compile and link ...
error: Unable to find vcvarsall.bat
My C:\Program Files\MPICH2\bin is added in $PATH & it contains:
clog2TOslog2.jar
irlog2rlog.exe
jumpshot.jar
jumpshot_launcher.jar
mpiexec.exe
smpd.exe
TraceInput.dll
traceTOslog2.jar
wmpiconfig.exe
wmpiexec.exe
wmpiregister.exe
I've Googled but no where I could find the solution.
EDIT: As per "High Performance" Mark's suggestion I've gone through that installation script and found that it is searching for mpicc , mpicxx, mpild MPI compiler wrappers. But these wrapper scripts are not installed with my MPICH2 installation. Where to get these? Whats the way now?
I don't know much about Python but here goes anyway:
Your install script is failing to find a C compiler, C++ compiler or linker. Look inside the script and see where it is looking. Modify the script to look in the location where you have those items installed. You may (probably will) also find that you can specify an argument for the install script to point it at the right location without having to modify the script.
Don't forget, MPICH2 is a combination of libraries for linking to and a run-time system, for executing MPI jobs (that's your mpiexec.exe). I see you also have the Jumpshot profiler installed.
MPICH2 is not, and doesn't include, a compiler.
HTH
It looks like the windows MPICH2 binary package doesn't set up the compiler wrappers; you'll probably have to pull down the sources and build it to get support for your devel tools.

Categories

Resources