Slicer-Python Packages Use and Install

(ZiyunLiang) #43

Hi, I’m having the same problem when I try to install packages to my computer. I tried the pip way as you described but it did not work for me. No matter what package I try to install, it always report to following errors:
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ‘/private/var/folders/4m/3zz84kjj0rb8r7twkxksmplw0000gn/T/pip-req-tracker-dVJBGY/39e3ab1dfb11346e7d530d2e1ee1ef3dc8bbf9578e5f497994026cda’
and some times like this: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: ‘/Volumes/Slicer-4.10.0-macosx-amd64/’
I was wondering if this is because I didn’t run slicer as an administrator. I’m using mac and when I right click on the icon, I didn’t see more and run as administrator. Does anyone know to run slicer on mac as an administrator? And does anyone know how to fix this error?
Please help.


(Steve Pieper) #44

Hi - it looks like you didn’t drag the application to a writable location.

(ZiyunLiang) #45

Hi, Thank you for the advice! I checked and I think Slicer is at a writable location right now. And I also tried to open it as an administrator by command Applications andrealiang$ sudo open at the terminal. But I still get the following error:
Requirement already satisfied: pandas in ./ (0.24.1)

Requirement already satisfied: python-dateutil>=2.5.0 in ./ (from pandas) (2.8.0)

Requirement already satisfied: numpy>=1.12.0 in ./ (from pandas) (1.13.1)

Requirement already satisfied: pytz>=2011k in ./ (from pandas) (2018.9)

Requirement already satisfied: six>=1.5 in ./ (from python-dateutil>=2.5.0->pandas) (1.11.0)

Collecting importlib

Using cached

Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ‘/private/var/folders/4m/3zz84kjj0rb8r7twkxksmplw0000gn/T/pip-req-tracker-rEfQlE/20483040384e67f98bad799531b988be6a42bb897823a965fb554d64’

It looks like it has already installed the package pandas, but is having trouble with the second package. Does anyone know how to fix this bug?


(ZiyunLiang) #46

Hi everyone, after days of trying, my problem is solved in two ways. And I’d like to share my solutions with you.

  1. As for me, I’m using mac, and to successfully install the packages, mac users need to put the software in the directory Users/yourname/Applications rather than /Applications. Or if your software is in the directory /Applications, you can open it by option+open
  2. you can use multithreading, which is to run Python script using a non-Slicer Python environment as described here.
(Alex Vergara) #47

I don’t get your point, no matter what I am not able to run multithreading, all packages run in a single processor even if they split threads. I have tried with multiprocessing, cython, numba, ipyparallel, joblib, handythreads. Everything has same behaviour, yes they can be installed but multithreading is just not working. Using an external python for this is not efficient since you have to pass big arrays (files). Can you elaborate more this point please?

(Andras Lasso) #48

Have you actually measured the time to pass large arrays through files? My experience is that if you don’t use compression then it works extremely fast. I guess that pickling of numpy arrays is quite well optimized, too. If you find that data transfer is the performance bottleneck then you can go lower level and use shared memory transfer.

(Roberta) #50

Hi!! i have 4.11 slicer version. I’d like to know if there is a way to display the spect / ct on slicer

(Alex Vergara) #53

@roberta Please create a new thread with your question and please gives us more information on what you want to do so we can help you.