Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Error #3

Open
bscully27 opened this issue Feb 22, 2019 · 9 comments
Open

Install Error #3

bscully27 opened this issue Feb 22, 2019 · 9 comments

Comments

@bscully27
Copy link

Windows10, 64bit, Python2.7 (anaconda)

pip install git+https://github.com/AndriyMulyar/sklearn-oblique-tree --no-deps

C:\Users\bscully1\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\ProgramData\Anaconda2\lib\site-packages\numpy\core\include -I. -IC:\ProgramData\Anaconda2\include -IC:\ProgramData\Anaconda2\PC /Tcsklearn_oblique_tree/oblique/_oblique.c /Fobuild\temp.win-amd64-2.7\Release\sklearn_oblique_tree/oblique/_oblique.obj -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
_oblique.c
c:\programdata\anaconda2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
c:\users\bscully1\appdata\local\temp\1\pip-hf3jgq-build\sklearn_oblique_tree\oblique\../../oc1_source/mktree.c(1432) : error C2059: syntax error : ')'
c:\users\bscully1\appdata\local\temp\1\pip-hf3jgq-build\sklearn_oblique_tree\oblique\../../oc1_source/mktree.c(1439) : error C2440: '=' : cannot convert from 'double *' to 'double'
error: command 'C:\\Users\\bscully1\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

Then trying python setup.py install

running install
running bdist_egg
running egg_info
writing requirements to sklearn_oblique_tree.egg-info\requires.txt
writing sklearn_oblique_tree.egg-info\PKG-INFO
writing top-level names to sklearn_oblique_tree.egg-info\top_level.txt
writing dependency_links to sklearn_oblique_tree.egg-info\dependency_links.txt
reading manifest file 'sklearn_oblique_tree.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'sklearn_oblique_tree.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'sklearn_oblique_tree.oblique._oblique' extension
C:\Users\bscully1\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\ProgramData\Anaconda2\lib\site-packages\numpy\core\include -I. -IC:\ProgramData\Anaconda2\include -IC:\ProgramData\Anaconda2\PC /Tcsklearn_oblique_tree/oblique/_oblique.c /Fobuild\temp.win-amd64-2.7\Release\sklearn_oblique_tree/oblique/_oblique.obj -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
_oblique.c
c:\programdata\anaconda2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
c:\users\bscully1\downloads\sklearn-oblique-tree-master\sklearn-oblique-tree\sklearn_oblique_tree\oblique../../oc1_source/mktree.c(1432) : error C2059: syntax error : ')'
c:\users\bscully1\downloads\sklearn-oblique-tree-master\sklearn-oblique-tree\sklearn_oblique_tree\oblique../../oc1_source/mktree.c(1439) : error C2440: '=' : cannot convert from 'double *' to 'double'
error: command 'C:\Users\bscully1\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2

@AndriyMulyar
Copy link
Owner

AndriyMulyar commented Feb 22, 2019 via email

@bscully27
Copy link
Author

bscully27 commented Feb 22, 2019 via email

@AndriyMulyar
Copy link
Owner

AndriyMulyar commented Feb 22, 2019 via email

@bscully27
Copy link
Author

bscully27 commented Feb 22, 2019 via email

@AndriyMulyar
Copy link
Owner

AndriyMulyar commented Feb 25, 2019

@bscully27 The underlying code that is being wrapped is Murthy's C implementation written in C88 dating back the 1994. Your error message says that cython is attempting compilation with C++ so hence the error. I unfortunately do not have the time to insure the installation can be done on windows but the unit tests pass on unix based machines when I do an install in a clean virtual environment.

Best,
Andriy

UPDATE:
I have removed the cython dependency and pre-compiled all C files in the current version. Could you try installing it again when you get a chance and let me know how it goes? Thank you.

@BingzhaoZhu
Copy link

I just tried and got the same error with @bscully27 . I guess using python wheel may solve it. Thanks

@bscully27 The underlying code that is being wrapped is Murthy's C implementation written in C88 dating back the 1994. Your error message says that cython is attempting compilation with C++ so hence the error. I unfortunately do not have the time to insure the installation can be done on windows but the unit tests pass on unix based machines when I do an install in a clean virtual environment.

Best,
Andriy

UPDATE:
I have removed the cython dependency and pre-compiled all C files in the current version. Could you try installing it again when you get a chance and let me know how it goes? Thank you.

@AndriyMulyar
Copy link
Owner

I just tried and got the same error with @bscully27 . I guess using python wheel may solve it. Thanks

@bscully27 The underlying code that is being wrapped is Murthy's C implementation written in C88 dating back the 1994. Your error message says that cython is attempting compilation with C++ so hence the error. I unfortunately do not have the time to insure the installation can be done on windows but the unit tests pass on unix based machines when I do an install in a clean virtual environment.
Best,
Andriy
UPDATE:
I have removed the cython dependency and pre-compiled all C files in the current version. Could you try installing it again when you get a chance and let me know how it goes? Thank you.

Are you on a windows machine? I have looked into it a bit and it would require some non-trivial work. You can also clone the package and try installing from source.

@TStepi
Copy link

TStepi commented Apr 30, 2020

When I run pip install git+https://github.com/AndriyMulyar/sklearn-oblique-tree I also get errors:

   /home/xxx/.miniconda3/compiler_compat/ld: build/temp.linux-x86_64-3.7/oc1_source/load_data.o:/tmp/pip-req-build-7gfodqs8/oc1_source/oc1.h:106: multiple definition of `TREE_NODE'; build/temp.linux-x86_64-3.7/sklearn_oblique_tree/oblique/_oblique.o:/tmp/pip-req-build-7gfodqs8/sklearn_oblique_tree/oblique/../../oc1_source/oc1.h:106: first defined here
   /home/xxx/.miniconda3/compiler_compat/ld: build/temp.linux-x86_64-3.7/oc1_source/perturb.o:/tmp/pip-req-build-7gfodqs8/oc1_source/oc1.h:106: multiple definition of `TREE_NODE'; build/temp.linux-x86_64-3.7/sklearn_oblique_tree/oblique/_oblique.o:/tmp/pip-req-build-7gfodqs8/sklearn_oblique_tree/oblique/../../oc1_source/oc1.h:106: first defined here
   /home/xxx/.miniconda3/compiler_compat/ld: build/temp.linux-x86_64-3.7/oc1_source/classify.o:/tmp/pip-req-build-7gfodqs8/oc1_source/oc1.h:106: multiple definition of `TREE_NODE'; build/temp.linux-x86_64-3.7/sklearn_oblique_tree/oblique/_oblique.o:/tmp/pip-req-build-7gfodqs8/sklearn_oblique_tree/oblique/../../oc1_source/oc1.h:106: first defined here
   /home/xxx/.miniconda3/compiler_compat/ld: build/temp.linux-x86_64-3.7/oc1_source/compute_impurity.o:/tmp/pip-req-build-7gfodqs8/oc1_source/oc1.h:106: multiple definition of `TREE_NODE'; build/temp.linux-x86_64-3.7/sklearn_oblique_tree/oblique/_oblique.o:/tmp/pip-req-build-7gfodqs8/sklearn_oblique_tree/oblique/../../oc1_source/oc1.h:106: first defined here
   /home/xxx/.miniconda3/compiler_compat/ld: build/temp.linux-x86_64-3.7/oc1_source/impurity_measures.o:/tmp/pip-req-build-7gfodqs8/oc1_source/oc1.h:106: multiple definition of `TREE_NODE'; build/temp.linux-x86_64-3.7/sklearn_oblique_tree/oblique/_oblique.o:/tmp/pip-req-build-7gfodqs8/sklearn_oblique_tree/oblique/../../oc1_source/oc1.h:106: first defined here
   /home/xxx/.miniconda3/compiler_compat/ld: build/temp.linux-x86_64-3.7/oc1_source/prune.o:/tmp/pip-req-build-7gfodqs8/oc1_source/oc1.h:106: multiple definition of `TREE_NODE'; build/temp.linux-x86_64-3.7/sklearn_oblique_tree/oblique/_oblique.o:/tmp/pip-req-build-7gfodqs8/sklearn_oblique_tree/oblique/../../oc1_source/oc1.h:106: first defined here
   /home/xxx/.miniconda3/compiler_compat/ld: build/temp.linux-x86_64-3.7/oc1_source/tree_util.o:/tmp/pip-req-build-7gfodqs8/oc1_source/tree_util.c:36: multiple definition of `train_data'; build/temp.linux-x86_64-3.7/sklearn_oblique_tree/oblique/_oblique.o:/tmp/pip-req-build-7gfodqs8/sklearn_oblique_tree/oblique/../../oc1_source/mktree.c:38: first defined here
   /home/xxx/.miniconda3/compiler_compat/ld: build/temp.linux-x86_64-3.7/oc1_source/tree_util.o:/tmp/pip-req-build-7gfodqs8/oc1_source/oc1.h:106: multiple definition of `TREE_NODE'; build/temp.linux-x86_64-3.7/sklearn_oblique_tree/oblique/_oblique.o:/tmp/pip-req-build-7gfodqs8/sklearn_oblique_tree/oblique/../../oc1_source/oc1.h:106: first defined here
   collect2: error: ld returned 1 exit status
   error: command 'gcc' failed with exit status 1

Any idea how to fix that?

@nnd3
Copy link

nnd3 commented Jun 6, 2020

I just tried and got the same error with @bscully27 . I guess using python wheel may solve it. Thanks

@bscully27 The underlying code that is being wrapped is Murthy's C implementation written in C88 dating back the 1994. Your error message says that cython is attempting compilation with C++ so hence the error. I unfortunately do not have the time to insure the installation can be done on windows but the unit tests pass on unix based machines when I do an install in a clean virtual environment.
Best,
Andriy
UPDATE:
I have removed the cython dependency and pre-compiled all C files in the current version. Could you try installing it again when you get a chance and let me know how it goes? Thank you.

Are you on a windows machine? I have looked into it a bit and it would require some non-trivial work. You can also clone the package and try installing from source.

While installing direct from the source I am getting following two errors:-

  1. error C2059: syntax error: ''
  2. error C2440: '=': cannot convert from 'double *' to 'double'
    Below are the lines in mktree.c which have caused error
  3. double * temp, average(), sdev(), min();
  4. attribute_min[j] = min(temp, no_of_points);
    I was able to remove error 1 by changing line 1 to
    double * temp;
    but could not remove second error
    can you please help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants