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

Unable to Install Cornac on Mac #611

Open
monuoha opened this issue Apr 2, 2024 · 15 comments
Open

Unable to Install Cornac on Mac #611

monuoha opened this issue Apr 2, 2024 · 15 comments

Comments

@monuoha
Copy link

monuoha commented Apr 2, 2024

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

@darrylong
Copy link
Member

Hi @monuoha,

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

@monuoha
Copy link
Author

monuoha commented Apr 2, 2024

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

@tqtg
Copy link
Member

tqtg commented Apr 2, 2024

@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.

@monuoha
Copy link
Author

monuoha commented Apr 2, 2024

I currently use Python 3.8.8.

@tqtg
Copy link
Member

tqtg commented Apr 2, 2024

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.

@monuoha
Copy link
Author

monuoha commented Apr 3, 2024

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?

@tqtg
Copy link
Member

tqtg commented Apr 3, 2024

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

@monuoha
Copy link
Author

monuoha commented Apr 3, 2024

conda install cornac -c conda-forge

The above command is what I used to install conda.

@tqtg
Copy link
Member

tqtg commented Apr 3, 2024

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

@monuoha
Copy link
Author

monuoha commented Apr 3, 2024

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

@tqtg
Copy link
Member

tqtg commented Apr 3, 2024

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

@monuoha
Copy link
Author

monuoha commented Apr 3, 2024

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

@tqtg
Copy link
Member

tqtg commented Apr 3, 2024

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

@monuoha
Copy link
Author

monuoha commented Apr 4, 2024

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

@monuoha
Copy link
Author

monuoha commented Apr 4, 2024

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants