mdmparis / defense-finder

Systematic search of all known anti-phage systems.
GNU General Public License v3.0
76 stars 13 forks source link

Installation error on MacOS Big Sur #1

Closed camilogarciabotero closed 3 years ago

camilogarciabotero commented 3 years ago

Hi @AudeBer and @Alexandre-Herve,

Thanks for working on DefenseFinder. I was quite eager to play around with it, so I tried to install it using the instructions on the README (i.e. conda create -n defensefinder python pip ; conda activate defense finder; pip install mdmparis-defense-finder)

and got the following error:

(defensefinder)  camilogarcia@pro  ~  pip install mdmparis-defense-finder
Collecting mdmparis-defense-finder
  Downloading mdmparis_defense_finder-0.0.11-py3-none-any.whl (19 kB)
Collecting macsyfinder
  Downloading macsyfinder-2.0rc4.tar.gz (36.2 MB)
     |████████████████████████████████| 36.2 MB 621 kB/s 
Collecting click
  Downloading click-8.0.1-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 1.6 MB/s 
Collecting colorlog
  Downloading colorlog-6.4.1-py2.py3-none-any.whl (11 kB)
Collecting pyyaml
  Downloading PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl (259 kB)
     |████████████████████████████████| 259 kB 2.0 MB/s 
Collecting packaging
  Downloading packaging-21.0-py3-none-any.whl (40 kB)
     |████████████████████████████████| 40 kB 2.3 MB/s 
Collecting networkx
  Downloading networkx-2.6.2-py3-none-any.whl (1.9 MB)
     |████████████████████████████████| 1.9 MB 1.2 MB/s 
Collecting pandas
  Downloading pandas-1.3.2-cp39-cp39-macosx_10_9_x86_64.whl (11.6 MB)
     |████████████████████████████████| 11.6 MB 7.0 MB/s 
Collecting pyparsing>=2.0.2
  Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
     |████████████████████████████████| 67 kB 6.2 MB/s 
Collecting numpy>=1.17.3
  Downloading numpy-1.21.2-cp39-cp39-macosx_10_9_x86_64.whl (17.0 MB)
     |████████████████████████████████| 17.0 MB 2.5 MB/s 
Collecting pytz>=2017.3
  Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB)
Collecting python-dateutil>=2.7.3
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: macsyfinder
  Building wheel for macsyfinder (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Applications/miniconda3/envs/defensefinder/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py'"'"'; __file__='"'"'/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-wheel-w0l1zg0m
       cwd: /private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/
  Complete output (71 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/macsypy
  copying macsypy/package.py -> build/lib/macsypy
  copying macsypy/system.py -> build/lib/macsypy
  copying macsypy/config.py -> build/lib/macsypy
  copying macsypy/error.py -> build/lib/macsypy
  copying macsypy/solution.py -> build/lib/macsypy
  copying macsypy/database.py -> build/lib/macsypy
  copying macsypy/profile.py -> build/lib/macsypy
  copying macsypy/__init__.py -> build/lib/macsypy
  copying macsypy/model.py -> build/lib/macsypy
  copying macsypy/utils.py -> build/lib/macsypy
  copying macsypy/cluster.py -> build/lib/macsypy
  copying macsypy/gene.py -> build/lib/macsypy
  copying macsypy/search_genes.py -> build/lib/macsypy
  copying macsypy/definition_parser.py -> build/lib/macsypy
  copying macsypy/report.py -> build/lib/macsypy
  copying macsypy/serialization.py -> build/lib/macsypy
  copying macsypy/registries.py -> build/lib/macsypy
  copying macsypy/model_conf_parser.py -> build/lib/macsypy
  copying macsypy/hit.py -> build/lib/macsypy
  creating build/lib/macsypy/scripts
  copying macsypy/scripts/macsydata.py -> build/lib/macsypy/scripts
  copying macsypy/scripts/__init__.py -> build/lib/macsypy/scripts
  copying macsypy/scripts/macsyfinder.py -> build/lib/macsypy/scripts
  copying macsypy/scripts/macsyprofile.py -> build/lib/macsypy/scripts
  installing to build/bdist.macosx-10.9-x86_64/wheel
  running install
  running install_lib
  Traceback (most recent call last):
    File "/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py", line 115, in get_install_data_dir
      from pip.locations import distutils_scheme
  ModuleNotFoundError: No module named 'pip.locations'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py", line 233, in <module>
      setup(name='macsyfinder',
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 335, in run
      self.run_command('install')
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/site-packages/setuptools/command/install.py", line 61, in run
      return orig.install.run(self)
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/command/install.py", line 558, in run
      self.run_command(cmd_name)
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py", line 68, in run
      subst_file(_file, {'MACSYDATA': os.path.join(get_install_data_dir(inst), 'macsyfinder'),
    File "/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py", line 121, in get_install_data_dir
      from pip._internal.locations import distutils_scheme
  ImportError: cannot import name 'distutils_scheme' from 'pip._internal.locations' (/Applications/miniconda3/envs/defensefinder/lib/python3.9/site-packages/pip/_internal/locations/__init__.py)
  ----------------------------------------
  ERROR: Failed building wheel for macsyfinder
  Running setup.py clean for macsyfinder
Failed to build macsyfinder
Installing collected packages: six, pytz, python-dateutil, pyparsing, numpy, pyyaml, pandas, packaging, networkx, colorlog, macsyfinder, click, mdmparis-defense-finder
    Running setup.py install for macsyfinder ... error
    ERROR: Command errored out with exit status 1:
     command: /Applications/miniconda3/envs/defensefinder/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py'"'"'; __file__='"'"'/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-record-4l1s3svf/install-record.txt --single-version-externally-managed --compile --install-headers /Applications/miniconda3/envs/defensefinder/include/python3.9/macsyfinder
         cwd: /private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/
    Complete output (63 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/macsypy
    copying macsypy/package.py -> build/lib/macsypy
    copying macsypy/system.py -> build/lib/macsypy
    copying macsypy/config.py -> build/lib/macsypy
    copying macsypy/error.py -> build/lib/macsypy
    copying macsypy/solution.py -> build/lib/macsypy
    copying macsypy/database.py -> build/lib/macsypy
    copying macsypy/profile.py -> build/lib/macsypy
    copying macsypy/__init__.py -> build/lib/macsypy
    copying macsypy/model.py -> build/lib/macsypy
    copying macsypy/utils.py -> build/lib/macsypy
    copying macsypy/cluster.py -> build/lib/macsypy
    copying macsypy/gene.py -> build/lib/macsypy
    copying macsypy/search_genes.py -> build/lib/macsypy
    copying macsypy/definition_parser.py -> build/lib/macsypy
    copying macsypy/report.py -> build/lib/macsypy
    copying macsypy/serialization.py -> build/lib/macsypy
    copying macsypy/registries.py -> build/lib/macsypy
    copying macsypy/model_conf_parser.py -> build/lib/macsypy
    copying macsypy/hit.py -> build/lib/macsypy
    creating build/lib/macsypy/scripts
    copying macsypy/scripts/macsydata.py -> build/lib/macsypy/scripts
    copying macsypy/scripts/__init__.py -> build/lib/macsypy/scripts
    copying macsypy/scripts/macsyfinder.py -> build/lib/macsypy/scripts
    copying macsypy/scripts/macsyprofile.py -> build/lib/macsypy/scripts
    running install_lib
    Traceback (most recent call last):
      File "/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py", line 115, in get_install_data_dir
        from pip.locations import distutils_scheme
    ModuleNotFoundError: No module named 'pip.locations'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py", line 233, in <module>
        setup(name='macsyfinder',
      File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/command/install.py", line 558, in run
        self.run_command(cmd_name)
      File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Applications/miniconda3/envs/defensefinder/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py", line 68, in run
        subst_file(_file, {'MACSYDATA': os.path.join(get_install_data_dir(inst), 'macsyfinder'),
      File "/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py", line 121, in get_install_data_dir
        from pip._internal.locations import distutils_scheme
    ImportError: cannot import name 'distutils_scheme' from 'pip._internal.locations' (/Applications/miniconda3/envs/defensefinder/lib/python3.9/site-packages/pip/_internal/locations/__init__.py)
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/miniconda3/envs/defensefinder/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py'"'"'; __file__='"'"'/private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-install-1vrlc87b/macsyfinder_29c221db0ad549728f86a9a4cae0a170/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/yv/v64v7c0j2zg80406x2ny32w00000gn/T/pip-record-4l1s3svf/install-record.txt --single-version-externally-managed --compile --install-headers /Applications/miniconda3/envs/defensefinder/include/python3.9/macsyfinder Check the logs for full command output.

It seems to be a problem with macsyfinder installation. I also installed hmmer v3.3.2 in the path before reinstalling DefenseFinder and got the same error.

Here is a screenshot of my pc setup:

![Uploading Screen Shot 2021-09-03 at 4.35.01 PM.png…]()

And the current programs on the conda env:

(defensefinder)  camilogarcia@pro  ~  conda list
# packages in environment at /Applications/miniconda3/envs/defensefinder:
#
# Name                    Version                   Build  Channel
ca-certificates           2021.5.30            h033912b_0    conda-forge
colorlog                  6.4.1                    pypi_0    pypi
hmmer                     3.3.2                h589c0e0_1    bioconda
libcxx                    12.0.1               habf9029_0    conda-forge
libffi                    3.3                  h046ec9c_2    conda-forge
ncurses                   6.2                  h2e338ed_4    conda-forge
networkx                  2.6.2                    pypi_0    pypi
numpy                     1.21.2                   pypi_0    pypi
openssl                   1.1.1l               h0d85af4_0    conda-forge
packaging                 21.0                     pypi_0    pypi
pandas                    1.3.2                    pypi_0    pypi
pip                       21.2.4             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7                    pypi_0    pypi
python                    3.9.7           hd187cdc_0_cpython    conda-forge
python-dateutil           2.8.2                    pypi_0    pypi
python_abi                3.9                      2_cp39    conda-forge
pytz                      2021.1                   pypi_0    pypi
pyyaml                    5.4.1                    pypi_0    pypi
readline                  8.1                  h05e3726_0    conda-forge
setuptools                57.4.0           py39h6e9494a_0    conda-forge
six                       1.16.0                   pypi_0    pypi
sqlite                    3.36.0               h23a322b_0    conda-forge
tk                        8.6.11               h5dbffcc_1    conda-forge
tzdata                    2021a                he74cb21_1    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xz                        5.2.5                haf1e3a3_1    conda-forge
zlib                      1.2.11            h7795811_1010    conda-forge

And the pip list:

(defensefinder)  camilogarcia@pro  ~  pip list                           
Package         Version
--------------- -------
colorlog        6.4.1
networkx        2.6.2
numpy           1.21.2
packaging       21.0
pandas          1.3.2
pip             21.2.4
pyparsing       2.4.7
python-dateutil 2.8.2
pytz            2021.1
PyYAML          5.4.1
setuptools      57.4.0
six             1.16.0
wheel           0.37.0

I'll be glad if you can help me with the installation process on my machine. Thanks in advance. Camilo

Alexandre-Herve commented 3 years ago

Hi Camilo, thanks for reaching out. Could you please tell me which pip version you are using? (pip --version) Those errors might be caused by an outdated pip version.

camilogarciabotero commented 3 years ago

Hi @Alexandre-Herve,

I'm using pip v21.2.4

ZarulHanifah commented 3 years ago

Yeah, I experienced the same problem. When I used pip 20.3.3, problem solved. But then another problem; AttributeError: module 'colorlog' has no attribute 'logging'

Alexandre-Herve commented 3 years ago

@ZarulHanifah check this: https://github.com/mdmparis/defense-finder/issues/2

Alexandre-Herve commented 3 years ago

@camilogarciabotero does using pip 20.3.3 solve your problem?

camilogarciabotero commented 3 years ago

Hi @Alexandre-Herve

Yes. I reinstalled it with pip=20.3.3 and the installation was successful. Thanks.