kengz / SLM-Lab

Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".
https://slm-lab.gitbook.io/slm-lab/
MIT License
1.23k stars 263 forks source link

Update setup_macOS #475

Closed amjadmajid closed 3 years ago

amjadmajid commented 3 years ago

To fix the ModuleNotFoundError: No module named 'past' when running the demo

Title of code changes

some code snippets

----------- USE ABOVE FOR FEATURES, BELOW FOR RESULTS -----------

Experiment Title

Abstract

Briefly describe the experiment and the contribution.

Methodology

Discuss the methods/algorithms used.

Reproduction

  1. spec file location:
  2. git SHA (find this inside the spec file):

Run command: python run_lab.py <spec file>

Result and Discussion

Provide data in graphs and tables; give explanations and conclusion.

Data zipfile url (We will send you a Dropbox file request):

kengz commented 3 years ago

Thanks for the report. Could you please provide the full error log when this module past is imported? This should not happen since nothing in here is python 2 and we need to see the root cause before approving a solution.

mania087 commented 3 years ago

Hey I encountered the same problem in Linux environment, the solution that @amjadmajid mentioned solved it. Here is my log when running installation with Docker

ImportError while loading conftest '/root/SLM-Lab/test/conftest.py'. test/conftest.py:1: in from slm_lab.experiment.control import make_agent_env slm_lab/experiment/control.py:4: in from slm_lab.agent import Agent, Body slm_lab/agent/init.py:7: in from torch.utils.tensorboard import SummaryWriter ../miniconda3/envs/lab/lib/python3.7/site-packages/torch/utils/tensorboard/init.py:6: in from .writer import FileWriter, SummaryWriter # noqa F401 ../miniconda3/envs/lab/lib/python3.7/site-packages/torch/utils/tensorboard/writer.py:18: in from ._convert_np import make_np ../miniconda3/envs/lab/lib/python3.7/site-packages/torch/utils/tensorboard/_convert_np.py:12: in from caffe2.python import workspace ../miniconda3/envs/lab/lib/python3.7/site-packages/caffe2/python/workspace.py:15: in from past.builtins import basestring E ModuleNotFoundError: No module named 'past'

kengz commented 3 years ago

This has been addressed in #485 . Thanks for the changes!