Csparc2star.py: command not found

Dear all,
Recently, I installed the pyem software according to this instruction
:Install pyem with Miniconda · asarnow/pyem Wiki · GitHub, and it prompts that successfully installed pyem, but when I try to run csparc2star by following command csparc2star.py particles_selected.cs particles_selected.star, it said that “Csparc2star.py: command not found”.How could I run it correctly?Thank you very much for you help!

Best regards

1 Like

I am also having the same issue. Initially, I was having errors like no module named pandas/pip. I found that the default link of miniconda3 download (wget …x86.sh) was going to 32 bit version in my case, I edited the link for 64 bit version (wget …x86_64.sh) and reinstalled it but now I am getting the “Csparc2star.py: command not found” error. How do I check if everything is set up correctly?

Please read these tutorials on configuring your PATH and miniconda environments.

1 Like

@DanielAsarnow. Thanks for the useful links. The mistake I was making is not activating pyem before running the conversion command. I mistook it to stay active once activated.


I followed the instruction https://github.com/asarnow/pyem/wiki/Install-pyem-with-Miniconda and successfully installed pyem-0.5.

I first ran the following command to activate conda:
conda activate pyem

Then I ran the conversion command as below:
csparc2star.py --inverty extracted_particles.cs J49_passthrough_particles.cs J49_csparc2star_test.star

It poped an error saying “csparc2star.py: command not found”.

I also read the tutorials on configuring your PATH and miniconda environments reccommended by DanielAsarnow, I still couldn’t figure out how to setup the path.

The pyem environment location: /home/user/miniconda3/envs/pyem

Another path: /home/user/miniconda3/bin/conda

I tried to setup path in either of the two ways below, but the error “csparc2star.py: command not found” persisted:
export PATH=$PATH:/home/user/miniconda3/envs/pyem
export PATH=$PATH:/home/user/miniconda3/bin/conda

Could anyone give a clue about how to make csparc2star.py command executable?


The directory added to your path should be the one with the pyem CLI programs - that is the same one as the github checkout directory. Or, you can use the direct path to the program itself, the scripts all have a #!/usr/bin/env python line so if the pyem conda environment is active they will work.

What are the contents of /home/user/miniconda3/envs/pyem? If the csparc2star.py file is not in that directory, it won’t work.

Dear DanielAsarnow and ccgauvin94,

Thanks for your advice! The path I set before doesn’t contain the csparc2star.py scipt.

I ran the following commands:
export PATH=$PATH:/home/user/programs/pyem
The pyem directory above contains all the scipts including csparc2star.py.

conda activate pyem

Afterwards, the csparc2star.py command works well : )

Thanks a lot!

1 Like