almaan / stereoscope

Spatial mapping of cell types by integration of transcriptomics data
MIT License
87 stars 26 forks source link

Error while running ./setup.py install --user #21

Closed Roopali24 closed 3 years ago

Roopali24 commented 3 years ago

When I run this command: ./setup.py install --user I get the following error: Setup script exited with error: SandboxViolation: mkdir('/Users/roopalisingh/Library/Caches/com.apple.python/private', 511) {}

The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available.

Please help me how to fix this issue.

almaan commented 3 years ago

Hey @Roopali24,

I think you would have to be a bit more specific for me to be able to help you. Like versions of python and setuptools. My first recommendation would be to try and update the setuptools package, second I'd advice you to check whether all the dependencies are of steroscope are installed and if not perhaps install them manually.

To upgrade your setuptoolsvia pip do: pip install setuptools --upgrade (add the --user flag if you want local install). Sometimes one needs to specify which pipyou want to use e.g., pip3.

LMK how things worked out for you!

Roopali24 commented 3 years ago

Hi @almaan thank you for your reply. As it turns out it was an old python (2.7) so I installed python 3.9 and also upgraded setuptools using pip3. Now when I run command stereoscope test, it ends with the following error: ModuleNotFoundError: No module named 'torch'

But I know that I have torch installed and when I open python3 in my terminal and run import torch as t it runs just fine.

Do you know why that might be the case? I am using Mac OS Catalina if that matters.

almaan commented 3 years ago

Glad to hear it worked out (partially) for you! This is a bit of a puzzling issue, but to me it seems as if you might have conflicting python versions - one being loaded by the python3 command and another when you run stereoscope. Since I'm not able to check all of you paths - for obvious reasons - maybe I could suggest to do the following:

  1. Uninstall stereoscope completely
  2. Open up the python interpreter with python3
  3. Do import torch as t; t.__path__ . This will print something like [/home/user/.local/lib/python3.7/site-packages/torch] , copy that full path but except for the torchpart. I.e., in for the example above it would be /home/user/.local/lib/python3.7/site-packages.
  4. Exit the python interpreter and go to the stereoscope folder where the setup.py file is located
  5. run ./setup.py install --install-lib /home/user/.local/lib/python3.7/site-packages --user
  6. If there are any complaints about your PYTHONPATH variable, you could try adding export PYTHONPATH="/home/user/.local/lib/python3.7/site-packages" and repeat step 5.

Maybe that could work for you.

Best A

Roopali24 commented 3 years ago

You were right, it seems like that was the issue. Now stereoscope is successfully installed. Thank you so much.

almaan commented 3 years ago

Great to hear that, I'll close this issue then!