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

Python binding installation is giving warning. #3402

Closed
theshoonyam opened this issue Feb 8, 2023 · 4 comments
Closed

Python binding installation is giving warning. #3402

theshoonyam opened this issue Feb 8, 2023 · 4 comments

Comments

@theshoonyam
Copy link
Contributor

What am I trying to accomplish?

I was trying to get the python binding of mlpack by following the instructions given in README.MD .

What is the output?

On running make -j8 , I got the following output on command line.
I am pasting the small range of output(where the warning is) since there is character limit.

home/aditya/Desktop/mlpack/src/mlpack/bindings/python/print_wrapper_py.cpp: In function ‘void mlpack::bindings::python::PrintWrapperPY(const string&, const string&, const string&)’: /home/aditya/Desktop/mlpack/src/mlpack/bindings/python/print_wrapper_py.cpp:67:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 67 | for(int i=0; i<methods.size(); i++) | ~^~~~~~~~~~~~~~~ [ 88%] Linking CXX executable ../../../bin/generate_pyx_krann [ 88%] Built target generate_pyx_krann [ 88%] Building Cython binding decision_tree.so... /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. warnings.warn( running build_ext cythoning mlpack/decision_tree.pyx to mlpack/decision_tree.cpp [ 88%] Linking CXX executable ../../../bin/generate_pyx_linear_regression_predict [ 88%] Built target generate_pyx_linear_regression_predict [ 88%] Building Cython binding det.so... /home/aditya/.local/lib/python3.10/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/aditya/Desktop/mlpack/build/src/mlpack/bindings/python/mlpack/decision_tree.pyx tree = Parsing.p_module(s, pxd, full_module_name)

Steps to reproduce:

  • Ubuntu - 22.04
  • Python-3.10.6
  • Follow the instructions given in README.MD to install python bindings.

This issue is already reported in the following link:
Issue 1
Issue 2

@theshoonyam
Copy link
Contributor Author

Please look into the matter as I am getting more warnings. I have followed the manual steps as described in mlpack README.
These are the steps that I followed:

  • git clone the repository in local terminal
  • install all the dependent packages.
  • made a build folder inside source directory
  • cmake -DBUILD_PYTHON_BINDINGS=ON ../
  • sudo make -j12
  • sudo make install

With few warnings, It shows that it has completely installed the python bindings.
But when I run import mlpack inside any .py file, it gives ModuleNotFoundError.

@AdarshSantoria
Copy link
Contributor

Once I also had this particular problem, then I run the python script in build/src/mlpack/bindings/python which then worked for me. Please try it out, it may help you too.

@rcurtin
Copy link
Member

rcurtin commented Feb 16, 2023

Did you set PYTHONPATH correctly? Manually building the Python bindings often requires some amount of debugging along those lines. (This is why they are packaged in pip and conda.)

@theshoonyam
Copy link
Contributor Author

Yeah, Now it is working fine. Thanks @rcurtin and @AdarshSantoria!

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

No branches or pull requests

3 participants