Open georgemsun opened 1 year ago
I had the same issue, I was able to circumvent the issue by cloning the GitHub repo and changing the scikit-learn requirement from scikit-learn==0.24 in setup.py and pyproject.toml to >= 0.24. Furthermore, with setuptools 68>= (I haven't tried with lower versions), I had to add the following line in pyproject.toml: license = {text = "GNU General Public License Version 2"} under [project]. After that I could install the package with pip install . (while being in the TPHATE folder). Hope this helps @georgemsun, and the developers.
Note that the reason the sklearn requirement was set at ==0.24 is because of this import in base.py: from sklearn.utils.graph import graph_shortest_path
on Line 10. I think you can replace this with networkx:
L10: import networkx as nx
L906:
# From: https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.dense.floyd_warshall_numpy.html
G = nx.from_scipy_sparse_array(D)
P = nx.floyd_warshall_numpy(G)
Instead of:
P = graph_shortest_path(D, method=method)
Note this now does not take a method option anymore, but always uses the Floyd Warshall algorithm, although networkx has also implemented https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path_length.html which is more appropriate for sparse adjacency matrices, but it requires the transformation of the returned iterator into a numpy array. Another option is to use Dijkstra directly from scipy.sparse: https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csgraph.dijkstra.html These need to be tested, but I can now replicate their Jupyter notebook in TPHATE/usage/examples.ipynb
Cannot install TPHATE by
pip install tphate
for new installations of Python >= 3.10 in Anaconda on Windows 10. Installing by same method does work for Python 3.7, 3.8, and 3.9. Error message forpip install tphate
shown below.