Closed pyjm closed 1 year ago
Hi, thanks for raising this issue. I think this was linked to the pandas 1.0 release that broke sparse matrix operations in biom (when Songbird was first developed in 2019). You can confirm this by providing your environment (aka provide the contents of conda env export
).
If this is the case, the fastest solution is to downgrade pandas < 1.0
via conda install pandas<1
Thanks @mortonjt!!
I tried downgrading pandas to version conda install pandas==0.25
but got tons of conflicts.
Please see below the contents for conda env export
.
(tf) []$ conda env export
name: tf
channels:
- conda-forge
- bioconda
- anaconda
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- _openmp_mutex=5.1=1_gnu
- _tflow_select=2.3.0=mkl
- absl-py=0.15.0=pyhd3eb1b0_0
- astor=0.8.1=py36h06a4308_0
- attrs=21.4.0=pyhd3eb1b0_0
- backcall=0.2.0=pyhd3eb1b0_0
- biom-format=2.1.6=py36_1
- blas=1.0=mkl
- brotlipy=0.7.0=py36h27cfd23_1003
- c-ares=1.19.0=h5eee18b_0
- ca-certificates=2023.5.7=hbcca054_0
- cachecontrol=0.12.6=pyhd3eb1b0_0
- certifi=2020.6.20=pyhd3eb1b0_3
- cffi=1.14.6=py36h400218f_0
- charset-normalizer=2.0.4=pyhd3eb1b0_0
- click=8.0.3=pyhd3eb1b0_0
- colorama=0.4.4=pyh9f0ad1d_0
- coverage=4.0.3=py36_1
- coveralls=1.3.0=py36_0
- cryptography=35.0.0=py36hd23ed53_0
- cycler=0.11.0=pyhd3eb1b0_0
- decorator=5.1.1=pyhd3eb1b0_0
- docopt=0.6.2=py_1
- flake8=4.0.1=pyhd3eb1b0_1
- freetype=2.12.1=h4a9f257_0
- future=0.18.2=py36_1
- gast=0.2.2=py36_0
- google-pasta=0.2.0=pyhd3eb1b0_0
- grpcio=1.31.0=py36hf8bcb03_0
- h5py=2.10.0=py36hd6299e0_1
- hdf5=1.10.6=hb1b8bf9_0
- hdmedians=0.13=py36hdd07704_1000
- idna=3.3=pyhd3eb1b0_0
- importlib-metadata=4.8.1=py36h06a4308_0
- importlib_metadata=4.8.1=hd3eb1b0_0
- iniconfig=1.1.1=pyhd3eb1b0_0
- intel-openmp=2022.1.0=h9e868ea_3769
- ipython=7.16.1=py36h5ca1d4c_0
- ipython_genutils=0.2.0=pyhd3eb1b0_1
- jedi=0.18.0=py36h06a4308_1
- joblib=1.0.1=pyhd3eb1b0_0
- jpeg=9e=h7f8727e_0
- keras-applications=1.0.8=py_1
- keras-preprocessing=1.1.2=pyhd3eb1b0_0
- kiwisolver=1.3.1=py36h2531618_0
- lcms2=2.12=h3be6417_0
- ld_impl_linux-64=2.38=h1181459_1
- lerc=3.0=h295c915_0
- libdeflate=1.8=h7f8727e_5
- libffi=3.3=he6710b0_2
- libgcc-ng=11.2.0=h1234567_1
- libgfortran-ng=7.5.0=ha8ba4b0_17
- libgfortran4=7.5.0=ha8ba4b0_17
- libgomp=11.2.0=h1234567_1
- libpng=1.6.37=hbc83047_0
- libprotobuf=3.17.2=h4ff587b_1
- libstdcxx-ng=11.2.0=h1234567_1
- libtiff=4.5.0=h6a678d5_1
- libwebp-base=1.2.4=h5eee18b_0
- lockfile=0.12.2=py36h06a4308_0
- lz4-c=1.9.4=h6a678d5_0
- markdown=3.1.1=py36_0
- matplotlib-base=3.3.4=py36h62a2d02_0
- mccabe=0.7.0=pyhd3eb1b0_0
- mkl=2020.2=256
- mkl-service=2.3.0=py36he8ac12f_0
- mkl_fft=1.3.0=py36h54f3939_0
- mkl_random=1.1.1=py36h0573a6f_0
- more-itertools=8.12.0=pyhd3eb1b0_0
- msgpack-python=1.0.2=py36hff7bd54_1
- natsort=7.1.1=pyhd3eb1b0_0
- ncurses=6.4=h6a678d5_0
- numpy=1.19.2=py36h54aff64_0
- numpy-base=1.19.2=py36hfa32c7d_0
- olefile=0.46=py36_0
- openjpeg=2.4.0=h3ad879b_0
- openssl=1.1.1l=h7f98852_0
- opt_einsum=3.3.0=pyhd3eb1b0_1
- packaging=21.3=pyhd3eb1b0_0
- pandas=1.1.5=py36ha9443f7_0
- parso=0.8.3=pyhd3eb1b0_0
- patsy=0.5.3=pyhd8ed1ab_0
- pexpect=4.8.0=pyhd3eb1b0_3
- pickleshare=0.7.5=pyhd3eb1b0_1003
- pillow=8.3.1=py36h2c7a002_0
- pip=21.2.2=py36h06a4308_0
- pluggy=0.13.1=py36h06a4308_0
- prompt-toolkit=3.0.20=pyhd3eb1b0_0
- protobuf=3.17.2=py36h295c915_0
- ptyprocess=0.7.0=pyhd3eb1b0_2
- py=1.11.0=pyhd3eb1b0_0
- pycodestyle=2.8.0=pyhd3eb1b0_0
- pycparser=2.21=pyhd3eb1b0_0
- pyflakes=2.4.0=pyhd3eb1b0_0
- pygments=2.11.2=pyhd3eb1b0_0
- pyopenssl=22.0.0=pyhd3eb1b0_0
- pyparsing=3.0.4=pyhd3eb1b0_0
- pysocks=1.7.1=py36h06a4308_0
- pytest=6.2.4=py36h06a4308_2
- python=3.6.13=h12debd9_1
- python-dateutil=2.8.2=pyhd3eb1b0_0
- python_abi=3.6=2_cp36m
- pytz=2021.3=pyhd3eb1b0_0
- pyyaml=5.1.2=py36h516909a_1
- readline=8.2=h5eee18b_0
- requests=2.27.1=pyhd3eb1b0_0
- scikit-bio=0.5.6=py36h6323ea4_0
- scikit-learn=0.24.2=py36ha9443f7_0
- scipy=1.5.2=py36h0b6359f_0
- setuptools=58.0.4=py36h06a4308_0
- six=1.16.0=pyhd3eb1b0_1
- songbird=1.0.3=py36h9f0ad1d_0
- sqlite=3.41.2=h5eee18b_0
- tensorboard=1.15.0=pyhb230dea_0
- tensorflow=1.15.0=mkl_py36h4920b83_0
- tensorflow-base=1.15.0=mkl_py36he1670d9_0
- tensorflow-estimator=1.15.1=pyh2649769_0
- termcolor=1.1.0=py36h06a4308_1
- threadpoolctl=2.2.0=pyh0d69192_0
- tk=8.6.12=h1ccaba5_0
- toml=0.10.2=pyhd3eb1b0_0
- tornado=6.1=py36h27cfd23_0
- tqdm=4.65.0=pyhd8ed1ab_0
- traitlets=4.3.3=py36h06a4308_0
- typing_extensions=4.1.1=pyh06a4308_0
- urllib3=1.26.8=pyhd3eb1b0_0
- wcwidth=0.2.5=pyhd3eb1b0_0
- webencodings=0.5.1=py36_1
- werkzeug=0.16.1=py_0
- wheel=0.37.1=pyhd3eb1b0_0
- wrapt=1.12.1=py36h7b6447c_1
- xz=5.4.2=h5eee18b_0
- yaml=0.2.5=h7f98852_2
- zipp=3.6.0=pyhd3eb1b0_0
- zlib=1.2.13=h5eee18b_0
- zstd=1.5.2=ha4553b6_0
prefix: /PATH/miniconda/envs/tf
Any further thoughts? Thank you!!
Hi @mortonjt,
As a side note. I set up my conda environment following @fedarko's directions here but I am still getting conflicts.
Any ideas on what could be going wrong?
Thank you!
Hi, I'm assuming that you followed the readme instructions?
conda create -n songbird_env songbird "pandas>=0.18.0,<1" -c conda-forge
source activate songbird_env
It would help if you included the error messages.
@mortonjt,
I initially tried following the readme instructions but that did not work. Conda was stuck in "Solving environment". I am trying the code you provided again right now and will report back soon. But Conda is currently stuck in "Solving environment". That's what happened last time.
Thank you!
Try using mamba instead of conda -- it is much faster. You can install it in conda via conda install mamba
. Then this will look like mamba create -n songbird_env songbird "pandas>=0.18.0,<1" -c conda-forge
@mortonjt,
Yay, the installation with mamba worked!!
I then tried running songbird and got the same error message related to pandas and broke sparse matrix operations.
Traceback (most recent call last):
File "/PATH/miniconda/envs/tf/bin/songbird", line 225, in <module>
songbird()
File "/PATH/miniconda/envs/tf/lib/python3.6/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/PATH/miniconda/envs/tf/lib/python3.6/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/PATH/miniconda/envs/tf/lib/python3.6/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/PATH/miniconda/envs/tf/lib/python3.6/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/PATH/miniconda/envs/tf/lib/python3.6/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/PATH/miniconda/envs/tf/bin/songbird", line 154, in multinomial
dense_table = table.to_dataframe().to_dense().T
File "/PATH/miniconda/envs/tf/lib/python3.6/site-packages/biom/table.py", line 3839, in to_dataframe
mat = [pd.SparseSeries(v.toarray().ravel()) for v in self.matrix_data]
File "/PATH/miniconda/envs/tf/lib/python3.6/site-packages/biom/table.py", line 3839, in <listcomp>
mat = [pd.SparseSeries(v.toarray().ravel()) for v in self.matrix_data]
TypeError: object() takes no parameters
So I downgraded pandas with conda install pandas==0.25
as you previously instructed me, but I am still getting the same error.
Please see below the contents of conda env export
. Note that the version of pandas is 0.25.
> (songbird_env) []$ conda env export
> name: songbird_env
> channels:
> - conda-forge
> - defaults
> dependencies:
> - _libgcc_mutex=0.1=conda_forge
> - _openmp_mutex=4.5=2_gnu
> - _tflow_select=2.3.0=mkl
> - absl-py=0.15.0=pyhd8ed1ab_0
> - alsa-lib=1.2.8=h166bdaf_0
> - astor=0.8.1=pyh9f0ad1d_0
> - attr=2.5.1=h166bdaf_1
> - attrs=23.1.0=pyh71513ae_1
> - backcall=0.2.0=pyh9f0ad1d_0
> - backports=1.0=pyhd8ed1ab_3
> - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
> - biom-format=2.1.12=py37hda87dfa_1
> - brotli=1.0.9=h166bdaf_8
> - brotli-bin=1.0.9=h166bdaf_8
> - brotlipy=0.7.0=py37h540881e_1004
> - bzip2=1.0.8=h7f98852_4
> - c-ares=1.18.1=h7f98852_0
> - ca-certificates=2023.01.10=h06a4308_0
> - cachecontrol=0.12.11=pyhd8ed1ab_1
> - cached-property=1.5.2=hd8ed1ab_1
> - cached_property=1.5.2=pyha770c72_1
> - cairo=1.16.0=ha61ee94_1014
> - certifi=2022.12.7=py37h06a4308_0
> - cffi=1.15.1=py37h43b0acd_1
> - charset-normalizer=3.1.0=pyhd8ed1ab_0
> - click=8.1.3=py37h89c1867_0
> - colorama=0.4.6=pyhd8ed1ab_0
> - cryptography=38.0.2=py37h5994e8b_1
> - cycler=0.11.0=pyhd8ed1ab_0
> - cython=0.29.32=py37hd23a5d3_0
> - dbus=1.13.6=h5008d03_3
> - decorator=5.1.1=pyhd8ed1ab_0
> - exceptiongroup=1.1.1=pyhd8ed1ab_0
> - expat=2.5.0=hcb278e6_1
> - fftw=3.3.10=nompi_hc118613_107
> - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
> - font-ttf-inconsolata=3.000=h77eed37_0
> - font-ttf-source-code-pro=2.038=h77eed37_0
> - font-ttf-ubuntu=0.83=hab24e00_0
> - fontconfig=2.14.2=h14ed4e7_0
> - fonts-conda-ecosystem=1=0
> - fonts-conda-forge=1=0
> - fonttools=4.38.0=py37h540881e_0
> - freetype=2.12.1=hca18f0e_1
> - future=0.18.2=py37h89c1867_5
> - gast=0.2.2=py_0
> - gettext=0.21.1=h27087fc_0
> - glib=2.76.2=hfc55251_0
> - glib-tools=2.76.2=hfc55251_0
> - google-pasta=0.2.0=pyh8c360ce_0
> - graphite2=1.3.13=h58526e2_1001
> - grpc-cpp=1.48.1=hc2bec63_1
> - grpcio=1.48.1=py37h42e856d_1
> - gst-plugins-base=1.22.0=h4243ec0_2
> - gstreamer=1.22.0=h25f0c4b_2
> - gstreamer-orc=0.4.33=h166bdaf_0
> - h5py=3.7.0=nompi_py37hf1ce037_101
> - harfbuzz=6.0.0=h8e241bc_0
> - hdf5=1.12.2=nompi_h4df4325_101
> - hdmedians=0.14.2=py37hda87dfa_2
> - icu=70.1=h27087fc_0
> - idna=3.4=pyhd8ed1ab_0
> - importlib-metadata=4.11.4=py37h89c1867_0
> - importlib_metadata=4.11.4=hd8ed1ab_0
> - iniconfig=2.0.0=pyhd8ed1ab_0
> - ipython=7.33.0=py37h89c1867_0
> - jack=1.9.22=h11f4161_0
> - jedi=0.18.2=pyhd8ed1ab_0
> - joblib=1.2.0=pyhd8ed1ab_0
> - jpeg=9e=h0b41bf4_3
> - keras-applications=1.0.8=py_1
> - keras-preprocessing=1.1.2=pyhd8ed1ab_0
> - keyutils=1.6.1=h166bdaf_0
> - kiwisolver=1.4.4=py37h7cecad7_0
> - krb5=1.20.1=h81ceb04_0
> - lame=3.100=h166bdaf_1003
> - lcms2=2.14=h6ed2654_0
> - ld_impl_linux-64=2.40=h41732ed_0
> - lerc=4.0.0=h27087fc_0
> - libabseil=20220623.0=cxx17_h05df665_6
> - libaec=1.0.6=hcb278e6_1
> - libblas=3.9.0=16_linux64_openblas
> - libbrotlicommon=1.0.9=h166bdaf_8
> - libbrotlidec=1.0.9=h166bdaf_8
> - libbrotlienc=1.0.9=h166bdaf_8
> - libcap=2.67=he9d0100_0
> - libcblas=3.9.0=16_linux64_openblas
> - libclang=15.0.7=default_had23c3d_1
> - libclang13=15.0.7=default_h3e3d535_1
> - libcups=2.3.3=h36d4200_3
> - libcurl=8.0.1=h588be90_0
> - libdb=6.2.32=h9c3ff4c_0
> - libdeflate=1.14=h166bdaf_0
> - libedit=3.1.20191231=he28a2e2_2
> - libev=4.33=h516909a_1
> - libevent=2.1.10=h28343ad_4
> - libexpat=2.5.0=hcb278e6_1
> - libffi=3.4.2=h7f98852_5
> - libflac=1.4.2=h27087fc_0
> - libgcc-ng=12.2.0=h65d4601_19
> - libgcrypt=1.10.1=h166bdaf_0
> - libgfortran-ng=12.2.0=h69a702a_19
> - libgfortran5=12.2.0=h337968e_19
> - libglib=2.76.2=hebfc3b9_0
> - libgomp=12.2.0=h65d4601_19
> - libgpg-error=1.46=h620e276_0
> - libiconv=1.17=h166bdaf_0
> - liblapack=3.9.0=16_linux64_openblas
> - libllvm15=15.0.7=hadd5161_1
> - libnghttp2=1.52.0=h61bc06f_0
> - libnsl=2.0.0=h7f98852_0
> - libogg=1.3.4=h7f98852_1
> - libopenblas=0.3.21=pthreads_h78a6416_3
> - libopus=1.3.1=h7f98852_1
> - libpng=1.6.39=h753d276_0
> - libpq=15.3=hbcd7760_0
> - libprotobuf=3.20.1=h6239696_4
> - libsndfile=1.2.0=hb75c966_0
> - libsqlite=3.41.2=h2797004_1
> - libssh2=1.10.0=hf14f497_3
> - libstdcxx-ng=12.2.0=h46fd767_19
> - libsystemd0=253=h8c4010b_1
> - libtiff=4.4.0=h82bc61c_5
> - libtool=2.4.7=h27087fc_0
> - libudev1=253=h0b41bf4_1
> - libuuid=2.38.1=h0b41bf4_0
> - libvorbis=1.3.7=h9c3ff4c_0
> - libwebp-base=1.3.0=h0b41bf4_0
> - libxcb=1.13=h7f98852_1004
> - libxkbcommon=1.5.0=h79f4944_1
> - libxml2=2.10.3=hca2bb57_4
> - libzlib=1.2.13=h166bdaf_4
> - lockfile=0.12.2=py_1
> - lz4-c=1.9.4=hcb278e6_0
> - markdown=3.4.3=pyhd8ed1ab_0
> - matplotlib=3.5.3=py37h89c1867_2
> - matplotlib-base=3.5.3=py37hf395dca_2
> - matplotlib-inline=0.1.6=pyhd8ed1ab_0
> - mpg123=1.31.3=hcb278e6_0
> - msgpack-python=1.0.4=py37h7cecad7_0
> - munkres=1.1.4=pyh9f0ad1d_0
> - mysql-common=8.0.32=hf1915f5_2
> - mysql-libs=8.0.32=hca2cd23_2
> - natsort=8.3.1=pyhd8ed1ab_0
> - ncurses=6.3=h27087fc_1
> - nspr=4.35=h27087fc_0
> - nss=3.89=he45b914_0
> - numpy=1.21.6=py37h976b520_0
> - openjpeg=2.5.0=h7d73246_1
> - openssl=3.1.0=hd590300_3
> - opt_einsum=3.3.0=pyhd8ed1ab_1
> - packaging=23.1=pyhd8ed1ab_0
> - pandas=0.25.0=py37he6710b0_0
> - parso=0.8.3=pyhd8ed1ab_0
> - patsy=0.5.3=pyhd8ed1ab_0
> - pcre2=10.40=hc3806b6_0
> - pexpect=4.8.0=py37hc8dfbb8_1
> - pickleshare=0.7.5=py37hc8dfbb8_1002
> - pillow=9.2.0=py37h850a105_2
> - pip=23.1.2=pyhd8ed1ab_0
> - pixman=0.40.0=h36c2ea0_0
> - pluggy=1.0.0=py37h89c1867_3
> - ply=3.11=py_1
> - prompt-toolkit=3.0.38=pyha770c72_0
> - protobuf=3.20.1=py37hd23a5d3_0
> - pthread-stubs=0.4=h36c2ea0_1001
> - ptyprocess=0.7.0=pyhd3deb0d_0
> - pulseaudio=16.1=hcb278e6_3
> - pulseaudio-client=16.1=h5195f5e_3
> - pulseaudio-daemon=16.1=ha8d29e2_3
> - pycparser=2.21=pyhd8ed1ab_0
> - pygments=2.15.1=pyhd8ed1ab_0
> - pyopenssl=23.1.1=pyhd8ed1ab_0
> - pyparsing=3.0.9=pyhd8ed1ab_0
> - pyqt=5.15.7=py37hf30b843_1
> - pyqt5-sip=12.11.0=py37hd23a5d3_1
> - pysocks=1.7.1=py37h89c1867_5
> - pytest=7.2.0=py37h89c1867_0
> - python=3.7.12=hf930737_100_cpython
> - python-dateutil=2.8.2=pyhd8ed1ab_0
> - python_abi=3.7=3_cp37m
> - pytz=2023.3=pyhd8ed1ab_0
> - qt-main=5.15.8=h5d23da1_6
> - re2=2022.06.01=h27087fc_1
> - readline=8.2=h8228510_1
> - requests=2.29.0=pyhd8ed1ab_0
> - scikit-bio=0.5.5=py37h3010b51_1000
> - scikit-learn=1.0.2=py37hf9e9bfc_0
> - scipy=1.7.3=py37hf2a6cf1_0
> - setuptools=59.8.0=py37h89c1867_1
> - sip=6.7.2=py37hd23a5d3_0
> - six=1.16.0=pyh6c4a22f_0
> - songbird=1.0.3=py37hc8dfbb8_1
> - sqlite=3.41.2=h2c6b66d_1
> - tensorboard=1.15.0=py37_0
> - tensorflow=1.15.0=mkl_py37h28c19af_0
> - tensorflow-base=1.15.0=mkl_py37he1670d9_0
> - tensorflow-estimator=1.15.1=pyh2649769_0
> - termcolor=1.1.0=pyhd8ed1ab_3
> - threadpoolctl=3.1.0=pyh8a188c0_0
> - tk=8.6.12=h27826a3_0
> - toml=0.10.2=pyhd8ed1ab_0
> - tomli=2.0.1=pyhd8ed1ab_0
> - tornado=6.2=py37h540881e_0
> - tqdm=4.65.0=pyhd8ed1ab_1
> - traitlets=5.9.0=pyhd8ed1ab_0
> - typing-extensions=4.5.0=hd8ed1ab_0
> - typing_extensions=4.5.0=pyha770c72_0
> - unicodedata2=14.0.0=py37h540881e_1
> - urllib3=1.26.15=pyhd8ed1ab_0
> - wcwidth=0.2.6=pyhd8ed1ab_0
> - werkzeug=0.16.1=py_0
> - wheel=0.40.0=pyhd8ed1ab_0
> - wrapt=1.14.1=py37h540881e_0
> - xcb-util=0.4.0=h516909a_0
> - xcb-util-image=0.4.0=h166bdaf_0
> - xcb-util-keysyms=0.4.0=h516909a_0
> - xcb-util-renderutil=0.3.9=h166bdaf_0
> - xcb-util-wm=0.4.1=h516909a_0
> - xkeyboard-config=2.38=h0b41bf4_0
> - xorg-kbproto=1.0.7=h7f98852_1002
> - xorg-libice=1.0.10=h7f98852_0
> - xorg-libsm=1.2.3=hd9c2040_1000
> - xorg-libx11=1.8.4=h0b41bf4_0
> - xorg-libxau=1.0.9=h7f98852_0
> - xorg-libxdmcp=1.1.3=h7f98852_0
> - xorg-libxext=1.3.4=h0b41bf4_2
> - xorg-libxrender=0.9.10=h7f98852_1003
> - xorg-renderproto=0.11.1=h7f98852_1002
> - xorg-xextproto=7.3.0=h0b41bf4_1003
> - xorg-xproto=7.0.31=h7f98852_1007
> - xz=5.2.6=h166bdaf_0
> - zipp=3.15.0=pyhd8ed1ab_0
> - zlib=1.2.13=h166bdaf_4
> - zstd=1.5.2=h3eb15da_6
> prefix: /PATH/miniconda/envs/songbird_env
Hi, it looks like the issue is with biom-format. So try mamba install biom-format=2.1.7 -c conda-forge
.
Basically we cannot support any packages updated after 2019 (due to tensorflow) -- so you may need to downgrade all packages (sorry).
@mortonjt,
I tried downgrading biom-format mamba install biom-format=2.1.7 -c conda-forge
but that did not fix the issue. I'll try downgrading more packages. Hopefully I'll be able to use songbird.
Thanks for your help!
I'm not sure the biom-format package is the exact problem here -- pinning the version of pandas, as is done in the environment creation command, should force conda / mamba to choose versions of other packages that are compatible with this pandas version (and there should be old versions of biom-format still available online). Downgrading packages one-on-one in an existing environment will be challenging, because dependency issues in these environments can get really complicated to solve manually (e.g. an older version of package X requires an older version of package Y, which requires a version of at least package Z, ...)
So: the fact that you are still receiving this error implies that the environment creation process isn't working properly. Could you try running the "mamba create" command with a new environment name (e.g. songbird_env2)? I think this should fix the problem, and allow you to use songbird from this new environment. I suspect that reusing the old environment name is causing conda / mamba to get confused and not start over from a fresh environment, which messes up the dependencies.
If this doesn't fix the problem, then please run "conda env export" from within the newly created environment and post the output here (without first trying to downgrade anything in the environment). But fingers crossed that this works!
On Tue, May 16, 2023, 8:49 AM pyjm @.***> wrote:
@mortonjt https://github.com/mortonjt,
I tried downgrading biom-format mamba install biom-format=2.1.7 -c conda-forge but that did not fix the issue. I'll try downgrading more packages. Hopefully I'll be able to use songbird.
Thanks for your help!
— Reply to this email directly, view it on GitHub https://github.com/biocore/songbird/issues/168#issuecomment-1549930549, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA736P2BQX3HDGFVT47VPKTXGOOYZANCNFSM6AAAAAAX5FJCTI . You are receiving this because you were mentioned. Message ID: @.***>
Hi @fedarko,
Thanks for chiming in!!
I tried running mamba create -n songbird_env2 songbird "pandas>=0.18.0,<1" -c conda-forge
but I am getting the same error. Could it be that something is wrong with my .biom file?
Please see below the output of conda env export
. Thank you!!
(songbird_env2) []$ conda env export
name: songbird_env2
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_gnu
- _tflow_select=2.3.0=mkl
- absl-py=0.15.0=pyhd8ed1ab_0
- alsa-lib=1.2.8=h166bdaf_0
- astor=0.8.1=pyh9f0ad1d_0
- attr=2.5.1=h166bdaf_1
- attrs=23.1.0=pyh71513ae_1
- backcall=0.2.0=pyh9f0ad1d_0
- backports=1.0=pyhd8ed1ab_3
- backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
- biom-format=2.1.12=py37hda87dfa_1
- brotli=1.0.9=h166bdaf_8
- brotli-bin=1.0.9=h166bdaf_8
- brotlipy=0.7.0=py37h540881e_1004
- bzip2=1.0.8=h7f98852_4
- c-ares=1.18.1=h7f98852_0
- ca-certificates=2023.5.7=hbcca054_0
- cachecontrol=0.12.11=pyhd8ed1ab_1
- cached-property=1.5.2=hd8ed1ab_1
- cached_property=1.5.2=pyha770c72_1
- cairo=1.16.0=ha61ee94_1014
- certifi=2023.5.7=pyhd8ed1ab_0
- cffi=1.15.1=py37h43b0acd_1
- charset-normalizer=3.1.0=pyhd8ed1ab_0
- click=8.1.3=py37h89c1867_0
- colorama=0.4.6=pyhd8ed1ab_0
- cryptography=38.0.2=py37h5994e8b_1
- cycler=0.11.0=pyhd8ed1ab_0
- cython=0.29.32=py37hd23a5d3_0
- dbus=1.13.6=h5008d03_3
- decorator=5.1.1=pyhd8ed1ab_0
- exceptiongroup=1.1.1=pyhd8ed1ab_0
- expat=2.5.0=hcb278e6_1
- fftw=3.3.10=nompi_hc118613_107
- font-ttf-dejavu-sans-mono=2.37=hab24e00_0
- font-ttf-inconsolata=3.000=h77eed37_0
- font-ttf-source-code-pro=2.038=h77eed37_0
- font-ttf-ubuntu=0.83=hab24e00_0
- fontconfig=2.14.2=h14ed4e7_0
- fonts-conda-ecosystem=1=0
- fonts-conda-forge=1=0
- fonttools=4.38.0=py37h540881e_0
- freetype=2.12.1=hca18f0e_1
- future=0.18.2=py37h89c1867_5
- gast=0.2.2=py_0
- gettext=0.21.1=h27087fc_0
- glib=2.76.2=hfc55251_0
- glib-tools=2.76.2=hfc55251_0
- google-pasta=0.2.0=pyh8c360ce_0
- graphite2=1.3.13=h58526e2_1001
- grpc-cpp=1.48.1=hc2bec63_1
- grpcio=1.48.1=py37h42e856d_1
- gst-plugins-base=1.22.0=h4243ec0_2
- gstreamer=1.22.0=h25f0c4b_2
- gstreamer-orc=0.4.33=h166bdaf_0
- h5py=3.7.0=nompi_py37hf1ce037_101
- harfbuzz=6.0.0=h8e241bc_0
- hdf5=1.12.2=nompi_h4df4325_101
- hdmedians=0.14.2=py37hda87dfa_2
- icu=70.1=h27087fc_0
- idna=3.4=pyhd8ed1ab_0
- importlib-metadata=4.11.4=py37h89c1867_0
- importlib_metadata=4.11.4=hd8ed1ab_0
- iniconfig=2.0.0=pyhd8ed1ab_0
- ipython=7.33.0=py37h89c1867_0
- jack=1.9.22=h11f4161_0
- jedi=0.18.2=pyhd8ed1ab_0
- joblib=1.2.0=pyhd8ed1ab_0
- jpeg=9e=h0b41bf4_3
- keras-applications=1.0.8=py_1
- keras-preprocessing=1.1.2=pyhd8ed1ab_0
- keyutils=1.6.1=h166bdaf_0
- kiwisolver=1.4.4=py37h7cecad7_0
- krb5=1.20.1=h81ceb04_0
- lame=3.100=h166bdaf_1003
- lcms2=2.14=h6ed2654_0
- ld_impl_linux-64=2.40=h41732ed_0
- lerc=4.0.0=h27087fc_0
- libabseil=20220623.0=cxx17_h05df665_6
- libaec=1.0.6=hcb278e6_1
- libblas=3.9.0=16_linux64_openblas
- libbrotlicommon=1.0.9=h166bdaf_8
- libbrotlidec=1.0.9=h166bdaf_8
- libbrotlienc=1.0.9=h166bdaf_8
- libcap=2.67=he9d0100_0
- libcblas=3.9.0=16_linux64_openblas
- libclang=15.0.7=default_had23c3d_1
- libclang13=15.0.7=default_h3e3d535_1
- libcups=2.3.3=h36d4200_3
- libcurl=8.0.1=h588be90_0
- libdb=6.2.32=h9c3ff4c_0
- libdeflate=1.14=h166bdaf_0
- libedit=3.1.20191231=he28a2e2_2
- libev=4.33=h516909a_1
- libevent=2.1.10=h28343ad_4
- libexpat=2.5.0=hcb278e6_1
- libffi=3.4.2=h7f98852_5
- libflac=1.4.2=h27087fc_0
- libgcc-ng=12.2.0=h65d4601_19
- libgcrypt=1.10.1=h166bdaf_0
- libgfortran-ng=12.2.0=h69a702a_19
- libgfortran5=12.2.0=h337968e_19
- libglib=2.76.2=hebfc3b9_0
- libgomp=12.2.0=h65d4601_19
- libgpg-error=1.46=h620e276_0
- libiconv=1.17=h166bdaf_0
- liblapack=3.9.0=16_linux64_openblas
- libllvm15=15.0.7=hadd5161_1
- libnghttp2=1.52.0=h61bc06f_0
- libnsl=2.0.0=h7f98852_0
- libogg=1.3.4=h7f98852_1
- libopenblas=0.3.21=pthreads_h78a6416_3
- libopus=1.3.1=h7f98852_1
- libpng=1.6.39=h753d276_0
- libpq=15.3=hbcd7760_0
- libprotobuf=3.20.1=h6239696_4
- libsndfile=1.2.0=hb75c966_0
- libsqlite=3.41.2=h2797004_1
- libssh2=1.10.0=hf14f497_3
- libstdcxx-ng=12.2.0=h46fd767_19
- libsystemd0=253=h8c4010b_1
- libtiff=4.4.0=h82bc61c_5
- libtool=2.4.7=h27087fc_0
- libudev1=253=h0b41bf4_1
- libuuid=2.38.1=h0b41bf4_0
- libvorbis=1.3.7=h9c3ff4c_0
- libwebp-base=1.3.0=h0b41bf4_0
- libxcb=1.13=h7f98852_1004
- libxkbcommon=1.5.0=h79f4944_1
- libxml2=2.10.3=hca2bb57_4
- libzlib=1.2.13=h166bdaf_4
- lockfile=0.12.2=py_1
- lz4-c=1.9.4=hcb278e6_0
- markdown=3.4.3=pyhd8ed1ab_0
- matplotlib=3.5.3=py37h89c1867_2
- matplotlib-base=3.5.3=py37hf395dca_2
- matplotlib-inline=0.1.6=pyhd8ed1ab_0
- mpg123=1.31.3=hcb278e6_0
- msgpack-python=1.0.4=py37h7cecad7_0
- munkres=1.1.4=pyh9f0ad1d_0
- mysql-common=8.0.32=hf1915f5_2
- mysql-libs=8.0.32=hca2cd23_2
- natsort=8.3.1=pyhd8ed1ab_0
- ncurses=6.3=h27087fc_1
- nspr=4.35=h27087fc_0
- nss=3.89=he45b914_0
- numpy=1.21.6=py37h976b520_0
- openjpeg=2.5.0=h7d73246_1
- openssl=3.1.0=hd590300_3
- opt_einsum=3.3.0=pyhd8ed1ab_1
- packaging=23.1=pyhd8ed1ab_0
- pandas=0.25.3=py37hb3f55d8_0
- parso=0.8.3=pyhd8ed1ab_0
- patsy=0.5.3=pyhd8ed1ab_0
- pcre2=10.40=hc3806b6_0
- pexpect=4.8.0=py37hc8dfbb8_1
- pickleshare=0.7.5=py37hc8dfbb8_1002
- pillow=9.2.0=py37h850a105_2
- pip=23.1.2=pyhd8ed1ab_0
- pixman=0.40.0=h36c2ea0_0
- pluggy=1.0.0=py37h89c1867_3
- ply=3.11=py_1
- prompt-toolkit=3.0.38=pyha770c72_0
- protobuf=3.20.1=py37hd23a5d3_0
- pthread-stubs=0.4=h36c2ea0_1001
- ptyprocess=0.7.0=pyhd3deb0d_0
- pulseaudio=16.1=hcb278e6_3
- pulseaudio-client=16.1=h5195f5e_3
- pulseaudio-daemon=16.1=ha8d29e2_3
- pycparser=2.21=pyhd8ed1ab_0
- pygments=2.15.1=pyhd8ed1ab_0
- pyopenssl=23.1.1=pyhd8ed1ab_0
- pyparsing=3.0.9=pyhd8ed1ab_0
- pyqt=5.15.7=py37hf30b843_1
- pyqt5-sip=12.11.0=py37hd23a5d3_1
- pysocks=1.7.1=py37h89c1867_5
- pytest=7.2.0=py37h89c1867_0
- python=3.7.12=hf930737_100_cpython
- python-dateutil=2.8.2=pyhd8ed1ab_0
- python_abi=3.7=3_cp37m
- pytz=2023.3=pyhd8ed1ab_0
- qt-main=5.15.8=h5d23da1_6
- re2=2022.06.01=h27087fc_1
- readline=8.2=h8228510_1
- requests=2.29.0=pyhd8ed1ab_0
- scikit-bio=0.5.5=py37h3010b51_1000
- scikit-learn=1.0.2=py37hf9e9bfc_0
- scipy=1.7.3=py37hf2a6cf1_0
- setuptools=59.8.0=py37h89c1867_1
- sip=6.7.2=py37hd23a5d3_0
- six=1.16.0=pyh6c4a22f_0
- songbird=1.0.3=py37hc8dfbb8_1
- sqlite=3.41.2=h2c6b66d_1
- tensorboard=1.15.0=py37_0
- tensorflow=1.15.0=mkl_py37h28c19af_0
- tensorflow-base=1.15.0=mkl_py37he1670d9_0
- tensorflow-estimator=1.15.1=pyh2649769_0
- termcolor=1.1.0=pyhd8ed1ab_3
- threadpoolctl=3.1.0=pyh8a188c0_0
- tk=8.6.12=h27826a3_0
- toml=0.10.2=pyhd8ed1ab_0
- tomli=2.0.1=pyhd8ed1ab_0
- tornado=6.2=py37h540881e_0
- tqdm=4.65.0=pyhd8ed1ab_1
- traitlets=5.9.0=pyhd8ed1ab_0
- typing-extensions=4.5.0=hd8ed1ab_0
- typing_extensions=4.5.0=pyha770c72_0
- unicodedata2=14.0.0=py37h540881e_1
- urllib3=1.26.15=pyhd8ed1ab_0
- wcwidth=0.2.6=pyhd8ed1ab_0
- werkzeug=0.16.1=py_0
- wheel=0.40.0=pyhd8ed1ab_0
- wrapt=1.14.1=py37h540881e_0
- xcb-util=0.4.0=h516909a_0
- xcb-util-image=0.4.0=h166bdaf_0
- xcb-util-keysyms=0.4.0=h516909a_0
- xcb-util-renderutil=0.3.9=h166bdaf_0
- xcb-util-wm=0.4.1=h516909a_0
- xkeyboard-config=2.38=h0b41bf4_0
- xorg-kbproto=1.0.7=h7f98852_1002
- xorg-libice=1.0.10=h7f98852_0
- xorg-libsm=1.2.3=hd9c2040_1000
- xorg-libx11=1.8.4=h0b41bf4_0
- xorg-libxau=1.0.9=h7f98852_0
- xorg-libxdmcp=1.1.3=h7f98852_0
- xorg-libxext=1.3.4=h0b41bf4_2
- xorg-libxrender=0.9.10=h7f98852_1003
- xorg-renderproto=0.11.1=h7f98852_1002
- xorg-xextproto=7.3.0=h0b41bf4_1003
- xorg-xproto=7.0.31=h7f98852_1007
- xz=5.2.6=h166bdaf_0
- zipp=3.15.0=pyhd8ed1ab_0
- zlib=1.2.13=h166bdaf_4
- zstd=1.5.2=h3eb15da_6
prefix: /PATH/miniconda/envs/songbird_env2
Instead of using our HPCC, I tried installing songbird in a new environment in my personal computer (macOS) using mamba create -n songbird_env2 songbird "pandas>=0.18.0,<1" -c conda-forge
and I am getting a different error here.
After running:
songbird multinomial\
--input-biom feature-table.biom\
--metadata-file POSTPARTUM_mapping_sample_key.txt\
--formula "OBS+Class+TRT+Cow_ID+Site+Cycling+P4" \
--epochs 10000 \
--differential-prior 0.5 \
--summary-interval 1 \
--summary-dir results
I get:
Traceback (most recent call last):
File "/Users/conda/envs/songbird_env2/bin/songbird", line 8, in <module>
from songbird.multinomial import MultRegression
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/songbird/multinomial.py", line 3, in <module>
from tensorflow.contrib.distributions import Multinomial, Normal
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow/__init__.py", line 50, in __getattr__
module = self._load()
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow/__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "/Users/conda/envs/songbird_env2/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_core/contrib/__init__.py", line 39, in <module>
from tensorflow.contrib import compiler
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_core/contrib/compiler/__init__.py", line 21, in <module>
from tensorflow.contrib.compiler import jit
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_core/contrib/compiler/__init__.py", line 22, in <module>
from tensorflow.contrib.compiler import xla
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_core/contrib/compiler/xla.py", line 22, in <module>
from tensorflow.python.estimator import model_fn as model_fn_lib
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_core/python/estimator/model_fn.py", line 26, in <module>
from tensorflow_estimator.python.estimator import model_fn
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_estimator/__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1 import estimator
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_estimator/_api/v1/estimator/__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1.estimator import experimental
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_estimator/_api/v1/estimator/experimental/__init__.py", line 10, in <module>
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/canned/dnn.py", line 27, in <module>
from tensorflow_estimator.python.estimator import estimator
File "/Users/conda/envs/songbird_env2/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 36, in <module>
from tensorflow.python.profiler import trace
ImportError: cannot import name 'trace' from 'tensorflow.python.profiler' (/Users/songbird_env2/lib/python3.7/site-packages/tensorflow_core/python/profiler/__init__.py)
Hi @pyjm,
Here are a few steps you can try to fix this; I'm separating my comment into sections to make it more readable. The first four apply to the HPCC that I think you've been using for this issue so far; the last is an idea for your personal computer's installation.
I tried running
mamba create -n songbird_env2 songbird "pandas>=0.18.0,<1" -c conda-forge
but I am getting the same error. Could it be that something is wrong with my .biom file?
Just to make sure we're on the same page with regards to what "the same error" is -- to clarify, mamba is able to successfully create the songbird_env2
environment and you are able to activate this environment, but upon running Songbird you still get an error that ends with the following message? Let us know if the error changed.
mat = [pd.SparseSeries(v.toarray().ravel()) for v in self.matrix_data]
TypeError: object() takes no parameters
Could it be that something is wrong with my .biom file?
It's possible, but I think it is more likely that something is going wrong in your conda environments / with conda in general on your system. You can check this by downloading the redsea.biom
and redsea_metadata.txt
files from Songbird's GitHub repository, and then running the following command from the same directory to which you downloaded these files:
songbird multinomial --input-biom data/redsea/redsea.biom --metadata-file data/redsea/redsea_metadata.txt --formula "Oxygen"
If this command succeeds, then we know that your BIOM file is the problem; if this command gives you the same error, then we know that the problem isn't with your BIOM file.
I copied the dependencies in the output of your conda env export
command from this comment, created a new conda environment from them (I had to remove a few unrelated dependencies that made mamba complain, e.g. pulseaudio
, libsystemd
, matplotlib
), and verified that this environment was able to run Songbird without problems. I'm attaching a copy of this environment YML below.
It's a bit of a long shot, but you may want to try:
working-env.txt
to working-env.yml
(sorry, GitHub won't let me upload files that end in .yml
...),mamba env create -f working-env.yml
,pyjm
, so you can just run conda activate pyjm
) and then try running Songbird (either on your dataset or the redsea dataset from above)If you get the same error when running Songbird as before, then I think this proves that something is going wrong with conda on your system.
This idea is more cumbersome than the previous ideas, but I suspect it might help if you still have problems:
qiime songbird multinomial
to see if it runs successfully or still gives you an error)If installing even QIIME 2 doesn't work on your system, then this is probably a problem with your system's conda installation or with the system itself. As a "nuclear option," I'd bet that installing QIIME 2 on your macOS system should allow you to use Songbird through it -- Songbird and QIIME 2 have been used together extensively before.
This error message suggests that you may have an incorrect TensorFlow version (outside of the range [1.15, 2)
) present in this environment, which is strange because installing Songbird should have installed a TensorFlow version within this range. You can check which TensorFlow version is installed by running conda list | grep tensorflow
(or you can use pip list | grep tensorflow
, but I think you should see mostly the same results).
If the TensorFlow version installed is indeed incorrect (< 1.15 or ≥ 2 -- probably it'll be ≥ 2), then you can try to downgrade it to e.g. 1.15 -- but this may leave other dependencies in your environment still broken. An alternative solution is creating a new conda environment without Songbird, then installing Songbird into this environment using pip
:
mamba create -n songbird_env3 "pandas>=0.18.0,<1" pip
conda activate songbird_env3
pip install songbird
I think this should work?
Anyway, you don't have to try all of these steps, but I suspect that at least Step 4 or Step 5 should fix your problem. The other ones will mostly be helpful for debugging :) Thanks!
@fedarko and @mortonjt
Thank you both very much for taking the time to help me with this issue.
I downloaded the latest Miniconda version released on April 24, 2023 and reinstalled songbird with mamba create -n songbird_env2 songbird "pandas>=0.18.0,<1" -c conda-forge
and everything seems to be working well now.
I am excited to process my data using Songbird.
Thanks again for your help!
Hi @mortonjt ,
I hope all is well!
I am having trouble running the standalone version of Songbird. Please see below my code and the error message I am getting.
Would love to hear your thoughts on what could be going wrong here.
Thank you so much!!
And I am getting the following error: