mlbendall / telescope

Quantification of transposable element expression using RNA-seq
MIT License
64 stars 17 forks source link

Deprecated numpy alias causing AttributeError #44

Closed walidabualafia closed 1 year ago

walidabualafia commented 1 year ago

Hi,

I just installed the stable version of telescope, and I was attempting to run eval $(telescope test). Seems like there is an AttributeError due to a deprecated numpy alias np.int. I'm pasting the error below.

...
AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
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. Did you mean: 'inf'?

Any help on the matter would be appreciated.

gamazeps commented 1 year ago

Looking at the commit history, it has been fixed in the main branch in this commit .

The release on bioconda seems to be v1.0.3, @mlbendall could you make a new release to get the latest changes ?

Installing the following way (as per the doc):

mamba env create -n telescope https://github.com/mlbendall/telescope/raw/main/environment.yml
conda activate telescope
pip install git+https://github.com/mlbendall/telescope.git
telescope --version

should probably fix the issue

walidabualafia commented 1 year ago

Thank you, @gamazeps. I just attempted to reinstall with mamba, and it's working well now!

Cheers

pdeepak87 commented 1 year ago

Hi,

Sorry for reopening the ticket. I have the same issue. I tried installing via conda which gave me the error above. Then I tried this I got anaconda error

mamba env create -n telescope https://github.com/mlbendall/telescope/raw/main/environment.yml

SpecNotFound: Anaconda Client is required to interact with anaconda.org or an Anaconda API. Please run `conda install anaconda-client -n base`.

I tried again on a different platform I got this error


mamba env create -n telescope https://github.com/mlbendall/telescope/raw/main/environment.yml

SpecNotFound: https://github.com/mlbendall/telescope/raw/main/environment.yml was not found on anaconda.org.
You may need to be logged in. Try running:
    anaconda login

Then I tried using a physical yml file

mamba env create -f environment.yml  
bioconda/osx-arm64                                 124.0 B @ 593.0 B/s  0.2s
pkgs/main/osx-arm64                                  1.9MB @   3.4MB/s  0.6s
pkgs/r/osx-arm64                                   118.0 B @ 190.0 B/s  0.1s
pkgs/r/noarch                                        1.3MB @   1.9MB/s  0.5s
pkgs/main/noarch                                   852.1kB @   1.1MB/s  0.2s
bioconda/noarch                                      4.7MB @   4.1MB/s  1.3s
conda-forge/osx-arm64                                7.3MB @   4.4MB/s  1.9s
conda-forge/noarch                                  13.8MB @   4.4MB/s  3.5s

Looking for: ["python[version='>=3.7']", 'future', 'pip', 'pyyaml', 'cython', 'numpy', 'scipy', "pysam[version='>=0.19']", 'htslib', 'intervaltree', 'pandas', 'samtools']

Could not solve for environment specs
The following packages are incompatible
├─ pysam >=0.19  does not exist (perhaps a typo or a missing channel);
└─ samtools   does not exist (perhaps a typo or a missing channel).

I tried again in a different environment and it created the environment I tried installing using pip


pip install git+https://github.com/mlbendall/telescope.git
Collecting git+https://github.com/mlbendall/telescope.git
  Cloning https://github.com/mlbendall/telescope.git to /tmp/pip-req-build-y2w7alsd
  Running command git clone --filter=blob:none --quiet https://github.com/mlbendall/telescope.git /tmp/pip-req-build-y2w7alsd
  Resolved https://github.com/mlbendall/telescope.git to commit 4cf18595eea1702775e8a8bbc7b37ebac9233fd5
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      /Users/deepak.poduval/conda_envs/telescope/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-req-build-y2w7alsd/telescope/utils/calignment.pxd
        tree = Parsing.p_module(s, pxd, full_module_name)

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      # -*- coding: utf-8 -*-
      from calignment cimport AlignedPair
      ^
      ------------------------------------------------------------

      telescope/utils/calignment.pyx:2:0: 'calignment.pxd' not found

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      # -*- coding: utf-8 -*-
      from calignment cimport AlignedPair
      ^
      ------------------------------------------------------------

      telescope/utils/calignment.pyx:2:0: 'calignment/AlignedPair.pxd' not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-y2w7alsd/setup.py", line 39, in <module>
          extensions = cythonize(extensions)
        File "/Users/deepak.poduval/conda_envs/telescope/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
          cythonize_one(*args)
        File "/Users/deepak.poduval/conda_envs/telescope/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: telescope/utils/calignment.pyx
      Compiling telescope/utils/calignment.pyx because it changed.
      [1/1] Cythonizing telescope/utils/calignment.pyx
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I still get errors. Please help me with this issue so that I can try out your great tool.

Thanks, Deepak