Snippets Collections
FROM python:3.9-slim-bullseye

ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Install dependencies:
COPY requirements.txt .
RUN pip install -r requirements.txt

# Run the application:
COPY myapp.py .
CMD ["python", "myapp.py"]
# open virtual environment
python3 -m venv "${HOME}/meltingpot_venv"
source "${HOME}/meltingpot_venv/bin/activate"

# Clone respository content 
git clone https://github.com/deepmind/meltingpot

# Open the install-{XX} files 
vim install-dmlab2d.sh
i
# and adjust 'python' to 'python3', then save and exit
ESC
:wq

# install dmlab
sh install-dmlab2d.sh

# build wheel
cd lab2d
bazel build --config=lua5_2 --verbose_failures //dmlab2d:dmlab2d_wheel

# test run
bazel run -c opt --config=lua5_2 --verbose_failures dmlab2d/random_agent -- --level_name=clean_up

# go back to enclosing folder and install meltingpot
cd ..
sh install-meltingpot.sh

# test it
pytest meltingpot

# From the docs:
# NOTE: If you get a ModuleNotFoundError: No module named 'meltingpot.python' error, you can solve it by exporting the meltingpot home directory as PYTHONPATH (e.g. by calling export PYTHONPATH=$(pwd))

### This was also helpful: https://github.com/deepmind/lab2d/issues/19 for issues with conda 

### Virtual Environment Stored in (base);
requirements:
numpy==1.23.1 # https://stackoverflow.com/questions/74893742/how-to-solve-attributeerror-module-numpy-has-no-attribute-bool
ray=2.0.0
# Start virtualenvwrapper
workon

# make new virtual env
mkvirtualenv name

# docs: https://virtualenvwrapper.readthedocs.io/en/latest/install.html
star

Thu Dec 28 2023 10:29:03 GMT+0000 (Coordinated Universal Time) https://pythonspeed.com/articles/activate-virtualenv-dockerfile/

#python #venv
star

Thu Jan 19 2023 13:40:27 GMT+0000 (Coordinated Universal Time)

#venv #virtualenvwrapper
star

Thu Jan 19 2023 11:15:10 GMT+0000 (Coordinated Universal Time)

#venv #virtualenvwrapper
star

Tue Jul 19 2022 05:30:59 GMT+0000 (Coordinated Universal Time) https://realpython.com/python-virtual-environments-a-primer/

#activate #venv #python #virtual

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension