Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with installing SCIRPY #182

Closed
taopeng1100 opened this issue Sep 16, 2020 · 40 comments
Closed

Issues with installing SCIRPY #182

taopeng1100 opened this issue Sep 16, 2020 · 40 comments
Labels
question Further information is requested

Comments

@taopeng1100
Copy link

taopeng1100 commented Sep 16, 2020

I am trying to install Scirpy using anaconda/Jupyter on my desktop window.

**when I try this: conda install -c conda-forge -c bioconda scirpy

I go the error message:**

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working... 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

Note: you may need to restart the kernel to use updated packages.


Building graph of deps:   0%|          | 0/2 [00:00<?, ?it/s]
Examining python=3.8:   0%|          | 0/2 [00:00<?, ?it/s]  
Examining scirpy:  50%|#####     | 1/2 [00:00<00:00,  2.94it/s]
Examining scirpy: 100%|##########| 2/2 [00:00<00:00,  5.88it/s]
                                                               

Determining conflicts:   0%|          | 0/2 [00:00<?, ?it/s]
Examining conflict for python scirpy:   0%|          | 0/2 [00:00<?, ?it/s]
                                                                           

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

THEN I tried this: pip install scirpy, I got another error message:

ERROR: Command errored out with exit status 1:
   command: 'C:\Users\tpeng\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tpeng\\AppData\\Local\\Temp\\pip-install-jpyjqkeg\\python-levenshtein\\setup.py'"'"'; __file__='"'"'C:\\Users\\tpeng\\AppData\\Local\\Temp\\pip-install-jpyjqkeg\\python-levenshtein\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\tpeng\AppData\Local\Temp\pip-wheel-3n51vnw0'
       cwd: C:\Users\tpeng\AppData\Local\Temp\pip-install-jpyjqkeg\python-levenshtein\
  Complete output (27 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  creating build\lib.win-amd64-3.8\Levenshtein
  copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.8\Levenshtein
  copying Levenshtein\__init__.py -> build\lib.win-amd64-3.8\Levenshtein
  running egg_info
  writing python_Levenshtein.egg-info\PKG-INFO
  writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt
  writing entry points to python_Levenshtein.egg-info\entry_points.txt
  writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt
  writing requirements to python_Levenshtein.egg-info\requires.txt
  writing top-level names to python_Levenshtein.egg-info\top_level.txt
  reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files matching '*pyc' found anywhere in distribution
  warning: no previously-included files matching '*so' found anywhere in distribution
  warning: no previously-included files matching '.project' found anywhere in distribution
  warning: no previously-included files matching '.pydevproject' found anywhere in distribution
  writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
  copying Levenshtein\_levenshtein.c -> build\lib.win-amd64-3.8\Levenshtein
  copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.8\Levenshtein
  running build_ext
  building 'Levenshtein._levenshtein' extension
  error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
  ----------------------------------------
  ERROR: Failed building wheel for python-levenshtein
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\tpeng\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tpeng\\AppData\\Local\\Temp\\pip-install-jpyjqkeg\\python-levenshtein\\setup.py'"'"'; __file__='"'"'C:\\Users\\tpeng\\AppData\\Local\\Temp\\pip-install-jpyjqkeg\\python-levenshtein\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\tpeng\AppData\Local\Temp\pip-record-spj3ycwj\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\tpeng\Anaconda3\Include\python-levenshtein'
         cwd: C:\Users\tpeng\AppData\Local\Temp\pip-install-jpyjqkeg\python-levenshtein\
    Complete output (27 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.8
    creating build\lib.win-amd64-3.8\Levenshtein
    copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.8\Levenshtein
    copying Levenshtein\__init__.py -> build\lib.win-amd64-3.8\Levenshtein
    running egg_info
    writing python_Levenshtein.egg-info\PKG-INFO
    writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt
    writing entry points to python_Levenshtein.egg-info\entry_points.txt
    writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt
    writing requirements to python_Levenshtein.egg-info\requires.txt
    writing top-level names to python_Levenshtein.egg-info\top_level.txt
    reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*pyc' found anywhere in distribution
    warning: no previously-included files matching '*so' found anywhere in distribution
    warning: no previously-included files matching '.project' found anywhere in distribution
    warning: no previously-included files matching '.pydevproject' found anywhere in distribution
    writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
    copying Levenshtein\_levenshtein.c -> build\lib.win-amd64-3.8\Levenshtein
    copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.8\Levenshtein
    running build_ext
    building 'Levenshtein._levenshtein' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\tpeng\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tpeng\\AppData\\Local\\Temp\\pip-install-jpyjqkeg\\python-levenshtein\\setup.py'"'"'; __file__='"'"'C:\\Users\\tpeng\\AppData\\Local\\Temp\\pip-install-jpyjqkeg\\python-levenshtein\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\tpeng\AppData\Local\Temp\pip-record-spj3ycwj\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\tpeng\Anaconda3\Include\python-levenshtein' Check the logs for full command output.

  Stored in directory: c:\users\tpeng\appdata\local\pip\cache\wheels\8c\51\cb\423184c62cc06c302d2f54f9853e5acee6c15a3b04d49a5eb3
  Building wheel for python-levenshtein (setup.py): started
  Building wheel for python-levenshtein (setup.py): finished with status 'error'
  Running setup.py clean for python-levenshtein
  Building wheel for yamlordereddictloader (setup.py): started
  Building wheel for yamlordereddictloader (setup.py): finished with status 'done'
  Created wheel for yamlordereddictloader: filename=yamlordereddictloader-0.4.0-py3-none-any.whl size=4058 sha256=05980b7e37960621917874dd26c59adf1eb9d304ca1f21d7c81d38adc8bc2674
  Stored in directory: c:\users\tpeng\appdata\local\pip\cache\wheels\50\9a\6f\9cb3312fd9cd01ea93c3fdc1dbee95f5fa0133125d4c7cb09a
Successfully built airr yamlordereddictloader
Failed to build python-levenshtein
Installing collected packages: yamlordereddictloader, airr, python-levenshtein, squarify, parasail, pytoml, scirpy
    Running setup.py install for python-levenshtein: started
    Running setup.py install for python-levenshtein: finished with status 'error'
@grst
Copy link
Collaborator

grst commented Sep 20, 2020

Regarding the conda installation, I suspect that you are installing scirpy into an environment that already contains some packages which cause a version conflict.

Try to install scirpy into a new conda environment:

conda create -n scirpy python=3.8
conda activate scirpy
conda install -c conda-forge -c bioconda scirpy ipykernel

You can use different conda envs from jupyter. Check out this answer on stackoverflow.


Regarding the pip installation, it's already in the error message:

Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/

Apparently, on Windows, one of the dependency packages needs to be compiled from scratch, which requires the Build Tool dependency.

Hope that helps!

@grst
Copy link
Collaborator

grst commented Oct 2, 2020

Feel free to reopen if the problem persists.

@grst grst closed this as completed Oct 2, 2020
@taopeng1100
Copy link
Author

taopeng1100 commented Oct 17, 2020 via email

@grst grst reopened this Oct 17, 2020
@grst
Copy link
Collaborator

grst commented Oct 17, 2020

are you sure you are in an empty environment with no other packages (except Python) installed?

You can check with conda env export.

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 17, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 17, 2020

that means you are not in an empty conda env and there's some package that's conflicting.
Make a new one with conda create and install scirpy there.

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 17, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 17, 2020

It can take minutes, but shouldn't take longer.

Another common source of conda problems is a wrong channel configuration. Setting up conda channels is described here:
https://bioconda.github.io/user/install.html#set-up-channels

To reset existing conda configuration, you can use conda config --remove-key channels.

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 17, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 17, 2020

Then sth is wrong. Did you check the channels as described above?

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 17, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 19, 2020

Try this to add the channels in the right order. Also you're not need the vtraag channels any more, the leiden/louvain packages are now on conda-forge.

conda config --remove-key channels
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 19, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 19, 2020

ah, you are trying to do all this within jupyter... The conda activate has no effect there.
You'll need to run that in the terminal.

You can then choose the notebook to run in the scirpy environment.
This should help:
https://stackoverflow.com/questions/39604271/conda-environments-not-showing-up-in-jupyter-notebook

If you feel that's too compilcated, you can go for the nuclear option and delete and reinstall Miniconda. However, I would recommend to familiarize yourself with environments - it saves a lot of pain in the long run.

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 19, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 19, 2020 via email

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 19, 2020 via email

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 19, 2020 via email

@grst grst added the question Further information is requested label Oct 20, 2020
@taopeng1100
Copy link
Author

taopeng1100 commented Oct 20, 2020 via email

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 22, 2020 via email

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 22, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 22, 2020

I think I've seen this error before in this issue: #137
In that case it was sth with the environment.

To rule out that you have an old version of the wu2020 dataset, can you try to delete the wu2020_3k.h5ad file from the data directory and download it again?

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 22, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 22, 2020

there should be a data directory in the same folder as your notebook. just delete that.

The dataset is downloaded again automatically when you run ir.datasets.wu2020_3k().

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 22, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 22, 2020

Hmm, tricky.

Do you exactely run the commands from the tutorial, in the same order, or do you do something (even slightly) different? If so, could you please provide the exact commands you run from the point you start python until the error occurs?

And can you provide the result of pip freeze?

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 22, 2020 via email

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 22, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 22, 2020

I think github doesn't forward attachments.. But you can drag&drop it in when you answer on the github website directly.

@taopeng1100
Copy link
Author

Scirpy_learn.pdf

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 22, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 23, 2020

I cannot reproduce the issue. In fact, I cannot even reproduce the environment. There are a lot of packages that are not available on PyPI (any more?).

Also your environment is cluttered with such a vast number of packages. The best advice I have is to start fresh and use a clean conda env (conda create) or just delete your entire Anaconda installation and install a fresh copy of Miniconda.

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 23, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 24, 2020

You can use savefig to save as pdf or other high res graphic.

ax = ir.pl.plot_something()
ax.get_figure().savefig("figure.pdf")

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 26, 2020 via email

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 27, 2020 via email

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 27, 2020 via email

@grst
Copy link
Collaborator

grst commented Oct 28, 2020

I wonder how I can see the individual clonotypes in leiden cluster “2” and “4”? How can I get the VDJ genes and CDR AA seq for the clonotypes in these two clusters?

You can filter adata.obs (it's just a pandas data frame):

adata.obs.loc[adata.obs["leiden"].isin(["2", "4"]), :]

I am trying to change the scale on both X- & Y-axis of plots using the code below:
ir.pl.repertoire_overlap(
adata, "leiden", pair_to_plot=["3", "4"], fig_kws={"dpi": 200},
ax.yaxis.set_major_locator(FixedLocator(np.arange(0, 20, 5)))
)

close ;)

ax = ir.pl.repertoire_overlap(...)
ax.yaxis.set_major_locator(FixedLocator(np.arange(0, 20, 5)))

@taopeng1100
Copy link
Author

taopeng1100 commented Oct 28, 2020 via email

@grst
Copy link
Collaborator

grst commented Dec 2, 2020

Hi @taopeng1100,

I'm closing this issue now. Feel free to reopen or create a new one if you encounter any other problems.

@grst grst closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants