export molecules fails with ModuleNotFoundError: No module named 'xlwt' #32

Open
opened 2025-10-14 17:28:00 -06:00 by navan · 0 comments
Owner

Originally created by @j3mdamas on 7/15/2020

Hi,

I've followed the instructions for deploying using docker-compose. It was successfully deployed, I am able to use the interface, but when exporting the molecules from the "cart", it errors with:

Traceback (most recent call last):
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask_restplus/api.py", line 584, in error_router
    return original_handler(e)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask_restplus/api.py", line 584, in error_router
    return original_handler(e)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask_restplus/api.py", line 325, in wrapper
    resp = resource(*args, **kwargs)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/home/server/api.py", line 238, in post
    data.to_excel(fn, index=None)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/pandas/core/generic.py", line 2181, in to_excel
    engine=engine,
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/pandas/io/formats/excel.py", line 726, in write
    writer = ExcelWriter(stringify_path(writer), engine=engine)
  File "/opt/conda/envs/gfai/lib/python3.7/site-packages/pandas/io/excel/_xlwt.py", line 13, in __init__
    import xlwt
ModuleNotFoundError: No module named 'xlwt'

I quickly checked and apparently xlwt is not a pandas dependency, so I guess it needs to be added explicitly to the environment.yml of the gui server.

At least what I did was add xlwt to https://github.com/jrwnter/gruenifai/blob/master/gruenifai/gui/server/environment.yml, build that image locally instead of pulling it, and the export works.

I hope this is helpful.
João

*Originally created by @j3mdamas on 7/15/2020* Hi, I've followed the instructions for deploying using `docker-compose`. It was successfully deployed, I am able to use the interface, but when exporting the molecules from the "cart", it errors with: ``` Traceback (most recent call last): File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__ return self.wsgi_app(environ, start_response) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app response = self.handle_exception(e) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask_restplus/api.py", line 584, in error_router return original_handler(e) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception reraise(exc_type, exc_value, tb) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise raise value.with_traceback(tb) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask_restplus/api.py", line 584, in error_router return original_handler(e) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise raise value.with_traceback(tb) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask_restplus/api.py", line 325, in wrapper resp = resource(*args, **kwargs) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask/views.py", line 89, in view return self.dispatch_request(*args, **kwargs) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/flask_restplus/resource.py", line 44, in dispatch_request resp = meth(*args, **kwargs) File "/home/server/api.py", line 238, in post data.to_excel(fn, index=None) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/pandas/core/generic.py", line 2181, in to_excel engine=engine, File "/opt/conda/envs/gfai/lib/python3.7/site-packages/pandas/io/formats/excel.py", line 726, in write writer = ExcelWriter(stringify_path(writer), engine=engine) File "/opt/conda/envs/gfai/lib/python3.7/site-packages/pandas/io/excel/_xlwt.py", line 13, in __init__ import xlwt ModuleNotFoundError: No module named 'xlwt' ``` I quickly checked and apparently `xlwt` is not a `pandas` dependency, so I guess it needs to be added explicitly to the `environment.yml` of the gui server. At least what I did was add `xlwt` to https://github.com/jrwnter/gruenifai/blob/master/gruenifai/gui/server/environment.yml, build that image locally instead of pulling it, and the export works. I hope this is helpful. João
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/gruenifai#32
No description provided.