GPflowOpt icon indicating copy to clipboard operation
GPflowOpt copied to clipboard

Installing in Anaconda

Open hmedal opened this issue 5 years ago • 6 comments

Hello,

I am trying to install GPFlowOpt in Anaconda. Here is the error I am getting:

(base) CEEITs-MacBook-Pro:GPflowOpt hmedal$ conda activate gpflowopt (gpflowopt) CEEITs-MacBook-Pro:GPflowOpt hmedal$ pip install git+git://github.com/GPflow/GPflowOpt.git Collecting git+git://github.com/GPflow/GPflowOpt.git Cloning git://github.com/GPflow/GPflowOpt.git to /private/var/folders/fj/nbbxj0td0lbdvgq33y96w3mm0000gp/T/pip-req-build-57jmjtlx Collecting numpy>=1.9 (from gpflowopt==0.1.1) Using cached https://files.pythonhosted.org/packages/a6/6f/cb20ccd8f0f8581e0e090775c0e3c3e335b037818416e6fa945d924397d2/numpy-1.16.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Collecting scipy>=0.16 (from gpflowopt==0.1.1) Using cached https://files.pythonhosted.org/packages/dd/6c/ccf7403d14f0ab0f20ce611696921f204f4ffce99a4fd383c892a6a7e9eb/scipy-1.2.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Collecting GPflow==0.5.0 (from gpflowopt==0.1.1) Could not find a version that satisfies the requirement GPflow==0.5.0 (from gpflowopt==0.1.1) (from versions: 1.0.0, 1.1.0, 1.1.1, 1.2.0, 1.3.0) No matching distribution found for GPflow==0.5.0 (from gpflowopt==0.1.1)

Any guidance you can provide is appreciated.

hmedal avatar Mar 26 '19 18:03 hmedal

Try pip install git+https://github.com/GPflow/GPflowOpt.git --process-dependency-links to get the dependency

outboundbird avatar Apr 08 '19 12:04 outboundbird

Thank you! Unfortunately, it looks like pip no longer supports --process-dependency-links (https://github.com/pypa/pip/issues/6162).

$ pip install git+https://github.com/GPflow/GPflowOpt.git --process-dependency-links

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

no such option: --process-dependency-links

I am using pip version 19.0.3.

pip 19.0.3 from /anaconda2/envs/gpflowopt/lib/python3.7/site-packages/pip (python 3.7)```

hmedal avatar Apr 08 '19 14:04 hmedal

You can install GPFlow 0.5.0 directly from git: https://github.com/GPflow/GPflow/tree/0.5.0

icouckuy avatar Apr 17 '19 08:04 icouckuy

I have faced the same problem. Because pip doesn't support --process-dependency-links at all, I use pip install pip==18.1 to reinstall pip to previous version and it works.

Raychiu123 avatar Jun 18 '19 18:06 Raychiu123

The following instructions worked for me. The instructions assumes that the current directory has both GPflow and GPflowOpt folders (clone them from github if needed).

conda create -n GPflowOpt python=3.5 numpy scipy jupyter matplotlib pip=10
conda activate GPflowOpt
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp35-cp35m-linux_x86_64.whl
cd GPflow
git checkout tags/0.5.0 -b 0.5.0            # GPFlowOpt requires GPflow=0.5.0
python setup.py install
cd ../GPflowOpt/
pip install -e . --process-dependency-links

These instructions follow from:

  1. https://github.com/GPflow/GPflow/blob/ce5ad7ea75687fb0bf178b25f62855fc861eb10f/.travis.yml#L20
  2. Older version of pip required for process-dependency-links. pip==18.1 did not work for me.

These instructions allowed me to run the examples

abyvinod avatar Apr 18 '20 21:04 abyvinod

Faced the same issue. I have Python of version 3.8.3. For gpflow a version='>=3.6,<3.7.0a0' is required. Therefore, my solution was as follows:

  1. install a venv with the given python version.

  2. install GPFlow 0.5.0 directly from git: https://github.com/GPflow/GPflow/tree/0.5.0 check the version before cloning (better to download the 0.5.0 version and use pip install .)

  3. Check the insatllation and version. Can face an error like "GPflow-0.5.0\gpflow\session.py", line 8, in AttributeError: module 'tensorflow' has no attribute 'Session'" Solution: in TF 2.0 you should use tf.compat.v1.Session() instead of tf.Session()

  4. Then install gpflowopt using "pip install git+git://github.com/GPflow/GPflowOpt.git"

  5. Check the insatllation and version. anaconda3\envs\OPT\lib\site-packages\gpflow\session.py", line 8, in class TracerSession(tf.Session) Solution: in TF 2.0 you should use tf.compat.v1.Session() instead of tf.Session()

  6. Now it is installed properly.

pallavimitra avatar Sep 24 '20 11:09 pallavimitra