torchsearchsorted icon indicating copy to clipboard operation
torchsearchsorted copied to clipboard

Error during installation

Open AndreaPi opened this issue 5 years ago • 8 comments

I'm trying to install the module under conda.

  1. I created a conda environment with the following packages:
# packages in environment at /anaconda3/envs/pytorch:
#
# Name                    Version                   Build  Channel
_pytorch_select           0.1                       cpu_0  
astroid                   2.3.3                    py37_0  
blas                      1.0                         mkl  
ca-certificates           2020.1.1                      0  
certifi                   2020.4.5.1               py37_0  
cffi                      1.14.0           py37hb5b8e2f_0  
cycler                    0.10.0                   py37_0  
freetype                  2.9.1                hb4e5f40_0  
intel-openmp              2019.4                      233  
isort                     4.3.21                   py37_0  
kiwisolver                1.1.0            py37h0a44026_0  
lazy-object-proxy         1.4.3            py37h1de35cc_0  
libcxx                    4.0.1                hcfea43d_1  
libcxxabi                 4.0.1                hcfea43d_1  
libedit                   3.1.20181209         hb402a30_0  
libffi                    3.2.1                h0a44026_6  
libgfortran               3.0.1                h93005f0_2  
libpng                    1.6.37               ha441bb4_0  
matplotlib                3.1.3                    py37_0  
matplotlib-base           3.1.3            py37h9aa3819_0  
mccabe                    0.6.1                    py37_1  
mkl                       2019.4                      233  
mkl-service               2.3.0            py37hfbe908c_0  
mkl_fft                   1.0.15           py37h5e564d8_0  
mkl_random                1.1.0            py37ha771720_0  
ncurses                   6.2                  h0a44026_1  
ninja                     1.9.0            py37h04f5b5a_0  
numpy                     1.18.1           py37h7241aed_0  
numpy-base                1.18.1           py37h6575580_1  
openssl                   1.1.1g               h1de35cc_0  
pip                       20.0.2                   py37_1  
pycparser                 2.20                       py_0  
pylint                    2.5.0                    py37_0  
pyparsing                 2.4.6                      py_0  
python                    3.7.7           hc70fcce_0_cpython  
python-dateutil           2.8.1                      py_0  
pytorch                   1.4.0           cpu_py37hf9bb1df_0  
readline                  8.0                  h1de35cc_0  
setuptools                46.1.3                   py37_0  
six                       1.14.0                   py37_0  
sqlite                    3.31.1               h5c1f38d_1  
tk                        8.6.8                ha441bb4_0  
torchdiffeq               0.0.1                    pypi_0    pypi
tornado                   6.0.4            py37h1de35cc_1  
wheel                     0.34.2                   py37_0  
wrapt                     1.12.1           py37h1de35cc_1  
xz                        5.2.5                h1de35cc_0  
zlib                      1.2.11               h1de35cc_3  
  1. I cloned the repository and ran pip install .:
$ cd torchsearchsorted/
$ ls
LICENSE         README.md       examples        setup.py        src             test
$ pip install .
Processing /Users/andreapanizza/BoxSync/PC/GitHub_repositories/torchsearchsorted
    ERROR: Command errored out with exit status 1:
     command: /anaconda3/envs/pytorch/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6m/3vm9vws14tzb0nyh0yldv56r0000gn/T/pip-req-build-r_59wapl/setup.py'"'"'; __file__='"'"'/private/var/folders/6m/3vm9vws14tzb0nyh0yldv56r0000gn/T/pip-req-build-r_59wapl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/6m/3vm9vws14tzb0nyh0yldv56r0000gn/T/pip-req-build-r_59wapl/pip-egg-info
         cwd: /private/var/folders/6m/3vm9vws14tzb0nyh0yldv56r0000gn/T/pip-req-build-r_59wapl/
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/6m/3vm9vws14tzb0nyh0yldv56r0000gn/T/pip-req-build-r_59wapl/setup.py", line 2, in <module>
        from torch.utils.cpp_extension import BuildExtension, CUDA_HOME
      File "/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/__init__.py", line 81, in <module>
        from torch._C import *
    ImportError: dlopen(/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/_C.cpython-37m-darwin.so, 9): Symbol not found: _mkl_blas_caxpy
      Referenced from: /anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/../../../../libmkl_intel_lp64.dylib
      Expected in: flat namespace
     in /anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib/../../../../libmkl_intel_lp64.dylib
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I don't understand the error message. My system is:

Darwin 17.7.0 Darwin Kernel Version 17.7.0: Tue Feb 18 22:51:29 PST 2020; root:xnu-4570.71.73~1/RELEASE_X86_64 x86_64

AndreaPi avatar May 07 '20 12:05 AndreaPi

on mac then ? do you have a cuda working ?

aliutkus avatar May 14 '20 05:05 aliutkus

Thanks for your reply!

  1. yes on Mac
  2. no, I use pytorch-cpu, see?
pytorch                   1.4.0           cpu_py37hf9bb1df_0

AndreaPi avatar May 14 '20 09:05 AndreaPi

ok, it looks like pytorch doesn't find mkl things and it looks like a pretty pytorch-internal, let's investigate this

aliutkus avatar May 14 '20 10:05 aliutkus

@aliutkus any news here? It would be great if I could use searchsorted for a preprint I'm writing.

AndreaPi avatar May 22 '20 13:05 AndreaPi

please check this: https://github.com/pytorch/pytorch/issues/23466

aliutkus avatar May 22 '20 14:05 aliutkus

Thank you very much for the pointer, but I'm not sure how it relates to the current issue. Unlike the user who opened that issue, I'm able to import torch just fine:

Python 3.7.7 (default, Mar 26 2020, 10:32:53) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>>  

What do you suggest I should try? I installed pytorch through conda. Are you suggesting I should uninstall it and install it again? Or uninstall it with conda, and then install it with pip?

AndreaPi avatar May 22 '20 20:05 AndreaPi

thing is: I'm really not sure that your issue is related to the actual torchsearchsorted thing: my guess is it's some kind of problem related to compilation: apparently, some compilater or linker is looking for intel MKL, but can't find it.. =(

aliutkus avatar May 22 '20 20:05 aliutkus

any news on this ?

aliutkus avatar May 26 '20 05:05 aliutkus