How to install a package

I am trying to install a package named spatial_correlation-sampler, but the installation is not going through “error: legacy-install-failure”

I ran PythonSlicer.exe -m pip install spatial_correlation-sampler

ModuleNotFoundError: No module named ‘spatial_correlation_sampler’

I tried installing but facing issue

in that python window try
pip_install("spatial_correlation_sampler")

and you will probbaly see the actual error why it is not installed?

Hi @muratmaga I am still facing the same issue as mentioned first

“OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.”

But I have set this as env variable

This is on my mac. It looks like this pywheel requires building from scratch, and it is not finding some of the build packages as far as I can tell. You will need to to dig deeper into the package to find what those are and why they are failing under slicer (or not being installed).

>>> pip_install("spatial_correlation_sampler")
Collecting spatial_correlation_sampler
  Downloading spatial_correlation_sampler-0.5.0.tar.gz (9.8 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Gettin
>>> g requirements to build wheel: finished with status 'error'
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Applications/Slicer.app/Contents/bin/Python/slicer/util.py", line 3887, in pip_install
    _executePythonModule("pip", args)
  File "/Applications/Slicer.app/Contents/bin/Python/slicer/util.py", line 3848, in _executePythonModule
    logProcessOutput(proc)
  File "/Applications/Slicer.app/Contents/bin/Python/slicer/util.py", line 3814, in logProcessOutput
    raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command '['/Applications/Slicer.app/Contents/bin/../bin/PythonSlicer', '-m', 'pip', 'install', 'spatial_correlation_sampler']' returned non-zero exit status 1.```

Currently I tried installing this package in windows , where the issue is coming, but when I install the same package where I have deployed slicer in ubuntu machine, there the installation didnt have any issue