Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem of installation in colab #147

Open
ikahbasi opened this issue Feb 26, 2023 · 3 comments
Open

Problem of installation in colab #147

ikahbasi opened this issue Feb 26, 2023 · 3 comments

Comments

@ikahbasi
Copy link

ikahbasi commented Feb 26, 2023

Hello Dr.Mousavi,
I tried to install EQTransformer on the colab in many ways but there were some problems.

First, I tried to install it with the standard pip command:
!pip install EQTransformer
after installation, there isn't the Runtime restart message.
Scound, I tried to download and install it from git by these lines:

!pip install obspy
! git clone https://github.com/smousavi05/EQTransformer
%cd EQTransformer
!pip install -e .

the result was an error message that say:

ERROR: Could not find a version that satisfies the requirement tensorflow-deps==2.9.0 (from eqtransformer) (from versions: none)
ERROR: No matching distribution found for tensorflow-deps==2.9.0

third: I tried to use conda in google colab like this:

!pip install -q condacolab
import condacolab
condacolab.install()
!pip install EQTransformer

the installation was successful but when I imported EQtransformer by:
import EQTransformer
the result was:

ImportError: cannot import name 'multi_gpu_model' from 'keras.utils' (/usr/local/lib/python3.8/site-packages/keras/utils/init.py)

NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.

You can see my work on google colab:
https://colab.research.google.com/drive/1Z9L3V-GNSdHRctMt98-lHiq6gx8UMpm0?usp=share_link

Google (https://colab.research.google.com/drive/1Z9L3V-GNSdHRctMt98-lHiq6gx8UMpm0?usp=share_link)
EQTransformer-installation-test.ipynb
Colaboratory notebook

@smousavi05
Copy link
Owner

Hi @imankahbasi
This is due to the Keras version. You can try this:

!pip uninstall Keras

and then installing a slightly older version Keras 2.2.4 (or 2.3.1):
!pip install keras==2.2.4

Another option is to try installing from the git repo:
pip install git+https://github.com/smousavi05/EQTransformer

@ikahbasi
Copy link
Author

ikahbasi commented Mar 28, 2023

Thank you for your reply.

When I ran this line in colab:
!pip uninstall Keras
The result is:

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting keras==2.2.4
  Downloading Keras-2.2.4-py2.py3-none-any.whl (312 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 312.5/312.5 KB 6.5 MB/s eta 0:00:00
Requirement already satisfied: pyyaml in /usr/local/lib/python3.9/dist-packages (from keras==2.2.4) (6.0)
Collecting keras-applications>=1.0.6
  Downloading Keras_Applications-1.0.8-py3-none-any.whl (50 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.7/50.7 KB 5.1 MB/s eta 0:00:00
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.9/dist-packages (from keras==2.2.4) (1.16.0)
Requirement already satisfied: h5py in /usr/local/lib/python3.9/dist-packages (from keras==2.2.4) (3.8.0)
Requirement already satisfied: scipy>=0.14 in /usr/local/lib/python3.9/dist-packages (from keras==2.2.4) (1.10.1)
Collecting keras-preprocessing>=1.0.5
  Downloading Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.6/42.6 KB 3.2 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.9.1 in /usr/local/lib/python3.9/dist-packages (from keras==2.2.4) (1.22.4)
Installing collected packages: keras-preprocessing, keras-applications, keras
  Attempting uninstall: keras
    Found existing installation: keras 2.11.0
    Uninstalling keras-2.11.0:
      Successfully uninstalled keras-2.11.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 2.11.0 requires keras<2.12,>=2.11.0, but you have keras 2.2.4 which is incompatible.
Successfully installed keras-2.2.4 keras-applications-1.0.8 keras-preprocessing-1.1.2

Then, when I ran this line:
!pip install EQTransformer
It remains on the thigh and freezes.

+=======================================================================================

And when I ran this line in colab:
!pip install git+https://github.com/smousavi05/EQTransformer
The result is:

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting git+https://github.com/smousavi05/EQTransformer
  Cloning https://github.com/smousavi05/EQTransformer to /tmp/pip-req-build-bqxys18v
  Running command git clone --filter=blob:none --quiet https://github.com/smousavi05/EQTransformer /tmp/pip-req-build-bqxys18v
  Resolved https://github.com/smousavi05/EQTransformer to commit 17b701c24ff9889e26d8edacac01b7393450d7ad
  Preparing metadata (setup.py) ... done
Collecting pytest==7.1.2
  Using cached pytest-7.1.2-py3-none-any.whl (297 kB)
Requirement already satisfied: numpy==1.22.4 in /usr/local/lib/python3.9/dist-packages (from EQTransformer==0.1.61) (1.22.4)
Collecting keyring==23.7.0
  Using cached keyring-23.7.0-py3-none-any.whl (34 kB)
Collecting pkginfo==1.8.3
  Using cached pkginfo-1.8.3-py2.py3-none-any.whl (26 kB)
Collecting scipy==1.8.1
  Using cached scipy-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.2 MB)
ERROR: Could not find a version that satisfies the requirement tensorflow-deps==2.9.0 (from eqtransformer) (from versions: none)
ERROR: No matching distribution found for tensorflow-deps==2.9.0

@smousavi05
Copy link
Owner

smousavi05 commented Mar 28, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants