Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should I add path in order to run example script? #1

Closed
haoliuhl opened this issue Aug 26, 2017 · 12 comments
Closed

Should I add path in order to run example script? #1

haoliuhl opened this issue Aug 26, 2017 · 12 comments

Comments

@haoliuhl
Copy link

haoliuhl commented Aug 26, 2017

I installed rllab correctly and cloned softqlearning into a different folder. When I was trying to run an example file e.g. python softqlearning/scripts/learn_swimmer.py I was told that

File "softqlearning/scripts/learn_swimmer.py", line 10, in
from rllab.tf.envs.base import TfEnv
ImportError: No module named 'rllab.tf'

It seems that I need to add some path?

@haoliuhl
Copy link
Author

Even after I use export PYTHONPATH=path_to_softqlearning:$PYTHONPATH, it still reports the same error.

@haoliuhl haoliuhl reopened this Aug 26, 2017
@haarnoja
Copy link
Owner

Are you using python 2 or python 3? You will need python 3.

@haoliuhl
Copy link
Author

Following instructions of rlllab, I created a Python 3 environment. I am using this environment to run softqlearning

@haoliuhl
Copy link
Author

To verify the following steps are correct, I have even tried rllabplusplus and can run both rllab and rllab++ correctly,

  • install rllab, mujoco and create environment
  • export project path to PYTHONPATH
  • activate environment and test

@haarnoja
Copy link
Owner

I see. You don't need to install rllab for this to work. All dependencies are already included in the rllab/ folder (it's slightly customized version of the actual rllab, that's why it is included in this repo). Make sure rllab refers to the right package.

@haoliuhl
Copy link
Author

Cool, I will use anaconda to create a new Python 3 environment instead of run this in the rllab environment. Do you mean I need to add path of this rllab/ to PYTHONPATH?

@haarnoja
Copy link
Owner

You don't need to add it at all, if you add path to softqlearning root to your PYTHONPATH. Or you can have PYTHONPATH=. and run everything from the root.

@haoliuhl
Copy link
Author

I see, thanks. I can run it in a new python 3 environment after adding PYTHONPATH. A wield thing is that in rllab3 environment, even after I use export PYTHONPATH=path_to_softqlearning:$PYTHONPATH, it still can not find the path.

@haarnoja
Copy link
Owner

Cool. It probably fails because rllab can then be found in two different locations, and python looks into the wrong one which does not have the required module, and it thus fails.

@phaniram-sayapaneni
Copy link

I'm having similar problem importing rllab.

  1. Couldn't import rllab?
  2. Also could we do, export PYTHONPATH={$PYTHONPATH}:(pwd)
    to append path, instead of changing it to pwd

How I have installed:

  1. created custom_path as "softq"
  2. cloned rllab, entered rllab and did export pythonpath
  3. copied all mj files
  4. cloned softqlearning in the path "softq"
  5. activated sql and ran the python example command

Any help would be very much appreciated

@phaniram-sayapaneni
Copy link

In rllab directory, there is another rllab. Not sure if it is causing the confusion to import

@phaniram-sayapaneni
Copy link

If anyone is still looking at this thread use: python3 while creating the environment, it will work.

haarnoja pushed a commit that referenced this issue Jan 5, 2019
* migrate from rllab to garage

* update incorrect dependency

* remove dependency on env.spec

* fix multi-goal env, remove dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants