sisl/ngsim_env

LoadError: InitError: UndefVarError: pyprogramname not defined

Opened this issue · 0 comments

I am using Ubuntu 18.04.5, Julia v0.6.2, ngsim_env v0.6 branch and following the installation instructions in https://github.com/sisl/ngsim_env/blob/v0.6/docs/install_env_gail_full.md.
I also do some additional setup to make Julia package compatible (Revert to a previous version of *.jl).

  1. AutomotiveDrivingModels
  • cd ~/.julia/v0.6/AutomotiveDrivingModels
  • git checkout 74050e9ae44bda72a485c2573ac4f0df2bc3e767
  • change Base.parse() function signature in src/2d/roadway/roadways.jl:35 to line::AbstractString
  1. Records
  • cd ~/.julia/v0.6/Records
  • git checkout 4181e5d8033ddd47c086014301ee2a6c47289e6e
  1. Vec
  • cd ~/.julia/v0.6/Vec # tag: v0.1.0
  • git checkout ab4f652aa12a2d06433e62bb39e0a17f06ca9cbf
  1. AutoViz
  • cd ~/.julia/v0.6/AutoViz # tag: v0.6.0
  • git checkout f04a667b54de3d4b0252b958898577e6243c6f57
  • add Reexport to REQUIRE file
  1. BayesNets
  • cd ~/.julia/v0.6/BayesNets
  • git checkout 5febf756d38194712cfb8c0c2294252931611afa
  1. NGSIM
  • cd ~/.julia/v0.6/NGSIM # tag: v1.1.0
  • git checkout 656ead7154bdfef946e51401eeeb4b2c5accb022
  1. ~/ngsim_env/julia/deps/build.jl has been modified to include additional required packages.
package_names = [
    "JLD",
    "GridInterpolations",
    "PyCall",
    "PyPlot",
    "Iterators",
    "DataStructures",
    "Parameters",
    "StatsBase",
    "TikzGraphs",
    "CMakeWrapper",
    "Blosc",
    "PGFPlots"
]

I was able to go through all the setup instructions and julia tests julia ngsim_env/julia/test/runtests.jl. However, I ran into the errors when executing the following.

cd ~/ngsim_env/python/tests
python runtests.py

I have searched for the issue but did not find a solution. The errors are

test_julia_env (test_julia_env.TestJuliaEnv) ... ERROR: LoadError: InitError: UndefVarError: pyprogramname not defined
Stacktrace:
 [1] anaconda_conda() at ~/.julia/v0.6/PyCall/src/PyCall.jl:625
 [2] find_backend(::PyCall.PyObject) at ~/.julia/v0.6/PyPlot/src/init.jl:55
 [3] __init__() at ~/.julia/v0.6/PyPlot/src/init.jl:182
 [4] _include_from_serialized(::String) at ./loading.jl:157
 [5] _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:200
 [6] _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:236
 [7] _require(::Symbol) at ./loading.jl:441
 [8] require(::Symbol) at ./loading.jl:405
 [9] include_from_node1(::String) at ./loading.jl:576
 [10] include(::String) at ./sysimg.jl:14
 [11] anonymous at ./<missing>:2
during initialization of module PyPlot
while loading ~/ngsim_env/julia/AutoEnvs/AutoEnvs.jl, in expression starting on line 9
ERROR
test_multiagent_ngsim_env (test_multiagent_ngsim_env.TestMultiagentNGSIMEnv) ... ERROR: LoadError: InitError: UndefVarError: pyprogramname not defined
Stacktrace:
 [1] anaconda_conda() at ~/.julia/v0.6/PyCall/src/PyCall.jl:625
 [2] find_backend(::PyCall.PyObject) at ~/.julia/v0.6/PyPlot/src/init.jl:55
 [3] __init__() at ~/.julia/v0.6/PyPlot/src/init.jl:182
 [4] _include_from_serialized(::String) at ./loading.jl:157
 [5] _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:200
 [6] _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:236
 [7] _require(::Symbol) at ./loading.jl:441
 [8] require(::Symbol) at ./loading.jl:405
 [9] include_from_node1(::String) at ./loading.jl:576
 [10] include(::String) at ./sysimg.jl:14
 [11] anonymous at ./<missing>:2
during initialization of module PyPlot
while loading ~/ngsim_env/julia/AutoEnvs/AutoEnvs.jl, in expression starting on line 9
ERROR
test_ngsim_env (test_ngsim_env.TestNGSIMEnv) ... ERROR: LoadError: InitError: UndefVarError: pyprogramname not defined
Stacktrace:
 [1] anaconda_conda() at ~/.julia/v0.6/PyCall/src/PyCall.jl:625
 [2] find_backend(::PyCall.PyObject) at ~/.julia/v0.6/PyPlot/src/init.jl:55
 [3] __init__() at ~/.julia/v0.6/PyPlot/src/init.jl:182
 [4] _include_from_serialized(::String) at ./loading.jl:157
 [5] _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:200
 [6] _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:236
 [7] _require(::Symbol) at ./loading.jl:441
 [8] require(::Symbol) at ./loading.jl:405
 [9] include_from_node1(::String) at ./loading.jl:576
 [10] include(::String) at ./sysimg.jl:14
 [11] anonymous at ./<missing>:2
during initialization of module PyPlot
while loading ~/ngsim_env/julia/AutoEnvs/AutoEnvs.jl, in expression starting on line 9
ERROR
test_vectorized_ngsim_env (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: test_julia_env (test_julia_env.TestJuliaEnv)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "~/ngsim_env/python/tests/test_julia_env.py", line 12, in test_julia_env
    using='AutoEnvs'
  File "~/ngsim_env/python/julia_env/julia_env.py", line 16, in __init__
    self.j.using(using)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1170, in using
    self.eval("using %s" % module)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1149, in eval
    ans = self._call(src)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1082, in _call
    self.check_exception(src)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1132, in check_exception
    .format(exception, src))
julia.core.JuliaError: Exception 'Failed to precompile AutoEnvs to ~/.julia/lib/pyjulia3-v0.6/AutoEnvs.ji.' occurred while calling julia code:
using AutoEnvs

======================================================================
ERROR: test_multiagent_ngsim_env (test_multiagent_ngsim_env.TestMultiagentNGSIMEnv)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "~/ngsim_env/python/tests/test_multiagent_ngsim_env.py", line 36, in test_multiagent_ngsim_env
    using='AutoEnvs'
  File "~/ngsim_env/python/julia_env/julia_env.py", line 16, in __init__
    self.j.using(using)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1170, in using
    self.eval("using %s" % module)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1149, in eval
    ans = self._call(src)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1082, in _call
    self.check_exception(src)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1132, in check_exception
    .format(exception, src))
julia.core.JuliaError: Exception 'Failed to precompile AutoEnvs to ~/.julia/lib/pyjulia3-v0.6/AutoEnvs.ji.' occurred while calling julia code:
using AutoEnvs

======================================================================
ERROR: test_ngsim_env (test_ngsim_env.TestNGSIMEnv)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "~/ngsim_env/python/tests/test_ngsim_env.py", line 17, in test_ngsim_env
    using='AutoEnvs'
  File "~/ngsim_env/python/julia_env/julia_env.py", line 16, in __init__
    self.j.using(using)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1170, in using
    self.eval("using %s" % module)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1149, in eval
    ans = self._call(src)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1082, in _call
    self.check_exception(src)
  File "~/miniconda3/envs/rllab3/lib/python3.6/site-packages/julia/core.py", line 1132, in check_exception
    .format(exception, src))
julia.core.JuliaError: Exception 'Failed to precompile AutoEnvs to ~/.julia/lib/pyjulia3-v0.6/AutoEnvs.ji.' occurred while calling julia code:
using AutoEnvs

======================================================================
ERROR: test_vectorized_ngsim_env (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_vectorized_ngsim_env
Traceback (most recent call last):
  File "~/miniconda3/envs/rllab3/lib/python3.6/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "~/miniconda3/envs/rllab3/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "~/ngsim_env/python/tests/test_vectorized_ngsim_env.py", line 13, in <module>
    from hgail.baselines.gaussian_mlp_baseline import GaussianMLPBaseline
ModuleNotFoundError: No module named 'hgail'


----------------------------------------------------------------------
Ran 4 tests in 59.493s

FAILED (errors=4)

Can anyone give any suggestions or know how to solve the problem? I would appreciate it.