Skip to content

Unable to Install Cornac on Mac #611

Description

@monuoha

Description

Whenever I try to install cornac, several Cython files refuse to compile.

In which platform does it happen?

macOS 12.7.3

How do we replicate the issue?

Run pip install cornac in Terminal

Expected behavior (i.e. solution)

The terminal command should be able to install the cornac package with no problems.

Other Comments

Activity

  1. darrylong commented on Apr 2, 2024

    @darrylong
    Member

    Hi @monuoha,

    In order to pinpoint the issue, could you share with us the exact error?

  2. monuoha commented on Apr 2, 2024

    @monuoha
    Author

    Example of Cython file not compiling:

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    from ...utils import get_rng
    from ...utils.init_utils import uniform

      cdef floating _dot(int n, floating *x, int incx,
                         floating *y, int incy) noexcept nogil:
                                               ^
      ------------------------------------------------------------
      
      cornac/models/efm/recom_efm.pyx:39:42: Syntax error in C variable declaration
      cythoning cornac/models/comparer/recom_comparer_obj.pyx to cornac/models/comparer/recom_comparer_obj.cpp
    
  3. qtuantruong commented on Apr 2, 2024

    @qtuantruong
    Member

    @monuoha may we know what is the version of Python that you're using?

    Currently, we have pre-built binaries of Cornac for Python 3.8-3.11 on MacOS on PyPI. If you're also using one of those versions, it shouldn't recompile the Cython modules again.

  4. monuoha commented on Apr 2, 2024

    @monuoha
    Author

    I currently use Python 3.8.8.

  5. qtuantruong commented on Apr 2, 2024

    @qtuantruong
    Member

    That's very interesting. At the moment, it's challenging to setup the same environment as yours. May I suggest the following options:

    1. Use Conda to install Cornac.
    2. Reinstall C++ compiler using Homebrew with brew install gcc | brew link gcc, then try to install Cornac again using pip.

    Let us know if it resolves your issue.

  6. monuoha commented on Apr 3, 2024

    @monuoha
    Author

    Hello,
    I finally managed to install cornac using conda, but I only got version 1.7.1. How do I upgrade it to 2.1.0?

  7. qtuantruong commented on Apr 3, 2024

    @qtuantruong
    Member

    @monuoha could you double check if it's installed from the conda-forge channel?

  8. monuoha commented on Apr 3, 2024

    @monuoha
    Author

    conda install cornac -c conda-forge

    The above command is what I used to install conda.

  9. qtuantruong commented on Apr 3, 2024

    @qtuantruong
    Member

    You can check which version and which channel the package is pull from as shown in the image below:
    Screenshot 2024-04-03 at 3 43 08 PM

  10. monuoha commented on Apr 3, 2024

    @monuoha
    Author

    How do I access that image, I exited out of the terminal window right after cornac was installed.

  11. qtuantruong commented on Apr 3, 2024

    @qtuantruong
    Member

    you'll see it when you run the command conda install cornac -c conda-forge

  12. monuoha commented on Apr 3, 2024

    @monuoha
    Author

    I already ran the command, and this is what it showed me:

    Collecting package metadata (current_repodata.json): - WARNING conda.models.version:get_matcher(538): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1
    done
    Solving environment: done
    
    
    ==> WARNING: A newer version of conda exists. <==
      current version: 4.14.0
      latest version: 24.3.0
    
    Please update conda by running
    
        $ conda update -n base -c conda-forge conda
    
    
    
    # All requested packages already installed.
    
    Retrieving notices: ...working... done
    
  13. qtuantruong commented on Apr 3, 2024

    @qtuantruong
    Member

    you can uninstall cornac with conda uninstall cornac and try again with the command above

  14. monuoha commented on Apr 4, 2024

    @monuoha
    Author

    I uninstalled it and then reinstalled it, and here is what I got

    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        conda-22.9.0               |   py38h50d1736_2         966 KB  conda-forge
        ------------------------------------------------------------
                                               Total:         966 KB
    
    The following NEW packages will be INSTALLED:
    
      cornac             conda-forge/osx-64::cornac-1.7.1-py38h9529b5f_0 None
      python_abi         conda-forge/osx-64::python_abi-3.8-2_cp38 None
    
    The following packages will be UPDATED:
    
      conda              pkgs/main::conda-22.9.0-py38hecd8cb5_0 --> conda-forge::conda-22.9.0-py38h50d1736_2 None
    
  15. monuoha commented on Apr 4, 2024

    @monuoha
    Author

    Also, another issue that I encountered when using cornac is that my kernel on Jupyter Notebook would always die whenever I try to train the BPR model.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions