cca_zoo icon indicating copy to clipboard operation
cca_zoo copied to clipboard

Installation error

Open Neel-132 opened this issue 1 year ago • 14 comments

I tried to install cca-zoo several times but I keep getting errors like "python setup.py bdist_wheel did not run successfully".

Neel-132 avatar Nov 30 '23 15:11 Neel-132

Hi sorry about that! Any details what your process has been? Just pip install from pypi or a local?

jameschapman19 avatar Nov 30 '23 16:11 jameschapman19

I just used pip install cca-zoo. But, I think its having a problem with building a wheel

Neel-132 avatar Nov 30 '23 16:11 Neel-132

I'm just making a couple of changes to not require torch install as I suspect that could cause some problems (regardless of whether it fixes this specific one!) any other error messages would be helpful if you have them

jameschapman19 avatar Nov 30 '23 16:11 jameschapman19

Yes, it still is unable to build wheel for matplotlib. I have attached the corresponding screenshots. Screenshot 2023-12-01 152055 Screenshot 2023-12-01 152116

Neel-132 avatar Dec 01 '23 09:12 Neel-132

ok new version just released 2.5.0 doesn't require matplotlib (or pytorch another big dependency previously). Think this should fix your problem :)

jameschapman19 avatar Dec 04 '23 12:12 jameschapman19

It did solve the issue. Thank you so much.

Neel-132 avatar Dec 05 '23 04:12 Neel-132

No problem was lucky I happened to be trying to reduce dependencies - this version also imports A LOT quicker 😃

jameschapman19 avatar Dec 05 '23 07:12 jameschapman19

Is this repo still active? Are installs working for others? I'm trying the getting started code in google colab and get errors suggesting that files are missing or renamed...

!pip install cca-zoo==2.5.0

` import numpy as np from cca_zoo.data.simulated import LinearSimulatedData from cca_zoo.models import CCA

data = LinearSimulatedData(view_features=[10,10],latent_dims: int = 2) (X,Y) = data.sample(n_samples=100)

model = CCA(latent_dimensions=2) model.fit(views)

results = model.transform(views)`

File "", line 7 data = LinearSimulatedData(view_features=[10,10],latent_dims: int = 2) ^ SyntaxError: positional argument follows keyword argument

` import numpy as np from cca_zoo.data.simulated import LinearSimulatedData from cca_zoo.models import CCA

data = LinearSimulatedData(view_features=[10,10],latent_dims= 2) (X,Y) = data.sample(n_samples=100)

model = CCA(latent_dimensions=2) model.fit(views)

results = model.transform(views)`


ModuleNotFoundError Traceback (most recent call last) in <cell line: 3>() 1 # Import required libraries 2 import numpy as np ----> 3 from cca_zoo.data.simulated import LinearSimulatedData 4 from cca_zoo.models import CCA 5

ModuleNotFoundError: No module named 'cca_zoo.data'


NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the "Open Examples" button below.

`from cca_zoo.models import CCA

import numpy as np

train_view_1 = np.random.normal(size=(100, 10)) train_view_2 = np.random.normal(size=(100, 10))

train_view_1 -= train_view_1.mean(axis=0) train_view_2 -= train_view_2.mean(axis=0)

latent_dimensions = 3 linear_cca = CCA(latent_dimensions=latent_dimensions)

linear_cca.fit((train_view_1, train_view_2))`


ModuleNotFoundError Traceback (most recent call last) in <cell line: 1>() ----> 1 from cca_zoo.models import CCA 2 3 import numpy as np 4 5 # Create synthetic data for two views

ModuleNotFoundError: No module named 'cca_zoo.models'


NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the "Open Examples" button below.

MHRosenberg avatar May 01 '24 19:05 MHRosenberg

Keeping an eye on it - the problem here is more likely related to me documenting things incorrectly

jameschapman19 avatar May 01 '24 19:05 jameschapman19

Ok, thanks for the crazy fast reply!

Would it be possible to give me a working snippit in the meantime?

MHRosenberg avatar May 01 '24 19:05 MHRosenberg

Yeah do you know what you're trying to do? What was your original attempt based on? I know it's roughly under cca_zoo.datasets now (part of my ongoing (finished?) attempts to sync with scikit-learn)

jameschapman19 avatar May 01 '24 19:05 jameschapman19

The first question so I can do a snippet the second so I know where the misleading documentation/example lives!

jameschapman19 avatar May 01 '24 19:05 jameschapman19

I just want to run linear CCA, regularized CCA, and deep CCA to start. If I'm not mistaken, none of your example install and run code snippits work right now...

this and this also this

The exact code I ran in google colab is above. The installs complete without errors but the imports are all broken.

MHRosenberg avatar May 01 '24 21:05 MHRosenberg

Cool thanks!

I'll take a look at these as soon as I get the chance (maybe next couple of days) - in the meantime you can just use numpy arrays/your own data.

Basically I updated the namespace for the data stuff without updating the docs! Appreciate you pointing these out

jameschapman19 avatar May 01 '24 22:05 jameschapman19