Hello,
I am trying to use bamnostic instead of pysam, but I meet several issues on this line using "pkg_resources".
- Install with : pip install bamnostic
>>> import bamnostic as bs
UserWarning:C:\Users\XXX\AppData\Local\miniforge3\envs\bamnostic\Lib\site-packages\bamnostic\__init__.py:41: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
- Install with : conda create -n bamnostic bamnostic
>>> import bamnostic as bs
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
import bamnostic as bs
File "C:\Users\XXX\AppData\Local\miniforge3\envs\bamnostic\Lib\site-packages\bamnostic\__init__.py", line 42, in <module>
example_bam = pkg_resources.resource_filename('bamnostic', 'data/') + 'example.bam'
^^^^^^^^^^^^^
NameError: name 'pkg_resources' is not defined
Workaround
I did replace
import pkg_resources
example_bam = pkg_resources.resource_filename('bamnostic', 'data/') + 'example.bam'
with
import os
example_bam = os.path.join(os.path.dirname(__file__), 'data','example.bam')
Is it the proper way to solve this issue according to you ?
Hello,
I am trying to use bamnostic instead of pysam, but I meet several issues on this line using "pkg_resources".
bamnostic/bamnostic/__init__.py
Line 41 in 3d9157e
Workaround
I did replace
with
Is it the proper way to solve this issue according to you ?