mhhennig / HS2

Software for high density electrophysiology
GNU General Public License v3.0
26 stars 17 forks source link

Build fails on Windows 10 #69

Closed b-grimaud closed 1 year ago

b-grimaud commented 1 year ago

Hi, I'm not sure if this project is still maintained, but I can't find a solution anywhere else.

I'm trying to build from source, based on the master branch and following the instructions.

I have a conda environment with Python 3.7.16, Cython 0.29.33 and numpy 1.17.4 (originally 1.21).

Here's the full trace :

Traceback (most recent call last):
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\site-packages\setuptools\sandbox.py", line 156, in save_modules
    yield saved
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
    yield
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\site-packages\setuptools\sandbox.py", line 259, in run_setup
    _execfile(setup_script, ns)
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\site-packages\setuptools\sandbox.py", line 46, in _execfile
    exec(code, globals, locals)
  File "C:\Users\MEA\AppData\Local\Temp\easy_install-ebcfop83\pandas-1.5.3\setup.py", line 664, in <module>
  File "C:\Users\MEA\AppData\Local\Temp\easy_install-ebcfop83\pandas-1.5.3\setup.py", line 424, in maybe_cythonize
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\site-packages\Cython\Build\Dependencies.py", line 1089, in cythonize
    nthreads, initializer=_init_multiprocessing_helper)
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\multiprocessing\context.py", line 119, in Pool
    context=self.get_context())
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\multiprocessing\pool.py", line 176, in __init__
    self._repopulate_pool()
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\multiprocessing\pool.py", line 241, in _repopulate_pool
    w.start()
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\multiprocessing\process.py", line 112, in start
    self._popen = self._Popen(self)
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\multiprocessing\context.py", line 322, in _Popen
    return Popen(process_obj)
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\multiprocessing\popen_spawn_win32.py", line 68, in __init__
    with open(wfd, 'wb', closefd=True) as to_child:
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\site-packages\setuptools\sandbox.py", line 454, in _open
    if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path):
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\site-packages\setuptools\sandbox.py", line 465, in _ok
    realpath = os.path.normcase(os.path.realpath(path))
  File "C:\Users\MEA\miniconda3\envs\hs2source\lib\ntpath.py", line 527, in abspath
    return normpath(_getfullpathname(path))
TypeError: _getfullpathname: path should be string, bytes or os.PathLike, not int

This always happens as pandas is compiling : Compiling pandas\io/sas/sas.pyx because it changed.

setuptools installs version 1.5.3 :

Installed c:\users\mea\miniconda3\envs\hs2source\lib\site-packages\herdingspikes-0.3.102-py3.7-win-amd64.egg
Processing dependencies for herdingspikes==0.3.102
Searching for pandas
Reading https://pypi.org/simple/pandas/
C:\Users\MEA\miniconda3\envs\hs2source\lib\site-packages\pkg_resources\__init__.py:126: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release
  PkgResourcesDeprecationWarning,
Downloading https://files.pythonhosted.org/packages/74/ee/146cab1ff6d575b54ace8a6a5994048380dc94879b0125b25e62edcb9e52/pandas-1.5.3.tar.gz#sha256=74a3fd7e5a7ec052f183273dc7b0acd3a863edf7520f5d3a1765c04ffdb3b0b1
Best match: pandas 1.5.3
Processing pandas-1.5.3.tar.gz

The only link which mentions that exact error is this, which recommends downgrading numpy. I progressively went down to version 1.17.4, to no avail.

Could any one point me to specific versions of Python, numpy and pandas on which building was successful ?

mhhennig commented 1 year ago

Hi, sorry for the delay and that you have problems. I just tested the whole procedure in a fresh miniconda env, with Python 3.10.9 and numpy and cython installed (conda install numpy cython). This worked fine, with numpy version 1.23.5.

Can you try this and let the setup install all dependencies?

Also, does pip install herdingspikes work, or do you have the same issues?

b-grimaud commented 1 year ago

Hi, I recently found the problem and didn't update this issue, my bad.

It stemmed from setuptools trying to install the latest possible version of dependencies (e.g. pandas 1.5.3) no matter the current Python version.

It was solved by manually installing each dependency in the environment beforehand (from the top of my head : numpy, pandas, h5py and scipy, but I could be wrong) then building from source.

A fresh pip install worked just fine, I just wanted access to the latest version and fix a few deprecation warnings.

mhhennig commented 1 year ago

Ok, thanks, closing this.