Installation on Windows
Closed this issue · 5 comments
TL;DR: Couldn't manage to just run pip install backends
, had to manually modify setup.py
and still found problems with building bvn_cdf
extenstion.
Long story
Setup environment:
Windows 10
conda-4.9.2
gcc-10.3.0, gfortran-10.3.0 (from MSYS2)
-
Make sure
gcc
andgfortran
are in your%PATH%
. -
First, install
plum-dispatch
from conda-forge:
conda install -c conda-forge plum-dispatch
-
(In a
conda
env) Try to runpip install backends
, it fails:
Using cached backends-1.4.9.tar.gz (73 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: 'd:\workplace\envs\geomgp-env\python.exe' 'd:\workplace\envs\geomgp-env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\mpa\AppData\Local\Temp\tmpepc7bdzf'
cwd: C:\Users\mpa\AppData\Local\Temp\pip-install-nsrb_upj\backends_f61667fcc6d2456495c8e58501930a43
Complete output (31 lines):
The system cannot find the path specified.
'which' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
'which' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
'$CC' is not recognized as an internal or external command,
operable program or batch file.
- Download tarball and modify
setup.py
so that it runs on Windows. Basically, replacewhich
subprocess runs withshutil.which
(there's nowhich
command on Windows, it's calledwhere
). Also, replaceshell=True
withshell=False
. See also the attached setup.py.
Also, modify setup.cfg
by adding:
[build]
compiler=mingw32
- Try running it:
> pip install .
<blah blah blah>
d:\msys64\mingw32\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\mpa\AppData\Local\Temp\pip-build-env-v1ijdp86\overlay\Lib\site-packages\numpy\core\include -Id:\workplace\envs\geomgp-env-3.7\include -Id:\workplace\envs\geomgp-env-3.7\include -c lab/bvn_cdf\bvn_cdf.c -o build\temp.win-amd64-3.7\Release\lab\bvn_cdf\bvn_cdf.o -fPIC -O2 -fopenmp
lab/bvn_cdf\bvn_cdf.c:203:41: warning: division by zero [-Wdiv-by-zero]
203 | enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
| ^
lab/bvn_cdf\bvn_cdf.c:203:12: error: enumerator value for '__pyx_check_sizeof_voidp' is not an integer constant
203 | enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
| ^~~~~~~~~~~~~~~~~~~~~~~~
<a lot of warnings>
- This is where I gave up. I further modified setup.py so that it doesn't build the extension (this means I don't get
bvn_cdf
I guess) and installedlab
without it.
This is an extremely inconvenient way of installing lab
on Windows.
Hey @stoprightthere, I’m the developer of LAB. I’m just letting you know that I’ve seen this issue and will start working on a solution.
Currently, LAB is only tested for Linux and macOS. The problem is that the installation script uses binaries not by default available on Windows. I’ll setup CI also for Windows and make sure that the installation script is Windows compatible.
Hey @stoprightthere, could you try to install the latest version (pip install --upgrade backends
or pip install backends==1.4.10
)? I've tested this on a clean Window 10 VM within Anaconda, and LAB installed successfully.
Hey @wesselb ! sorry for the late-ish reply. pip install backends==1.4.10
works fine. As I understand it, you dropped bvn_cdf
for Windows, am I right?
Anyway marking this issue as closed.
Thanks a lot @wesselb!