PyMongo import error

Hey all,

I have a new user trying to run a freshly installed Cryosparc, and when he submits a job to our cluster, the job crashes immediately with this job.log:

================= CRYOSPARCW =======  2024-04-01 13:40:54.167606  =========
Project P2 Job J12
Master cn1742 Port 39082
===========================================================================
========= monitor process now starting main process at 2024-04-01 13:40:54.167725
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "cryosparc_master/cryosparc_compute/run.py", line 175, in cryosparc_master.cryosparc_compute.run.run
  File "/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/cryosparc_compute/jobs/__init__.py", line 10, in <module>
    from . import runcommon  # noqa
  File "/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/cryosparc_compute/jobs/runcommon.py", line 68, in <module>
    from .. import database_management
  File "/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/cryosparc_compute/database_management.py", line 15, in <module>
    from flask_pymongo import PyMongo
ImportError: cannot import name 'PyMongo' from 'flask_pymongo' (unknown location)
MAINPROCESS PID 1702470
Process Process-1:
Traceback (most recent call last):
  File "/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "cryosparc_master/cryosparc_compute/run.py", line 29, in cryosparc_master.cryosparc_compute.run.main
  File "/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/cryosparc_compute/jobs/__init__.py", line 10, in <module>
    from . import runcommon  # noqa
  File "/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/cryosparc_compute/jobs/runcommon.py", line 68, in <module>
    from .. import database_management
  File "/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/cryosparc_compute/database_management.py", line 15, in <module>
    from flask_pymongo import PyMongo
ImportError: cannot import name 'PyMongo' from 'flask_pymongo' (unknown location)

I’m clueless as to why it can’t load the PyMongo package.

David

Welcome to the forum @davidhoover1

What command(s) did you use for installation?
Did you record any output for the installation command(s) that you could check for errors?
You may try, as a potential fix or for diagnostic purposes, repeat part of the installation process by running the command

/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/bin/cryosparcw forcedeps

If this command does not rectify the problem, please post error messages from the command and/or a newly failing job, along with the outputs of the following commands:

/abs/path/to/cryosparc_master/bin/cryosparcm cli "get_scheduler_targets()"
/gpfs/gsfs12/users/kumarc2/apps/cryosparc/cryosparc_worker/bin/cryosparcw env | grep PATH

In the end, we wound up reinstalling cryosparc again and that fixed the issue. Not sure what happened.

1 Like