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

import "marlo" can not be resolved #83

Open
irfanfarhat opened this issue Feb 7, 2022 · 3 comments
Open

import "marlo" can not be resolved #83

irfanfarhat opened this issue Feb 7, 2022 · 3 comments

Comments

@irfanfarhat
Copy link

irfanfarhat commented Feb 7, 2022

Hey!
I followed Anaconda's installation and installed Marlo. I ran the single-agent example and it worked. Now (after one day) I pasted the multi-agent example and I am getting import "marlo" could not be resolved.
I am not sure what is the issue please help me as soon as possible. I am new to this and I have a research project to start working on and I am short on time. I have a warning that says cannot find gcc in c_cpp_properties.json and I don't know if it is related to this.
currently I am installing mingw and see if it fixes the issues. If it does fix the issue I will close this issue and will let you know. But if it doesn't please help me what can I do to fix this import "marlo" could not be resolved.

image

This is the multi-agent example code

`# !/usr/bin/env python

$MALMO_MINECRAFT_ROOT/launchClient.sh -port 10000

$MALMO_MINECRAFT_ROOT/launchClient.sh -port 10001

import marlo
client_pool = [('127.0.0.1', 10000),('127.0.0.1', 10001)]
join_tokens = marlo.make('MarLo-MazeRunner-v0',
params={
"client_pool": client_pool,
"agent_names" :
[
"MarLo-Agent-0",
"MarLo-Agent-1"
]
})

As this is a two-agent scenario,

there will just two join tokens

assert len(join_tokens) == 2

@marlo.threaded
def run_agent(join_token):
env = marlo.init(join_token)
observation = env.reset()
done = False
count = 0
while not done:
_action = env.action_space.sample()
obs, reward, done, info = env.step(_action)
print("reward:", reward)
print("done:", done)
print("info", info)
env.close()

Run agent-0

thread_handler_0, _ = run_agent(join_tokens[0])

Run agent-1

thread_handler_1, _ = run_agent(join_tokens[1])

Wait for both the threads to complete execution

thread_handler_0.join()
thread_handler_1.join()

print("Episode Run Complete")`

@irfanfarhat
Copy link
Author

Fixed the GCC issue but still (import "malmo" could not be resolved) error.

@irfanfarhat
Copy link
Author

anyone here to help?
import marlo can not be resolved

@renatokuipers
Copy link

Sorry for the very very late answer ......

Close the terminal and press F1 and choose the correct interpreter.
since VS Code standard chooses the default Python interpreter, you should choose the Marlo interpreter from Conda. Then start the terminal again and everything should work

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

2 participants