giotto-ai / giotto-tda

A high-performance topological machine learning toolbox in Python
https://giotto-ai.github.io/gtda-docs
Other
830 stars 171 forks source link

I can not install giotto. #136

Closed MINIMALaq closed 4 years ago

MINIMALaq commented 4 years ago

I a, using ubuntu and in python3.5 and python 3.7 I can not install giotto. How can I install it simply?

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-xsyfhd6s/giotto-learn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-blrgq5ld/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-xsyfhd6s/giotto-learn/

ulupo commented 4 years ago

Hi @MINIMALaq, thanks for getting in touch! Are you trying to install from source (after cloning the repo)? It looks like you are experiencing compile errors which may be to do with our C++ dependencies. These should not occur if you simply pip install giotto-learn, which will attempt to fetch pre-compiled binaries for your system from PyPI.

Having said that, if you'd really like to install from source, may I ask if you followed all the steps in the "Contributing" section in the readme?

MINIMALaq commented 4 years ago

No, I tested pip install method on 2 Linux distros and both throw the same error.

ulupo commented 4 years ago

Thanks for your reply. So if I understand correctly you did not clone or copy the repo, and just attempted pip install giotto-learn.

Our wheels for Linux are compiled using a "manylinux2010" docker image (see e.g. https://discuss.python.org/t/manylinux2010-docker-image-now-available/147) for compatibility with almost (but not all, see https://www.python.org/dev/peps/pep-0571/) all distribution versions released since 2010.

Which Linux distributions were you working on?

MINIMALaq commented 4 years ago

Yes, I just used pip install giotto-learn. I tried it on Ubuntu Linux 16:04 and 19:10. What do I must do for running wheels correctly?

ulupo commented 4 years ago

Ubuntu 16:04 is precisely the Linux distribution on which our CI pipelines run, so we are pretty confident giotto-learn can be made to work there. The error code you showed is a bit cryptic, but could you please attempt to follow the steps in the top answer here: https://stackoverflow.com/questions/14296531/what-does-error-option-single-version-externally-managed-not-recognized-ind (i.e. upgrading setuptools and wheel if necessary)?

MINIMALaq commented 4 years ago

I used python3.5 and python3.7 on ubuntu 16.04 and both give me the same error.

minimal@ization ~> virtualenv -p python3.7 env
Running virtualenv with interpreter /usr/local/bin/python3.7
Already using interpreter /usr/local/bin/python3.7
Using base prefix '/usr/local'
New python executable in /home/minimal/env/bin/python3.7
Also creating executable in /home/minimal/env/bin/python
Installing setuptools, pip, wheel...
done.
minimal@ization ~> sudo pip3 install -U setuptools
The directory '/home/minimal/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/minimal/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: setuptools in /usr/local/lib/python3.5/dist-packages (42.0.2)
minimal@ization ~> sudo pip3 install -U wheel
The directory '/home/minimal/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/minimal/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: wheel in /usr/local/lib/python3.5/dist-packages (0.33.6)
minimal@ization ~> sudo pip3 install -U giotto-learn
The directory '/home/minimal/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/minimal/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting giotto-learn
  Downloading https://files.pythonhosted.org/packages/f4/23/d6573dd1bb7fa91373a482691306a3964bfbd36dca90a1f2569266baf37b/giotto-learn-0.1.3.tar.gz (60kB)
    100% |████████████████████████████████| 61kB 120kB/s 
Requirement already satisfied, skipping upgrade: numpy>=1.17.0 in /usr/local/lib/python3.5/dist-packages (from giotto-learn) (1.18.0)
Requirement already satisfied, skipping upgrade: scipy>=0.17.0 in /usr/local/lib/python3.5/dist-packages (from giotto-learn) (1.1.0)
Requirement already satisfied, skipping upgrade: scikit-learn>=0.21.3 in /usr/local/lib/python3.5/dist-packages (from giotto-learn) (0.22)
Requirement already satisfied, skipping upgrade: joblib>=0.11 in /usr/local/lib/python3.5/dist-packages (from giotto-learn) (0.14.1)
Installing collected packages: giotto-learn
  Running setup.py install for giotto-learn ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-2x2_x831/giotto-learn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-kogeypk2/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/giotto
    copying giotto/pipeline.py -> build/lib.linux-x86_64-3.5/giotto
    copying giotto/base.py -> build/lib.linux-x86_64-3.5/giotto
    copying giotto/_version.py -> build/lib.linux-x86_64-3.5/giotto
    copying giotto/__init__.py -> build/lib.linux-x86_64-3.5/giotto
    creating build/lib.linux-x86_64-3.5/giotto/meta_transformers
    copying giotto/meta_transformers/features.py -> build/lib.linux-x86_64-3.5/giotto/meta_transformers
    copying giotto/meta_transformers/__init__.py -> build/lib.linux-x86_64-3.5/giotto/meta_transformers
    creating build/lib.linux-x86_64-3.5/giotto/externals
    copying giotto/externals/__init__.py -> build/lib.linux-x86_64-3.5/giotto/externals
    creating build/lib.linux-x86_64-3.5/giotto/time_series
    copying giotto/time_series/features.py -> build/lib.linux-x86_64-3.5/giotto/time_series
    copying giotto/time_series/preprocessing.py -> build/lib.linux-x86_64-3.5/giotto/time_series
    copying giotto/time_series/target.py -> build/lib.linux-x86_64-3.5/giotto/time_series
    copying giotto/time_series/embedding.py -> build/lib.linux-x86_64-3.5/giotto/time_series
    copying giotto/time_series/multivariate.py -> build/lib.linux-x86_64-3.5/giotto/time_series
    copying giotto/time_series/__init__.py -> build/lib.linux-x86_64-3.5/giotto/time_series
    creating build/lib.linux-x86_64-3.5/giotto/homology
    copying giotto/homology/point_clouds.py -> build/lib.linux-x86_64-3.5/giotto/homology
    copying giotto/homology/consistent.py -> build/lib.linux-x86_64-3.5/giotto/homology
    copying giotto/homology/_utils.py -> build/lib.linux-x86_64-3.5/giotto/homology
    copying giotto/homology/__init__.py -> build/lib.linux-x86_64-3.5/giotto/homology
    creating build/lib.linux-x86_64-3.5/giotto/tests
    copying giotto/tests/test_pipeline.py -> build/lib.linux-x86_64-3.5/giotto/tests
    copying giotto/tests/__init__.py -> build/lib.linux-x86_64-3.5/giotto/tests
    creating build/lib.linux-x86_64-3.5/giotto/utils
    copying giotto/utils/validation.py -> build/lib.linux-x86_64-3.5/giotto/utils
    copying giotto/utils/testing.py -> build/lib.linux-x86_64-3.5/giotto/utils
    copying giotto/utils/__init__.py -> build/lib.linux-x86_64-3.5/giotto/utils
    creating build/lib.linux-x86_64-3.5/giotto/graphs
    copying giotto/graphs/kneighbors.py -> build/lib.linux-x86_64-3.5/giotto/graphs
    copying giotto/graphs/geodesic_distance.py -> build/lib.linux-x86_64-3.5/giotto/graphs
    copying giotto/graphs/transition.py -> build/lib.linux-x86_64-3.5/giotto/graphs
    copying giotto/graphs/__init__.py -> build/lib.linux-x86_64-3.5/giotto/graphs
    creating build/lib.linux-x86_64-3.5/giotto/diagrams
    copying giotto/diagrams/features.py -> build/lib.linux-x86_64-3.5/giotto/diagrams
    copying giotto/diagrams/distance.py -> build/lib.linux-x86_64-3.5/giotto/diagrams
    copying giotto/diagrams/_utils.py -> build/lib.linux-x86_64-3.5/giotto/diagrams
    copying giotto/diagrams/preprocessing.py -> build/lib.linux-x86_64-3.5/giotto/diagrams
    copying giotto/diagrams/_metrics.py -> build/lib.linux-x86_64-3.5/giotto/diagrams
    copying giotto/diagrams/__init__.py -> build/lib.linux-x86_64-3.5/giotto/diagrams
    creating build/lib.linux-x86_64-3.5/giotto/meta_transformers/tests
    copying giotto/meta_transformers/tests/test_features.py -> build/lib.linux-x86_64-3.5/giotto/meta_transformers/tests
    copying giotto/meta_transformers/tests/__init__.py -> build/lib.linux-x86_64-3.5/giotto/meta_transformers/tests
    creating build/lib.linux-x86_64-3.5/giotto/externals/python
    copying giotto/externals/python/ripser_interface.py -> build/lib.linux-x86_64-3.5/giotto/externals/python
    copying giotto/externals/python/cubical_complex_interface.py -> build/lib.linux-x86_64-3.5/giotto/externals/python
    copying giotto/externals/python/simplex_tree_interface.py -> build/lib.linux-x86_64-3.5/giotto/externals/python
    copying giotto/externals/python/__init__.py -> build/lib.linux-x86_64-3.5/giotto/externals/python
    creating build/lib.linux-x86_64-3.5/giotto/time_series/tests
    copying giotto/time_series/tests/test_multivariate.py -> build/lib.linux-x86_64-3.5/giotto/time_series/tests
    copying giotto/time_series/tests/test_preprocessing.py -> build/lib.linux-x86_64-3.5/giotto/time_series/tests
    copying giotto/time_series/tests/test_embedding.py -> build/lib.linux-x86_64-3.5/giotto/time_series/tests
    copying giotto/time_series/tests/__init__.py -> build/lib.linux-x86_64-3.5/giotto/time_series/tests
    creating build/lib.linux-x86_64-3.5/giotto/homology/tests
    copying giotto/homology/tests/test_consistent.py -> build/lib.linux-x86_64-3.5/giotto/homology/tests
    copying giotto/homology/tests/test_point_clouds.py -> build/lib.linux-x86_64-3.5/giotto/homology/tests
    copying giotto/homology/tests/__init__.py -> build/lib.linux-x86_64-3.5/giotto/homology/tests
    creating build/lib.linux-x86_64-3.5/giotto/utils/tests
    copying giotto/utils/tests/test_validation.py -> build/lib.linux-x86_64-3.5/giotto/utils/tests
    copying giotto/utils/tests/__init__.py -> build/lib.linux-x86_64-3.5/giotto/utils/tests
    creating build/lib.linux-x86_64-3.5/giotto/graphs/tests
    copying giotto/graphs/tests/test_geodesic_distance.py -> build/lib.linux-x86_64-3.5/giotto/graphs/tests
    copying giotto/graphs/tests/test_transition.py -> build/lib.linux-x86_64-3.5/giotto/graphs/tests
    copying giotto/graphs/tests/test_kneighbors.py -> build/lib.linux-x86_64-3.5/giotto/graphs/tests
    copying giotto/graphs/tests/__init__.py -> build/lib.linux-x86_64-3.5/giotto/graphs/tests
    creating build/lib.linux-x86_64-3.5/giotto/diagrams/tests
    copying giotto/diagrams/tests/test_distance.py -> build/lib.linux-x86_64-3.5/giotto/diagrams/tests
    copying giotto/diagrams/tests/test_features.py -> build/lib.linux-x86_64-3.5/giotto/diagrams/tests
    copying giotto/diagrams/tests/test_preprocessing.py -> build/lib.linux-x86_64-3.5/giotto/diagrams/tests
    copying giotto/diagrams/tests/__init__.py -> build/lib.linux-x86_64-3.5/giotto/diagrams/tests
    running build_ext
    Traceback (most recent call last):
      File "/tmp/pip-install-2x2_x831/giotto-learn/setup.py", line 80, in run
        out = subprocess.check_output(['cmake', '--version'])
      File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
        **kwargs).stdout
      File "/usr/lib/python3.5/subprocess.py", line 693, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
        restore_signals, start_new_session)
      File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: 'cmake'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-2x2_x831/giotto-learn/setup.py", line 176, in <module>
        cmdclass=dict(build_ext=CMakeBuild))
      File "/usr/local/lib/python3.5/dist-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.5/dist-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
        self.run_command('build')
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-2x2_x831/giotto-learn/setup.py", line 84, in run
        " , ".join(e.name for e in self.extensions))
    RuntimeError: CMake must be installed to build the  following extensions: giotto

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-2x2_x831/giotto-learn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-kogeypk2/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-2x2_x831/giotto-learn/
minimal@ization ~> 
ulupo commented 4 years ago

@MonkeyBreaker, would you be able to have a quick look at this?

MonkeyBreaker commented 4 years ago

Hi @MINIMALaq, Sorry for the late answer, I was on holiday till yesterday. Could you give me the results of the following command: sudo pip3 --version

Then you can run sudo pip3 install --upgrade pip and finally try again to intall giotto-learn: sudo pip3 install -U giotto-learn

If this resolves the problem, seems that the default version of pip3 installed with Ubuntu 16.04, 18.04, 19.04 is too old.

Let me know if this resolves the problem.

Julián

ulupo commented 4 years ago

Perhaps we should ensure a sufficiently recent version of pip is installed by adding an entry to Requirements.txt?

reds-heig commented 4 years ago

Perhaps we should ensure a sufficiently recent version of pip is installed by adding an entry to Requirements.txt?

Well you can update pip when using requirements.txt, but it'll be necessary to test if the following steps (after pip's actions) uses the upgraded version of pip or it continues using the "original" version.

Otherwise, in a Q&A or a troubleshooting document, the user could fix the problem by himself. I don't know what could be the best approach.

Julián

MINIMALaq commented 4 years ago

Thank you @MonkeyBreaker. It works after updating pip3 both in ubuntu 19.10 and ubuntu 16.04.

reds-heig commented 4 years ago

Great ! Thank you for the Feedback.

Julián

ulupo commented 4 years ago

Reopening this so we can keep discussing a possible enhancement of the installation experience, perhaps via checks made in setup.py.

ulupo commented 4 years ago

Closing this as we now recommend upgrading pip and setuptools in README.rst.