安装需求
carla支持windows、linux、docker等环境下使用
Linux下的安装和使用直接去:https://zhuanlan.zhihu.com/p/338641593,讲解非常详细
Windows快速安装Carla的步骤如下
1.下载最新版的anaconda,地址:https://mirrors.tuna.tsinghua…
2.创建虚拟环境安装python3.7
conda create -n py37 python=3.7
conda activate py37
设置conda下载加速
conda config --add channels https://mirrors.tuna.tsinghua...
conda config --add channels https://mirrors.tuna.tsinghua...
conda config --add channels https://mirrors.tuna.tsinghua...
安装会使用到的包
pip install numpy
pip install pygame
pip install networkx
3.下载需要版本的carla并解压,地址:https://carla.org/…,解压到:D:\carla\CARLA_0.9.11
4.安装carlalib,打开命令行程序,执行下面的命令
cd D:\carla\CARLA_0.9.11\WindowsNoEditor\PythonAPI\carla\dist
easy_install carla-0.9.10-py3.7-win-amd64.egg
5.到这里就可以执行自带用例啦
cd D:\carla\CARLA_0.9.11\WindowsNoEditor\PythonAP\examples
python automatic_control.py
解决问题1
问题描述:编写python脚本时,没有名为 'carla' 的模块
No module named 'carla'
解决网址:https://github.com/carla-simulator/carla/issues/1466
使你的python脚本包含以下代码,并确保路径正确,即与你安装carla的位置保持一致。
import glob
import os
import sys
try:
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
pass
import carla