CryoSPARC Tools ModuleNotFoundError

Dear colleagues,

Could you please share your experience in the installation of the cryosparc-tools?

Following the installation instructions Getting Started — cryosparc-tools

I run:
a) pip install cryosparc-tools
b) pip install -U cryosparc-tools

Here is the result:

cryosparc_user@cryoem1:~/cryosparc/cryosparc_worker$ pip show cryosparc-tools
Name: cryosparc-tools
Version: 4.4.1
Summary: Toolkit for interfacing with CryoSPARC
Home-page: 
Author: 
Author-email: "Structura Biotechnology Inc." <info@structura.bio>
License: 
Location: /home/cryosparc_user/.local/lib/python3.11/site-packages
Requires: numpy, typing-extensions
Required-by:

Then, when I wanted to run the Python script, I got an error

cryosparc_user@cryoem1:~/cryosparc/cryosparc_worker/bin$ python /home/cryosparc_user/Documents/check_movies.py
Traceback (most recent call last):
  File "/home/cryosparc_user/Documents/check_movies.py", line 2, in <module>
    from cryosparc_tools.cryosparc.tools import CryoSPARC
ModuleNotFoundError: No module named 'cryosparc_tools'
cryosparc_user@cryoem1:~/cryosparc/cryosparc_worker/bin$ ls
connect.py  cryosparcw  cryosparc_worker.tar.gz  validate.py
cryosparc_user@cryoem1:~/cryosparc/cryosparc_worker/bin$ 

Could you please advice how to fix that?

Thank you.

Kind regards,
Dmitry

Did you create a dedicated python environment, as suggested?

1 Like

hello @wtempel ,

Do you mean I shall first do
activate conda

And then the installation commands?

Kind regards,
Dmitry

  1. create environment newenv including the pip conda package
    conda create -n newenv pip
    
    (newenv is an example environment name. You should choose a different name according to preferences or needs.)
  2. activate the environment just created
    conda activate newenv
    
  3. inside the environment just activated
    # confirm one is _not_ using "system" pip, like /usr/bin/pip
    which pip
    pip install cryosparc-tools
    
  4. to run cryosparc-tools scripts, call python from inside the activated newenv environment.

[Edited 2024-03-14 to correct command for env creation.]

1 Like

hello @wtempel ,

Just a small addition for the 1th command -

It probably has to be -
conda create -n newenv pip

Regards,
Dmitry

@Dmitry You are correct. I will correct to command in my post accordingly.

1 Like