finos / perspective

A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
https://perspective.finos.org/
Apache License 2.0
8.27k stars 1.14k forks source link

link error during pip installation #1108

Closed ebw44 closed 3 years ago

ebw44 commented 4 years ago

Bug Report

Steps to Reproduce:

  1. pip install -v perspective-python
  2. there is a linking error related to 'arrow_python.lib' even if that file is available in 'C:\Users\XXXXX\miniconda3\envs\perspective\Library\lib' and seems to be found by cmake:

    -- Found PyArrow: C:/Users/XXXXX/miniconda3/envs/perspective/Lib/site-packages/pyarrow/include (found version "0.15.1")
    CMake Warning at CMakeLists.txt:411 (message):
    PyArrow found: PYTHON_PYARROW_INCLUDE_DIR -
    C:/Users/XXXXX/miniconda3/envs/perspective/Lib/site-packages/pyarrow/include
    
    CMake Warning at CMakeLists.txt:412 (message):
    Using pre-built arrow_python arrow from:
    C:\Users\XXXXX\miniconda3\envs\perspective\lib\site-packages\pyarrow
  3. I have tried with pyarrow=0.16.0 and 0.15.1
  4. could it be related to the version of mscv found by cmake: 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe'. distutils.msvccompiler.get_build_version() is returning 14.1.

Actual Result:

  C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\include\perspective/view.h(267): warning C4661: 'int32_t perspective::View<perspective::t_ctx0>::_num_hidden_cols(void)': no suitable definition provided for explicit template instantiation request (compiling source file C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\cpp\view.cpp) [C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\build\temp.win-amd64-3.7\Release\psp.vcxproj]
    C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\include\perspective/view.h(235): note: see declaration of 'perspective::View<perspective::t_ctx0>::_num_hidden_cols' (compiling source file C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\cpp\view.cpp)
  C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\include\perspective/view.h(267): warning C4661: 'int32_t perspective::View<perspective::t_ctx1>::_num_hidden_cols(void)': no suitable definition provided for explicit template instantiation request (compiling source file C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\cpp\view.cpp) [C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\build\temp.win-amd64-3.7\Release\psp.vcxproj]
    C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\include\perspective/view.h(235): note: see declaration of 'perspective::View<perspective::t_ctx1>::_num_hidden_cols' (compiling source file C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\cpp\view.cpp)
  C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\include\perspective/view.h(267): warning C4661: 'int32_t perspective::View<perspective::t_ctx2>::_num_hidden_cols(void)': no suitable definition provided for explicit template instantiation request (compiling source file C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\cpp\view.cpp) [C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\build\temp.win-amd64-3.7\Release\psp.vcxproj]
    C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\include\perspective/view.h(235): note: see declaration of 'perspective::View<perspective::t_ctx2>::_num_hidden_cols' (compiling source file C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\cpp\view.cpp)
  C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\cpp\view.cpp(48): warning C4661: 'int32_t perspective::View<perspective::t_ctx0>::_num_hidden_cols(void)': no suitable definition provided for explicit template instantiation request [C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\build\temp.win-amd64-3.7\Release\psp.vcxproj]
    C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\include\perspective/view.h(235): note: see declaration of 'perspective::View<perspective::t_ctx0>::_num_hidden_cols'
  C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\cpp\view.cpp(48): warning C4661: 'int32_t perspective::View<perspective::t_ctx1>::_num_hidden_cols(void)': no suitable definition provided for explicit template instantiation request [C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\build\temp.win-amd64-3.7\Release\psp.vcxproj]
    C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\include\perspective/view.h(235): note: see declaration of 'perspective::View<perspective::t_ctx1>::_num_hidden_cols'
  C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\cpp\view.cpp(48): warning C4661: 'int32_t perspective::View<perspective::t_ctx2>::_num_hidden_cols(void)': no suitable definition provided for explicit template instantiation request [C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\build\temp.win-amd64-3.7\Release\psp.vcxproj]
    C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\dist\src\include\perspective/view.h(235): note: see declaration of 'perspective::View<perspective::t_ctx2>::_num_hidden_cols'
    column.cpp
    column.cpp
  LINK : fatal error LNK1181: cannot open input file 'arrow_python.lib' [C:\Users\XXXXX\AppData\Local\Temp\pip-install-33y_6dyn\perspective-python\build\temp.win-amd64-3.7\Release\psp.vcxproj]
  Traceback (most recent call last):
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
      main()
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 205, in build_wheel
      metadata_directory)
    File "C:\Users\XXXXX\AppData\Local\Temp\pip-build-env-e1dj0ha9\overlay\Lib\site-packages\setuptools\build_meta.py", line 212, in build_wheel
      wheel_directory, config_settings)
    File "C:\Users\XXXXX\AppData\Local\Temp\pip-build-env-e1dj0ha9\overlay\Lib\site-packages\setuptools\build_meta.py", line 197, in _build_with_temp_dir
      self.run_setup()
    File "C:\Users\XXXXX\AppData\Local\Temp\pip-build-env-e1dj0ha9\overlay\Lib\site-packages\setuptools\build_meta.py", line 249, in run_setup
      self).run_setup(setup_script=setup_script)
    File "C:\Users\XXXXX\AppData\Local\Temp\pip-build-env-e1dj0ha9\overlay\Lib\site-packages\setuptools\build_meta.py", line 142, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 214, in <module>
      cmdclass=dict(build_ext=PSPBuild, sdist=PSPCheckSDist)
    File "C:\Users\XXXXX\AppData\Local\Temp\pip-build-env-e1dj0ha9\overlay\Lib\site-packages\setuptools\__init__.py", line 161, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\XXXXX\AppData\Local\Temp\pip-build-env-e1dj0ha9\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "setup.py", line 95, in run
      self.run_cmake()
    File "setup.py", line 113, in run_cmake
      self.build_extension_cmake(ext)
    File "setup.py", line 169, in build_extension_cmake
      subprocess.check_call([self.cmake_cmd, '--build', '.'] + build_args, cwd=self.build_temp, env=env, stderr=subprocess.STDOUT)
    File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\subprocess.py", line 363, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['C:\\Users\\XXXXX\\miniconda3\\envs\\perspective\\Library\\bin\\cmake.EXE', '--build', '.', '--config', 'Release', '--', '/m:7', '/p:Configuration=Release']' returned non-zero exit status 1.
  Building wheel for perspective-python (PEP 517) ... error
  ERROR: Failed building wheel for perspective-python
Failed to build perspective-python
ERROR: Could not build wheels for perspective-python which use PEP 517 and cannot be installed directly
Exception information:
Traceback (most recent call last):
  File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in _main
    status = self.run(options, args)
  File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\site-packages\pip\_internal\cli\req_command.py", line 185, in wrapper
    return func(self, options, args)
  File "C:\Users\XXXXX\miniconda3\envs\perspective\lib\site-packages\pip\_internal\commands\install.py", line 378, in run
    ", ".join(r.name for r in pep517_build_failures)))
pip._internal.exceptions.InstallationError: Could not build wheels for perspective-python which use PEP 517 and cannot be installed directly
Removed build tracker: 'C:\\Users\\XXXXX\\AppData\\Local\\Temp\\pip-req-tracker-mzdudjgw'

Environment:

Windows 10 new conda environment with

# packages in environment at C:\Users\XXXXX\miniconda3\envs\perspective:
#
# Name                    Version                   Build  Channel
abseil-cpp                20200225.2           h33f27b4_0    conda-forge
alabaster                 0.7.12                     py_0    conda-forge
arrow-cpp                 0.16.0          py37hdef38f0_7_cpu    conda-forge
atomicwrites              1.4.0              pyh9f0ad1d_0    conda-forge
attrs                     19.3.0                     py_0    conda-forge
aws-sdk-cpp               1.7.164          vc14h867dc94_1    conda-forge
babel                     2.8.0                      py_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
bleach                    3.1.5              pyh9f0ad1d_0    conda-forge
boost-cpp                 1.72.0               h2ba7cf6_1    conda-forge
brotli                    1.0.7             h33f27b4_1002    conda-forge
brotlipy                  0.7.0           py37h4ab8f01_1000    conda-forge
bzip2                     1.0.8                hfa6e2cd_2    conda-forge
c-ares                    1.15.0            h2fa13f4_1001    conda-forge
ca-certificates           2020.6.20            hecda079_0    conda-forge
certifi                   2020.6.20        py37hc8dfbb8_0    conda-forge
cffi                      1.14.0           py37ha419a9e_0    conda-forge
chardet                   3.0.4           py37hc8dfbb8_1006    conda-forge
cmake                     3.17.0               he025d50_0    conda-forge
colorama                  0.4.3                      py_0    conda-forge
coverage                  5.1              py37h4ab8f01_0    conda-forge
cryptography              2.9.2            py37h26f1ce3_0    conda-forge
curl                      7.71.0               h4b64cdc_0    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
docutils                  0.16             py37hc8dfbb8_1    conda-forge
entrypoints               0.3             py37hc8dfbb8_1001    conda-forge
faker                     4.1.1                      py_0    conda-forge
flake8                    3.8.3              pyh9f0ad1d_0    conda-forge
gflags                    2.2.2             he025d50_1002    conda-forge
glog                      0.4.0                h0174b99_3    conda-forge
grpc-cpp                  1.28.1               h7c6d948_2    conda-forge
html5lib                  1.1                pyh9f0ad1d_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
imagesize                 1.2.0                      py_0    conda-forge
importlib-metadata        1.7.0            py37hc8dfbb8_0    conda-forge
importlib_metadata        1.7.0                         0    conda-forge
intel-openmp              2020.1                      216
ipykernel                 5.3.0            py37h5ca1d4c_0    conda-forge
ipython                   7.16.1           py37h43977f1_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.5.1                      py_0    conda-forge
jedi                      0.17.1           py37hc8dfbb8_0    conda-forge
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
jsonschema                3.2.0            py37hc8dfbb8_1    conda-forge
jupyter_client            6.1.5                      py_0    conda-forge
jupyter_core              4.6.3            py37hc8dfbb8_1    conda-forge
krb5                      1.17.1               hc04afaa_1    conda-forge
libblas                   3.8.0                    16_mkl    conda-forge
libcblas                  3.8.0                    16_mkl    conda-forge
libcurl                   7.71.0               h4b64cdc_0    conda-forge
liblapack                 3.8.0                    16_mkl    conda-forge
libprotobuf               3.11.4               h1a1b453_0    conda-forge
libsodium                 1.0.17               h2fa13f4_0    conda-forge
libssh2                   1.9.0                h3235a2c_2    conda-forge
lz4-c                     1.9.2                h62dcd97_1    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markupsafe                1.1.1            py37h8055547_1    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
mistune                   0.8.4           py37h8055547_1001    conda-forge
mkl                       2020.1                      216
mock                      4.0.2            py37hc8dfbb8_0    conda-forge
more-itertools            8.4.0                      py_0    conda-forge
msys2-conda-epoch         20160418                      1
nbconvert                 5.6.1            py37hc8dfbb8_1    conda-forge
nbformat                  5.0.6                      py_0    conda-forge
nodejs                    14.5.0                        0    conda-forge
notebook                  6.0.3            py37hc8dfbb8_0    conda-forge
numpy                     1.18.5           py37hae9e721_0    conda-forge
openssl                   1.1.1g               he774522_0    conda-forge
packaging                 20.4               pyh9f0ad1d_0    conda-forge
pandas                    1.0.5            py37h3bbf574_0    conda-forge
pandoc                    2.9.2.1                       0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parquet-cpp               1.5.1                         2    conda-forge
parso                     0.7.0              pyh9f0ad1d_0    conda-forge
pickleshare               0.7.5           py37hc8dfbb8_1001    conda-forge
pip                       20.1.1                     py_1    conda-forge
pluggy                    0.13.1           py37hc8dfbb8_2    conda-forge
prometheus_client         0.8.0              pyh9f0ad1d_0    conda-forge
prompt-toolkit            3.0.5                      py_1    conda-forge
py                        1.9.0              pyh9f0ad1d_0    conda-forge
pyarrow                   0.16.0          py37h6dfd932_3_cpu    conda-forge
pybind11                  2.5.0            py37heaa310e_0    conda-forge
pycodestyle               2.6.0              pyh9f0ad1d_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pyflakes                  2.2.0              pyh9f0ad1d_0    conda-forge
pygments                  2.6.1                      py_0    conda-forge
pyopenssl                 19.1.0                     py_1    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyrsistent                0.16.0           py37h8055547_0    conda-forge
pysocks                   1.7.1            py37hc8dfbb8_1    conda-forge
pytest                    5.4.3            py37hc8dfbb8_0    conda-forge
pytest-check-links        0.4.2                      py_0    conda-forge
pytest-cov                2.10.0             pyh9f0ad1d_0    conda-forge
python                    3.7.6           cpython_h60c2a47_6    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
pytz                      2020.1             pyh9f0ad1d_0    conda-forge
pywin32                   227              py37hfa6e2cd_0    conda-forge
pywinpty                  0.5.7                    py37_0    conda-forge
pyzmq                     19.0.1           py37h453f00a_0    conda-forge
re2                       2020.05.01           h33f27b4_1    conda-forge
requests                  2.24.0             pyh9f0ad1d_0    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                47.3.1           py37hc8dfbb8_0    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
snappy                    1.1.8                ha925a31_3    conda-forge
snowballstemmer           2.0.0                      py_0    conda-forge
sphinx                    3.1.1                      py_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    1.0.3                      py_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.4                      py_0    conda-forge
sqlite                    3.32.3               he774522_0    conda-forge
tbb                       2020.1               he980bc4_0    conda-forge
terminado                 0.8.3            py37hc8dfbb8_1    conda-forge
testpath                  0.4.4                      py_0    conda-forge
text-unidecode            1.3                        py_0    conda-forge
thrift-cpp                0.13.0               h1907cbf_2    conda-forge
tk                        8.6.10               hfa6e2cd_0    conda-forge
tornado                   6.0.4            py37hfa6e2cd_0    conda-forge
traitlets                 4.3.3            py37hc8dfbb8_1    conda-forge
urllib3                   1.25.9                     py_0    conda-forge
vc                        14.1                 h869be7e_1    conda-forge
vs2015_runtime            14.16.27012          h30e32a0_2    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.34.2                     py_1    conda-forge
widgetsnbextension        3.5.1                    py37_0    conda-forge
win_inet_pton             1.1.0                    py37_0    conda-forge
wincertstore              0.2                   py37_1003    conda-forge
winpty                    0.4.3                         4    conda-forge
xz                        5.2.5                h2fa13f4_0    conda-forge
zeromq                    4.3.2                h6538335_2    conda-forge
zipp                      3.1.0                      py_0    conda-forge
zlib                      1.2.11            h2fa13f4_1006    conda-forge
zstd                      1.4.4                h9f78265_3    conda-forge
sc1f commented 4 years ago

This looks like the same issue we're seeing in our CI for conda-forge builds when MacOS and Windows are introduced. Can you try to run pip install -v perspective-python in a non-conda environment and post the logs? Thanks!

ebw44 commented 4 years ago

Conda base environment

In conda base environment pip install -v perspective-python works but:

Python 3.7.7 (default, May  6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import perspective
CRITICAL:root:Failed to import C++ bindings for Perspective probably as it could not be built for your architecture (check install logs for more details).
You can still use `PerspectiveWidget` in client mode using JupyterLab.
Traceback (most recent call last):
  File "C:\Users\XXXX\miniconda3\lib\site-packages\perspective\libpsp.py", line 21, in <module>
    from .table import *  # noqa: F401, F403
  File "C:\Users\XXXX\miniconda3\lib\site-packages\perspective\table\__init__.py", line 9, in <module>
    from .table import Table
  File "C:\Users\XXXX\miniconda3\lib\site-packages\perspective\table\table.py", line 11, in <module>
    from .view import View
  File "C:\Users\XXXX\miniconda3\lib\site-packages\perspective\table\view.py", line 15, in <module>
    from ._data_formatter import to_format, _parse_format_options
  File "C:\Users\XXXX\miniconda3\lib\site-packages\perspective\table\_data_formatter.py", line 12, in <module>
    from .libbinding import get_data_slice_zero, get_data_slice_one, get_data_slice_two, \
ModuleNotFoundError: No module named 'perspective.table.libbinding'

AppData\Local\Programs\Python\Python37

I think that installation is from visual studio If I use boost library supplied with conda (I couldn't found something similar with pip and I'm still waiting for vcpkg to update) using set BOOST_ROOT=C:\Users\XXXXX\miniconda3\Library'. I get the same error than above:

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import perspective
CRITICAL:root:Failed to import C++ bindings for Perspective probably as it could not be built for your architecture (check install logs for more details).
You can still use `PerspectiveWidget` in client mode using JupyterLab.
Traceback (most recent call last):
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python37\lib\site-packages\perspective\libpsp.py", line 21, in <module>
    from .table import *  # noqa: F401, F403
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python37\lib\site-packages\perspective\table\__init__.py", line 9, in <module>
    from .table import Table
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python37\lib\site-packages\perspective\table\table.py", line 11, in <module>
    from .view import View
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python37\lib\site-packages\perspective\table\view.py", line 15, in <module>
    from ._data_formatter import to_format, _parse_format_options
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python37\lib\site-packages\perspective\table\_data_formatter.py", line 12, in <module>
    from .libbinding import get_data_slice_zero, get_data_slice_one, get_data_slice_two, \
ModuleNotFoundError: No module named 'perspective.table.libbinding'

C++ binding issue

It seems related to the #937. Looking at both the previous installation 'lib\site-packages\perspective\table\' they both contain some libbinding.so, libpsp.so, libtbb.so when I would expect some .dll. And they cannot be open by 'dependency walker' or dumpbin:

dumpbin libpsp.so
Microsoft (R) COFF/PE Dumper Version 14.16.27030.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file libpsp.solibpsp.so : warning LNK4048: Invalid format file; ignored

Here is the full output of the pip install -v perspective-python inside conda base environment https://pastebin.com/HWma9NTy

PerspectiveWidget

I tried to use PerspectiveWidget in a jupyterlab after running succesfully jupyter labextension install @finos/perspective-jupyterlab

from datetime import date, datetime
from perspective import PerspectiveWidget

data = {
    "int": [i for i in range(4)],
    "float": [i * 1.25 for i in range(4)],
    "str": ["a", "b", "c", "d"],
    "bool": [True, False, True, False],
    "date": [date.today() for i in range(4)],
    "datetime": [datetime.now() for i in range(4)]
}
widget = PerspectiveWidget(data, row_pivots=["int"], columns=["int", "float"])
widget

The "drop_target_inner" div in the cell output div is empty and I get the error below in Chrome consol

Error: widget model not found
    at y.get_model (manager.js:375)
    at h.renderModel (renderer.js:38)
renderModel @ vendors~main.7ac0790ad861475d524e.js:2
async function (async)
renderModel @ vendors~main.7ac0790ad861475d524e.js:2
_rerender @ vendors~main.7ac0790ad861475d524e.js:2
f @ vendors~main.7ac0790ad861475d524e.js:2
l @ vendors~main.7ac0790ad861475d524e.js:2
e.emit @ vendors~main.7ac0790ad861475d524e.js:2
restoreWidgets @ vendors~main.7ac0790ad861475d524e.js:2
async function (async)
restoreWidgets @ vendors~main.7ac0790ad861475d524e.js:2
y @ vendors~main.7ac0790ad861475d524e.js:2
J @ vendors~main.7ac0790ad861475d524e.js:2
createNew @ index.js:38
(anonymous) @ index.js:38
l @ index.js:38
_initializeWidget @ index.js:38
createWidget @ index.js:38
_createOrOpenDocument @ index.js:38
open @ index.js:38
openOrReveal @ index.js:38
(anonymous) @ vendors~main.7ac0790ad861475d524e.js:2
Promise.then (async)
execute @ vendors~main.7ac0790ad861475d524e.js:2
e.execute @ vendors~main.7ac0790ad861475d524e.js:2
(anonymous) @ index.js:38
restore @ index.js:38
async function (async)
restore @ index.js:38
restore @ vendors~main.7ac0790ad861475d524e.js:2
restore @ vendors~main.7ac0790ad861475d524e.js:2
$ @ index.js:38
(anonymous) @ vendors~main.7ac0790ad861475d524e.js:2
Promise.then (async)
e.activatePlugin @ vendors~main.7ac0790ad861475d524e.js:2
e.resolveRequiredService @ vendors~main.7ac0790ad861475d524e.js:2
(anonymous) @ vendors~main.7ac0790ad861475d524e.js:2
e.activatePlugin @ vendors~main.7ac0790ad861475d524e.js:2
e.resolveRequiredService @ vendors~main.7ac0790ad861475d524e.js:2
(anonymous) @ vendors~main.7ac0790ad861475d524e.js:2
e.activatePlugin @ vendors~main.7ac0790ad861475d524e.js:2
(anonymous) @ vendors~main.7ac0790ad861475d524e.js:2
e.start @ vendors~main.7ac0790ad861475d524e.js:2
o @ main.2e41c4c6b41e87fc8253.js:1
load (async)
ANye @ main.2e41c4c6b41e87fc8253.js:1
a @ main.2e41c4c6b41e87fc8253.js:1
0 @ main.2e41c4c6b41e87fc8253.js:1
a @ main.2e41c4c6b41e87fc8253.js:1
r @ main.2e41c4c6b41e87fc8253.js:1
i @ main.2e41c4c6b41e87fc8253.js:1
(anonymous) @ vendors~main.7ac0790ad861475d524e.js:2
ebw44 commented 4 years ago

To summarize the linker issue doesn't happen when building outside a conda environment. But I'm facing #937, and I will probably wait for the conda-forge package. I'm happy to close this issue, except if you want me to run some tests to fix the conda environment build issue.

Thanks

sc1f commented 4 years ago

Yeah, it should not be building with the .so extension on Windows. We'll take a look at this issue - @timkpaine is more knowledgable about the Jupyterlab/Windows side. Thanks for the detailed report - it is super helpful. We can keep this issue open until it's proven fixed.

timkpaine commented 4 years ago

It's not building those they're there from the dist

sc1f commented 4 years ago

From the conda-forge linux dist? I assumed if there wasn't a conda-forge package built for the platform, then it would just fail at install time. I can't imagine it's picking up the .so from the sdist?

From the pastebin logs it looks like libpsp.dll is being built:

Creating library C:/Users/XXXX/AppData/Local/Temp/pip-install-vznza_vs/perspective-python/build/temp.win-amd64-3.7/Release/Release/psp.lib and object C:/Users/DavyMoyon/AppData/Local/Temp/pip-install-vznza_vs/perspective-python/build/temp.win-amd64-3.7/Release/Release/psp.exp
    psp.vcxproj -> C:\Users\XXXX\AppData\Local\Temp\pip-install-vznza_vs\perspective-python\build\temp.win-amd64-3.7\Release\Release\libpsp.dll

but then it isn't being copied out of the temp.win-amd64-3.77 folder into the lib or bdist folder. That may be the issue here.

The "can't find arrow_python.lib" issue is definitely real for Conda windows and mac.

ebw44 commented 4 years ago

So doing a pip install --no-clean -v perspective-python to keep the .dll files and copying them from the build folder into the table folder (where the .so are), I can now import perspective with no warning or error. And the PerspectiveWidget is working into jupyterLab.

sc1f commented 4 years ago

Glad to hear it. We are working on streamlining the install process + getting proper wheels built, but I am unsure why the .so files are included in the source distribution this time around.

Yuri2b commented 4 years ago

So doing a pip install --no-clean -v perspective-python to keep the .dll files and copying them from the build folder into the table folder (where the .so are), I can now import perspective with no warning or error. And the PerspectiveWidget is working into jupyterLab.

I'm doing the same steps, but still getting "CRITICAL:root:Failed to import C++ bindings for Perspective probably as it could not be built for your architecture". Wich exactly .dll files do i need to copy and where to put them?

timkpaine commented 4 years ago

@sc1f theyve always been there since we build hybrid in place, never got around to hooking a clean script before sdist but it shouldn't matter as they are rebuilt or ignored depending on the platform

ebw44 commented 4 years ago

So doing a pip install --no-clean -v perspective-python to keep the .dll files and copying them from the build folder into the table folder (where the .so are), I can now import perspective with no warning or error. And the PerspectiveWidget is working into jupyterLab.

I'm doing the same steps, but still getting "CRITICAL:root:Failed to import C++ bindings for Perspective probably as it could not be built for your architecture". Wich exactly .dll files do i need to copy and where to put them?

Here is a the list: libbinding.pyd, libpsp.dll, tbb.dll And in my case (miniconda base installation in User folder) I copied them into C:\Users\XXXXX\miniconda3\Lib\site-packages\perspective\table (where the libbinding.so, libpsp.so and libtbb.so were)

thunderbird57 commented 4 years ago

I am in linux container environment and have the same error. Are there any prerequisites for linux specifically. It is a new container so I don't have any c++ libraries installed. Could that be the reason I am receiving this PEP517 build error?

timkpaine commented 3 years ago

We've made some improvements in this space in https://github.com/finos/perspective/pull/1193 and https://github.com/finos/perspective/pull/1163