Installing MACS2 gives an error that install_requires must be a string and etuptools.installer and fetch_build_eggs are deprecated

When installing MACS2, the error “install_requires must be a string or list of strings containing valid project/version requirement specifiers” and “setuptools.installer and fetch_build_eggs are deprecated” is reported

Software official website: https://hbctraining.github.io/Intro-to-ChIPseq/lessons/05_peak_calling_macs.html

  1. How should I put it, the software is not big, but a lot of errors were reported when installing it! At first, it was installed with pip install, and the error was reported as follows

pip install --upgrade macs2
# command run log
Collecting macs2
  Using cached MACS2-2.2.7.1.tar.gz (2.1 MB)
  Installing build dependencies... done
  Getting requirements to build wheel... done
  Preparing metadata (pyproject. toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      Requirement already satisfied: numpy>=1.17 in /tmp/pip-build-env-jv0u2l_s/overlay/lib/python3.8/site-packages (1.24.2)
      error in MACS2 setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after name and no valid version specifier)
          numpy>=>=1.17
               ^
      [end of output]

After that, I also tried conda install macs2, and the same error was reported.

  1. In the end, I had to choose the source code installation method, but this method requires manual installation of dependent packages

Source code download address PyPi https://pypi.org/project/MACS2/, unzip and enter the folder

How to create a virtual environment

# First create a virtual environment and install it in the virtual environment
# Remember to download the latest version
wget https://files.pythonhosted.org/packages/e2/61/85d30ecdd34525113e28cb0c5a9f393f93578165f8d848be5925c0208dfb/MACS2-2.2.7.1.tar.gz
tar zxvf MACS2-2.2.7.1.tar.gz
cd MACS2-2.2.7.1
  1. INSTALL.md is software installation information, README.md is software usage information

  1. Check whether the installation environment and dependent packages are normal. It is found that umap-learn, scanpy, and anndata need to be installed manually. These packages can be installed through pip install, which is relatively smooth

python setup.py --help
# run log
Collecting numpy>=1.17
  Using cached numpy-1.24.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Installing collected packages: numpy
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behavior is the source of the following dependency conflicts.
umap-learn 0.5.2 requires numba>=0.49, which is not installed.
umap-learn 0.5.2 requires scikit-learn>=0.22, which is not installed.
umap-learn 0.5.2 requires scipy>=1.0, which is not installed.
umap-learn 0.5.2 requires tqdm, which is not installed.
scanpy 1.8.2 requires h5py>=2.10.0, which is not installed.
scanpy 1.8.2 requires joblib, which is not installed.
scanpy 1.8.2 requires matplotlib>=3.1.2, which is not installed.
scanpy 1.8.2 requires networkx>=2.3, which is not installed.
scanpy 1.8.2 requires numba>=0.41.0, which is not installed.
scanpy 1.8.2 requires packaging, which is not installed.
scanpy 1.8.2 requires pandas>=0.21, which is not installed.
scanpy 1.8.2 requires patsy, which is not installed.
scanpy 1.8.2 requires scikit-learn>=0.22, which is not installed.
scanpy 1.8.2 requires scipy>=1.4, which is not installed.
scanpy 1.8.2 requires seaborn, which is not installed.
scanpy 1.8.2 requires statsmodels>=0.10.0rc2, which is not installed.
scanpy 1.8.2 requires tables, which is not installed.
scanpy 1.8.2 requires tqdm, which is not installed.
anndata 0.7.8 requires h5py, which is not installed.
anndata 0.7.8 requires packaging>=20, which is not installed.
anndata 0.7.8 requires pandas>=1.1.1, which is not installed.
anndata 0.7.8 requires scipy>1.4, which is not installed.
anndata 0.7.8 requires xlrd<2.0, which is not installed.

# Install umap-learn, scanpy, anndata
pip install umap-learn
pip install scanpy
pip install anndata
  1. Check the installation environment and dependent packages again, and the error is still reported. The error message shows: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. It indicates that there may be a problem with the setuptools package, and then I tried uninstalling and reinstalling setuptools , but still doesn’t solve the problem

python setup.py --help
Requirement already satisfied: numpy>=1.17 in /home/hanjiangang/anaconda3/envs/scenic/lib/python3.8/site-packages (1.23.5)
/home/hanjiangang/anaconda3/envs/scenic/lib/python3.8/site-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If You are using pip, you can try `pip install --use-pep517`.
  dist.fetch_build_eggs(dist.setup_requires)
  1. Later, I found out that other people have encountered similar errors. It may be because of the mismatch of the setuptools version (I am using the latest version), so I installed a lower version of setuptools. At the same time, I checked the setuptools official website and found that it is recommended to install the build module. This module can provide A more simple and lightweight installation method.

pip install --upgrade 'setuptools<44'
pip install --upgrade build
  1. I don’t know which of these two modules helped solve the problem, recheck the installation environment and dependent packages, it’s normal

python setup.py --help
# command log
Requirement already satisfied: numpy>=1.17 in /home/hanjiangang/anaconda3/envs/scenic/lib/python3.8/site-packages (1.23.5)
Common commands: (see '--help-commands' for more)

  setup.py build will build the package underneath 'build/'
  setup.py install will install the package

Global options:
  --verbose (-v) run verbosely (default)
  --quiet (-q) run quietly (turns verbosity off)
  --dry-run (-n) don't actually do anything
  --help (-h) show detailed help message
  --no-user-cfg ignore pydistutils.cfg in your home directory
  --command-packages list of packages that provide distutils commands
  1. Installed by python install, if it is installed by pip install ., an error will still be reported

Finally successfully installed

python setup.py install
# command log
Requirement already satisfied: numpy>=1.17 in /home/hanjiangang/anaconda3/envs/scenic/lib/python3.8/site-packages (1.23.5)
running install
running bdist_egg

pip show macs2
# command log
Name: MACS2
Version: 2.2.7.1
Summary: Model Based Analysis for ChIP-Seq data
Home-page: http://github.com/taoliu/MACS/
Author: Tao Liu
Author-email: [email protected]
License: UNKNOWN
Location: /home/hanjiangang/anaconda3/envs/scenic/lib/python3.8/site-packages/MACS2-2.2.7.1-py3.8-linux-x86_64.egg
Requires: numpy

python
import MACS2

The knowledge points of the article match the official knowledge files, and you can further learn relevant knowledgePython entry skill treeHomepageOverview 258479 people are studying systematically