yfeng997 / MadMario

Interactive tutorial to build a learning Mario, for first-time RL learners
192 stars 68 forks source link

"conda env create" error: ResolvePackageNotFound #6

Open songyuc opened 3 years ago

songyuc commented 3 years ago

Hi guys, I tried to create the conda environment using conda env create -f environment.yml, but it showed: image So how can I solve it?

Your answer or idea will be appreciated!

ancorasir commented 3 years ago

Met the same problem!

neverstoplearn commented 3 years ago

I meet the same question as you,have you solve it?

songyuc commented 3 years ago

Hi, @neverstoplearn , I didn‘t solve it.

pierrefranklin commented 3 years ago

Removing the specific builds (ie the 3rd part of each line, for instance "- libffi==3.3=h0a44026_1" becomes "- libffi==3.3") worked for me. I also needed to install some additional packages afterwards.

The specific builds were not available to my conda, I am running Ubuntu 18.04 with conda version 4.10.1

13rac1 commented 1 year ago

I encountered this issue, upgraded libraries per #13, removed hashes, then upgraded the minimum number of dependencies until the environment could be created. Confirmed the original listed hashes are for Mac only. I'm running Mint 21 aka Ubuntu 22.04 with conda 23.3.1. The environment creation works with the following environment.yml:

name: mario
channels:
  - defaults
dependencies:
  - ca-certificates=2020.1.1=0
  - certifi=2020.4.5.1=py38_0
  - libcxx=14
  - libedit=3.1
  - libffi=3.3
  - ncurses=6.2
  - openssl=1.1
  - pip=20.0.2=py38_3
  - python=3.8.3
  - readline=8.0
  - setuptools=46.4.0=py38_0
  - sqlite=3.31.1
  - tk=8.6.8
  - wheel=0.34.2=py38_0
  - xz=5.2.5
  - zlib=1.2
  - pip:
      - cloudpickle==2.0.0
      - future==0.18.2
      - gym==0.21.0
      - gym-super-mario-bros==7.3.2
      - nes-py==8.1.8
      - numpy==1.21.2
      - matplotlib==3.4.3
      - opencv-python==4.5.3.56
      - pillow==8.3.2
      - pyglet==1.5.21
      - scikit-image==0.18.3
      - scipy==1.7.1
      - torch==1.9.1
      - torchvision==0.10.1
      - tqdm==4.62.3
prefix: /opt/anaconda3/envs/mario

Then it failed with:

$ python replay.py
Loading model at checkpoints/2020-10-21T18-25-27/mario.chkpt with exploration rate 0.1
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

The solution to that, on my machine, is: https://askubuntu.com/a/1357344

export MESA_LOADER_DRIVER_OVERRIDE=i965

Working using the pre-trained Mario checkpoint:

$ python replay.py
Loading model at checkpoints/2020-10-21T18-25-27/mario.chkpt with exploration rate 0.1
Episode 0 - Step 40 - Epsilon 0.1 - Mean Reward 231.0 - Mean Length 40.0 - Mean Loss 0.0 - Mean Q Value 0.0 - Time Delta 2.266 - Time 2023-04-19T17:59:58

ksnip_20230419-175230

Step by step

  1. git clone git@github.com:yfeng997/MadMario.git
  2. Edit the environment.yml to the above
  3. Download the pre-trained Mario checkpoint: https://drive.google.com/file/d/1RRwhSMUrpBBRyAsfHLPGt1rlYFoiuus2/view?usp=sharing
  4. mkdir -p checkpoints/2020-10-21T18-25-27
  5. Move the file from your downloads to the correct directory with the name expected by replay.py: mv ~/Downloads/trained_mario.chkpt checkpoints/2020-10-21T18-25-27/mario.chkpt
  6. Create the Anaconda env: conda env create -f environment.yml
  7. Activate it: conda activate mario
  8. Change the MESA loader (if needed): export MESA_LOADER_DRIVER_OVERRIDE=i965
  9. Run it: python replay.py