Kari-Genomics-Lab / iDeLUCS

Source code for iDeLUCS. An interactive deep-learning based tool for clustering of genomic sequences
MIT License
13 stars 1 forks source link

Installation error: neither 'setup.py' nor 'pyproject.toml' found #14

Open timyerg opened 7 months ago

timyerg commented 7 months ago

Dear developers, Thank you for the tool. I am trying to add this tool to my pipeline and for it I need to install it inside of conda environment. I tried to install it directly from pip and got the error:

pip install idelucs
Collecting idelucs
  Downloading idelucs-1.2.5.tar.gz (20 kB)
  Installing build dependencies ... |  
|  
done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [49 lines of output]
      /tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py:76: _MissingDynamic: `readme` defined outside of `pyproject.toml` is ignored.
      !!

              ********************************************************************************
              The following seems to be defined outside of `pyproject.toml`:

              `readme = 'Deep-learning based tool for clustering genomic sequences'`

              According to the spec (see the link below), however, setuptools CANNOT
              consider this value unless `readme` is listed as `dynamic`.

              https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table

              To prevent this problem, you can list `readme` under `dynamic` or alternatively
              remove the `[project]` table from your file and rely entirely on other means of
              configuration.
              ********************************************************************************

      !!
        _handle_missing_dynamic(dist, project_table)
      Traceback (most recent call last):
        File "/home/user/anaconda3/envs/MyEnv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/user/anaconda3/envs/MyEnv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/user/anaconda3/envs/MyEnv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 3, in <module>
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 104, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 159, in setup
          dist.parse_config_files()
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 631, in parse_config_files
          pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py", line 69, in apply_configuration
          return _apply(dist, config, filepath)
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 57, in apply
          _apply_project_table(dist, config, root_dir)
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 83, in _apply_project_table
          corresp(dist, value, root_dir)
        File "/tmp/pip-build-env-3448258d/overlay/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 164, in _long_description
          file = val.get("file") or []
      AttributeError: 'NoneType' object has no attribute 'get'
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

Then I tried to install it from cloned repo:

git clone https://github.com/millanp95/iDeLUCS.git iDeLUCS
cd iDelUCS
python setup.py build_ext --inplace
running build_ext
building 'idelucs.kmers' extension
creating build
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/idelucs
gcc -pthread -B /home/user/anaconda3/envs/NaMeco/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/user/anaconda3/envs/MyEnv/include -fPIC -O2 -isystem /home/meco/anaconda3/envs/MyEnv/include -fPIC -I/home/user/anaconda3/envs/MyEnv/include/python3.10 -c idelucs/kmers.c -o build/temp.linux-x86_64-cpython-310/idelucs/kmers.o
cc1: fatal error: idelucs/kmers.c: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1

Any suggestions how to install it within conda environment?

PS: Ubuntu 22.4, Anaconda3.

Best,

zht23333 commented 6 months ago

Hey, bro, have you solved it?I'm having the same issue as you.

timyerg commented 6 months ago

AttributeError: 'NoneType' object has no attribute 'get'

Nope, looking for alternatives/waiting for solution.

zht23333 commented 6 months ago

T^T

timyerg commented 6 months ago

Managed to install it from the source.

How to install:

git clone https://github.com/millanp95/iDeLUCS.git iDeLUCS
cd iDeLUCS
python setup.py build_ext --inplace
pip install -e .

How it is written in instructions (just different "L" while cd):

git clone https://github.com/millanp95/iDeLUCS.git iDeLUCS
cd iDelUCS
python setup.py build_ext --inplace
pip install -e .

Please correct the instructions on the main page.

zht23333 commented 6 months ago

tks. Did you use Linux?

timyerg commented 6 months ago

Ubuntu 22.04, Anaconda3

millanp95 commented 6 months ago

Hello. I looked into this, and it is due to an update in setuptools it should be fine if you clone the repo and build it from the source.

I cannot fix the problem in the next week but I have put together a Notebook with the provisional workaround https://colab.research.google.com/drive/1g-I5CeshpDYGfgVHNlx6w5YlEGbI0BbK?usp=sharing