ds4dm / ecole

Extensible Combinatorial Optimization Learning Environments
https://www.ecole.ai
BSD 3-Clause "New" or "Revised" License
321 stars 68 forks source link

Unable to install Ecole 0.8.x via conda #341

Open tegg89 opened 2 years ago

tegg89 commented 2 years ago

Describe the bug

  1. I cannot install Ecole with 0.8.x version via conda-forge. When I manually install the Ecole 0.8.x after downloading *.tar.gz files, the system cannot find libecole.so.0.8.
(neural_lns) ➜  Downloads conda install ecole-0.8.1-py38h2181f43_1.tar.bz2 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(neural_lns) ➜  Downloads python
Python 3.8.13 (default, Mar 28 2022, 11:38:47) 
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ecole
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tegg/anaconda3/envs/neural_lns/lib/python3.8/site-packages/ecole/__init__.py", line 3, in <module>
    from ecole.core import RandomGenerator, seed, spawn_random_generator, MarkovError, Default
ImportError: libecole.so.0.8: cannot open shared object file: No such file or directory
  1. When I installed the default Ecole library via conda, I could only install one with version <0.8.x, although I could find the Ecole with 0.8.x.
(ecole_py310) ➜  Downloads conda install -c conda-forge ecole             
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
  current version: 4.10.3
  latest version: 4.14.0

Please update conda by running

    $ conda update -n base -c defaults conda

## Package Plan ##

  environment location: /home/tegg/anaconda3/envs/ecole_py310

  added / updated specs:
    - ecole

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2022.6.15          |  py310hff52083_0         155 KB  conda-forge
    ecole-0.7.3                |  py310hdd994bd_1         506 KB  conda-forge
    numpy-1.22.3               |  py310h4ef5377_2         6.8 MB  conda-forge
    python_abi-3.10            |          2_cp310           4 KB  conda-forge
    ------------------------------------------------------------
                                           Total:         7.5 MB

I could install Ecole via pip, but I encountered an error regarding thread. Since I need to use ecole.core.observation.NodeBipartiteObs.variable_features, I have to install Ecole with version 0.8.x via conda. How can I install it?

Setting

Thank you for any help!

AntoinePrv commented 2 years ago

I cannot install Ecole with 0.8.x version via conda-forge.

What error message do you get? If the environment is unsatisfiable,I recommend trying the equivalent mamba installer. I also recommend keeping an environment.yaml with all you dependencies so that you can start from a fresh environment and share with us if a new environment doe not work (otherwise we cannot reproduce the bug).

When I manually install the Ecole 0.8.x after downloading *.tar.gz files, the system cannot find libecole.so.0.8

How did you do it? If you are mixing conda/pip the environment may get broken.

When I installed the default Ecole library via conda, I could only install one with version <0.8.x, although I could find the Ecole with 0.8.x.

Perhaps some other dependencies in your environment are preventing conda from selecting a newer Ecole version. Hard to know without an environment file we could use.

piscesvivian commented 2 years ago

I have the same error.

I use a new conda env use command

conda create -n ecole python=3.8

tar.bz2 download from URL: https://anaconda.org/conda-forge/ecole/0.8.1/download/linux-64/ecole-0.8.1-py39h4115d8b_1.tar.bz2

install ecole offline.

root@train-install-ecole-0:/share# conda install ecole-0.8.1-py38h2181f43_1.tar.bz2 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
root@train-install-ecole-0:/share# python
Python 3.8.5 (default, Sep  4 2020, 07:30:14) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ecole
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/miniconda3/lib/python3.8/site-packages/ecole/__init__.py", line 3, in <module>
    from ecole.core import RandomGenerator, seed, spawn_random_generator, MarkovError, Default
ImportError: libecole.so.0.8: cannot open shared object file: No such file or directory

System Info: Docker Image.

AntoinePrv commented 2 years ago

@piscesvivian

install ecole offline.

This cannot work. The goal of conda is to install Ecole dependencies, if you just get that single file it's guaranteed to fail.

From my previous answer, I suggest you try to install mamba in your base environment, then install ecole with mamba. See the aforementioned Mamba doc for how to use Mamba.

BITACC commented 1 year ago

Hi @AntoinePrv I installed it in a docker and it works fine. There only one issue (so far) I am trying to execute a code that uses spawn_random_generator where it gets stuck cannot import name 'spawn_random_generator' from 'ecole.core' I did not use mama. installed in docker and directly used conda as RUN conda install -n envEcole -c conda-forge ecole

Many thanks in advance. image

Yige-Lei commented 9 months ago

I have successfully solved this problem!! Same ERROR! I need to use ecole.core.observation.NodeBipartiteObs.variable_features too. Thanks to this issue I was able to find out what the problem was. This conda install -c conda-forge ecole command in [https://pypi.org/project/ecole/] can only install the 0.7.3 version of ecole. Use conda install ecole directly after uninstall the 0.7.3 version of ecole. Then we can get the 0.8.1 version of ecole. Make sure your conda version is the latest, like 24.5.0.