cmdstanpy icon indicating copy to clipboard operation
cmdstanpy copied to clipboard

ModuleNotFoundError: No module named 'cmdstanpy'

Open riasain opened this issue 6 months ago • 2 comments

I have installed cmstan.2.36 in my Ubuntu 24.04.2 LTS machine which has python3.12. For the other python libraries, I am using for example "sudo apt install python3-pandas" as pip install does not seem to be working. How do I compile a code which uses Cmdstanpy?? Please help.

riasain avatar May 12 '25 10:05 riasain

You might want to figure out why pip install does not work.

Do you need to use python or python3 to start python? Do you have pip3 command.

Does python -m pip install xyz work?

ahartikainen avatar May 12 '25 18:05 ahartikainen

@riasain when you are installing Python packages via your distro's package manager (apt), you are likely installing them into your system environment. Packages installed via pip are not necessarily installed to that same location and this can cause confusion as packages you have installed via different means don't see each other.

To make it less confusing and ensure you are installing all the appropriate dependencies correctly, you should be using virtual environments or some equivalent (like a conda environment). Within a virtual environment, you should be able to install all the packages you need such as cmdstanpy, jupyter, pandas, etc.

amas0 avatar May 14 '25 02:05 amas0