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

Error of Installation of MisTree using Google Colab after November Update #27

Open
Kennyc222 opened this issue Nov 21, 2024 · 7 comments

Comments

@Kennyc222
Copy link

Here is a problem when I intended to install Mistree on GOogle Colab...Now I'm unable to use it at all!

Screen Shot 2024-11-21 at 11 11 04 AM

I suspected it is on your side, may you please fix it? Thanks

Kenny

@knaidoo29
Copy link
Owner

There's a whole bunch of issues that could be at work here. I need more details to help you. What python version are using? What numpy version? Is a fortran compiler available?

The easiest way to get around all these issues is to clone the pure_python branch of mistree from github and install it by running pip install . in the cloned directory. You will then import as
import mistree_pp as mist.

@Kennyc222
Copy link
Author

Kennyc222 commented Nov 21, 2024

According toe Google Colab itself, the version of python is 3.10

py3.10

Numpy is 2.13

numpy 2.1.3

And I don't think Fortrain complier at all.

import mistree_pp as mist doesn't work after pip install it

@knaidoo29
Copy link
Owner

So you didn't get any errors when installing? Can you try doing it again and sending me what it outputs while it installs?

@Kennyc222
Copy link
Author

actually, I still get error when I even tried to install pure python...now I can't use your package anymore....

@knaidoo29
Copy link
Owner

If you show me what it says you might be able to.

@knaidoo29
Copy link
Owner

Another thing you can do is use python 3.8, and a numpy version < 1.23.

@knaidoo29
Copy link
Owner

I am able to get it running on google colab. You need to do the following:

  1. Clone the pure_python repository into a specific folder
!mkdir software
!mkdir software/mistree
!git clone -b pure_python https://github.com/knaidoo29/mistree.git software/mistree
  1. Install older versions of setuptools and numpy (in both instances it might ask you to restart):
!pip install numpy==1.22
!pip install setuptools==59.8.0
  1. Install mistree pure_python branch
!python software/mistree/setup.py build
!python software/mistree/setup.py install
  1. Test it works:
import numpy as np
import matplotlib.pylab as plt
import mistree_pp as mist

x = np.random.random_sample(100)
y = np.random.random_sample(100)

mst = mist.GetMST(x=x, y=y)

d, l, b, s, l_index, b_index = mst.get_stats(include_index=True)

plt.figure(figsize=(7., 7.))

# plotting nodes:
plt.scatter(x, y, s=10, color='r')

# plotting MST edges:
plt.plot([x[l_index[0]], x[l_index[1]]],
         [y[l_index[0]], y[l_index[1]]],
         color='k')

plt.xlim(0., 1.)
plt.ylim(0., 1.)
plt.xlabel(r'$X$', size=16)
plt.ylabel(r'$Y$', size=16)
plt.tight_layout()
plt.show()

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

2 participants