Skip to content

Commit 74584b2

Browse files
committed
Modified sys.path in gym_iw_agent.py so python can find the compiled module after pip installing gym_iw
1 parent 3fbe16c commit 74584b2

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

gym_iw/gym_iw_agent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import argparse
22
import sys
3+
import os
34

4-
from gym_iw import __GymIwAgent
5+
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
6+
7+
from __gym_iw import __GymIwAgent
58

69
import gym
710
from gym import wrappers, logger

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
PYBIND11_ADD_MODULE(gym_iw gym_spaces.cc gym_iw.cc logger.cc)
1+
PYBIND11_ADD_MODULE(__gym_iw gym_spaces.cc gym_iw.cc logger.cc)

src/gym_iw.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace py = pybind11;
77

8-
PYBIND11_MODULE(gym_iw, giw) {
8+
PYBIND11_MODULE(__gym_iw, giw) {
99
py::class_<GymProxy> gym_iw_agent(giw, "__GymIwAgent");
1010
gym_iw_agent
1111
.def(py::init<const py::object&, const std::string&, const std::string&,

0 commit comments

Comments
 (0)