projectmesa / mesa-geo

GIS Extension for Mesa Agent-Based Modeling
Other
150 stars 52 forks source link

How to debug mesa-geo? AttributeError: module 'ntpath' has no attribute 'sep' #41

Open stefaneidelloth opened 2 years ago

stefaneidelloth commented 2 years ago

If I try to debug a mesa-geo application in PyCharm on Windows ... for the line

tornado.ioloop.IOLoop.current().start()

in ModularViualization.py

I get:

C:\python_env\App\PyCharm\..\..\App\WinPython\python-3.10.2.amd64\python.exe C:\python_env\App\PyCharm\plugins\python-ce\helpers\pydev\pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 52260 --file C:/python_env/workspace/TechDiff/src/main.py
Connected to pydev debugger (build 213.6777.50)
Interface starting at http://127.0.0.1:8521
ERROR:tornado.application:Uncaught exception GET /static/css/bootstrap.min.css (127.0.0.1)
HTTPServerRequest(protocol='http', host='127.0.0.1:8521', method='GET', uri='/static/css/bootstrap.min.css', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "C:\python_env\App\WinPython\python-3.10.2.amd64\lib\site-packages\tornado\web.py", line 1704, in _execute
    result = await result
  File "C:\python_env\App\WinPython\python-3.10.2.amd64\lib\site-packages\tornado\web.py", line 2573, in get
    self.path = self.parse_url_path(path)
  File "C:\python_env\App\WinPython\python-3.10.2.amd64\lib\site-packages\tornado\web.py", line 2961, in parse_url_path
    if os.path.sep != "/":
AttributeError: module 'ntpath' has no attribute 'sep'

If I run mesa-geo without debugging I do not get this error.

versions: mesa-geo: 0.2.0 tornado: 6.1 pycharm: 2021.3.2 (Community Edition)

=> Do I need to consider something special if I want to debug mesa-geo?

stefaneidelloth commented 2 years ago

As a workaround I added following line in my code

os.path.sep = os.sep # fixes tornado issue