Skip to content
Snippets Groups Projects
Commit e7d921e6 authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

cairo support windows solved

parent 851b52b0
No related branches found
No related tags found
No related merge requests found
......@@ -2,18 +2,6 @@
import matplotlib.pyplot as plt
from numpy import array
import os
if os.name=='nt':
import site
import ctypes.util
default_os_path = os.environ['PATH']
os.environ['PATH'] = ''
for s in site.getsitepackages():
os.environ['PATH'] = os.environ['PATH'] + ';' + s + '\\cairo'
os.environ['PATH'] = os.environ['PATH'] + ';' + default_os_path
if ctypes.util.find_library('cairo') is not None:
print("cairo installed: OK")
class GraphicsLayer(object):
def __init__(self):
pass
......
......@@ -6,8 +6,21 @@ import numpy as np
# from flatland.utils.svg import Track, Zug
import time
import io
import os
def enable_windows_cairo_support():
if os.name=='nt':
import site
import ctypes.util
default_os_path = os.environ['PATH']
os.environ['PATH'] = ''
for s in site.getsitepackages():
os.environ['PATH'] = os.environ['PATH'] + ';' + s + '\\cairo'
os.environ['PATH'] = os.environ['PATH'] + ';' + default_os_path
if ctypes.util.find_library('cairo') is not None:
print("cairo installed: OK")
enable_windows_cairo_support()
from cairosvg import svg2png
from IPython.display import SVG
......
......@@ -12,6 +12,7 @@ import numpy as np
# TODO: suggested renaming to RailEnvRenderTool, as it will only work with RailEnv!
import os
class MPLGL(GraphicsLayer):
def __init__(self, width, height):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment