MicrobialDarkMatter / GraphMB

MIT License
34 stars 6 forks source link

Issue during conda installation #35

Open brambloemen opened 2 weeks ago

brambloemen commented 2 weeks ago

I would very much like to use the tool, but ran into some issues during installation with conda.

I followed the conda installation instructions:

conda create -n graphmb -c conda-forge make cmake libgcc python=3.7 pip tensorflow
conda activate graphmb
pip install graphmb

But this ran into the following error:

ERROR: Ignored the following yanked versions: 0.2.0rc0, 0.2.0rc1, 0.2.0rc2, 0.2.0
ERROR: Ignored the following versions that require a different python version: 0.2.0rc5 Requires-Python >=3.8; 0.2.0rc6 Requires-Python >=3.8; 0.2.1 Requires-Python >=3.8; 0.2.2 Requires-Python >=3.8; 0.2.3 Requires-Python >=3.8; 0.2.4 Requires-Python >=3.8; 0.2.5 Requires-Python >=3.8
ERROR: Could not find a version that satisfies the requirement graphmb (from versions: 0.2.0rc3, 0.2.0rc4)
ERROR: No matching distribution found for graphmb

I tried to re-install by manually setting python version to 3.8, but this produced the following error when running the tool:

Traceback (most recent call last):
  File "/data/brbloemen/mambaforge/envs/graphmb/bin/graphmb", line 8, in <module>
    sys.exit(main())
  File "/data/brbloemen/mambaforge/envs/graphmb/lib/python3.8/site-packages/graphmb/main.py", line 442, in main
    dataset.read_assembly()
  File "/data/brbloemen/mambaforge/envs/graphmb/lib/python3.8/site-packages/graphmb/contigsdataset.py", line 151, in read_assembly
    self.read_depths()
  File "/data/brbloemen/mambaforge/envs/graphmb/lib/python3.8/site-packages/graphmb/contigsdataset.py", line 495, in read_depths
    self.node_depths = np.ones(len(self.node_names), dtype=np.float)
  File "/data/brbloemen/mambaforge/envs/graphmb/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
AndreLamurias commented 4 days ago

Hi, I don't use conda so support for that is always lagging, so thanks for reporting this bug. The python version has to be at least 3.8. I was able to get a conda env working with python 3.9, but the numpy version shouldn't be higher than 1.23.0 because of the error you mentioned: conda create -n graphmb -c conda-forge make cmake libgcc python=3.9 pip tensorflow numpy=1.23.0

At some point we should update the code to fix that issue. For now I will update the readme and numpy requirements. Let me know if that command works for you.