我遵循了安装教程,并在本地和通过Docker安装了FLOW。在这两种情况下,SUMO示例都可以运行,但是Aimsun示例没有运行。
在本地Ubuntu 18.04计算机上,我已经安装了FLOW和SUMO,并且能够运行SUMO示例流/examples/sumo/sugiyama.py。然后,我按照安装教程进行操作,并在默认安装路径(/ home / Aimsun_Next_8_4_0和/ home / Aimsun_Next_8_3_1)中下载/安装了Aimsun 8.4.0和Aimsun 8.3.1。
但是在下一步中,我被要求运行脚本scripts/setup_aimsun.sh
,但是由于PackagesNotFoundError: The following packages are not available from current channels: - python=2.7.4
,代码未执行。然后,我使用conda search python
来查看Anaconda存储的python版本。原来只有python 2.7.13 hac47a24_15 pkgs/main
到python 3.7.4 h265db76_1 pkgs/main
的版本可用。因此,我放弃了并将脚本从python=2.7.4
更改为python=2.7
,然后再次运行脚本scripts/setup_aimsun.sh
。这次安装完成了,并且安装了python 2.7.16而不是2.7.4。 activate aimsun_flow
和which python
的输出产生了/home/tong/anaconda3/envs/aimsun_flow/bin/python
,这是预期的。
然后,我编辑文件/flow/config.py以包括新创建的路径:
AIMSUN_NEXT_PATH = "/home/tong/Aimsun_Next_8_3_1/"
AIMSUN_SITEPACKAGES = "/home/tong/anaconda3/envs/aimsun_flow/"
接下来,我尝试使用以下命令测试Aimsun示例:conda activate flow
和'python examples / aimsun / sugiyama.py
',这是我收到的错误消息:
Traceback (most recent call last):
File "examples/aimsun/sugiyama.py", line 59, in <module>
exp = sugiyama_example()
File "examples/aimsun/sugiyama.py", line 52, in sugiyama_example
env = TestEnv(env_params, sim_params, scenario, simulator='aimsun')
File "/home/tong/github/flow/flow/envs/base_env.py", line 150, in __init__
self.k.scenario.generate_network(scenario)
File "/home/tong/github/flow/flow/core/kernel/scenario/aimsun.py", line 122, in generate_network
self.aimsun_proc = subprocess.Popen(aimsun_call)
File "/home/tong/anaconda3/envs/flow/lib/python3.6/subprocess.py", line 729, in __init__
restore_signals, start_new_session)
File "/home/tong/anaconda3/envs/flow/lib/python3.6/subprocess.py", line 1364, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/tong/Aimsun_Next_8_3_1/Aimsun_Next'
不确定为什么两种情况下都无法运行Aimsun。可能是因为我在conda环境中没有python 2.7.4的确切版本吗?