frankligy / scTriangulate

scTriangulate is a Python package to mix-and-match conflicting clustering results in single cell analysis and generate reconciled clustering solutions
MIT License
35 stars 5 forks source link

pip install failed in windows (annoy package, Visual C++ 14.0 required) #20

Open chalmers4c opened 1 year ago

chalmers4c commented 1 year ago

Hello

I tried to pip install the package in spyder. But it failed, below is lines from console. tried .whl or the .gz, both failed.

pip install scTriangulate Collecting scTriangulate Using cached sctriangulate-0.12.0-py3-none-any.whl (152 kB) Collecting anytree Using cached anytree-2.8.0-py2.py3-none-any.whl (41 kB) Collecting mygene==3.2.2 Using cached mygene-3.2.2-py2.py3-none-any.whl (5.4 kB) Collecting yattag Using cached yattag-1.14.0-py3-none-any.whl Collecting gseapy==0.10.4 Using cached gseapy-0.10.4-py3-none-any.whl (525 kB) Collecting squidpy==1.2.0 Using cached squidpy-1.2.0-py3-none-any.whl (179 kB) Collecting scrublet==0.2.3 Using cached scrublet-0.2.3-py3-none-any.whl (15 kB) Requirement already satisfied: bioservices in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from gseapy==0.10.4->scTriangulate) (1.10.4) Requirement already satisfied: numpy>=1.13.0 in c:\users\chalmers\anaconda3\lib\site-packages (from gseapy==0.10.4->scTriangulate) (1.21.5) Requirement already satisfied: scipy in c:\users\chalmers\anaconda3\lib\site-packages (from gseapy==0.10.4->scTriangulate) (1.9.1) Requirement already satisfied: joblib in c:\users\chalmers\anaconda3\lib\site-packages (from gseapy==0.10.4->scTriangulate) (1.1.0) Requirement already satisfied: requests in c:\users\chalmers\anaconda3\lib\site-packages (from gseapy==0.10.4->scTriangulate) (2.28.1) Requirement already satisfied: pandas in c:\users\chalmers\anaconda3\lib\site-packages (from gseapy==0.10.4->scTriangulate) (1.4.4) Requirement already satisfied: matplotlib in c:\users\chalmers\anaconda3\lib\site-packages (from gseapy==0.10.4->scTriangulate) (3.5.2) Requirement already satisfied: biothings-client>=0.2.6 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from mygene==3.2.2->scTriangulate) (0.2.6) Requirement already satisfied: numba in c:\users\chalmers\anaconda3\lib\site-packages (from scrublet==0.2.3->scTriangulate) (0.55.1) Requirement already satisfied: scikit-learn in c:\users\chalmers\anaconda3\lib\site-packages (from scrublet==0.2.3->scTriangulate) (1.0.2) Requirement already satisfied: umap-learn in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from scrublet==0.2.3->scTriangulate) (0.5.3) Requirement already satisfied: cython in c:\users\chalmers\anaconda3\lib\site-packages (from scrublet==0.2.3->scTriangulate) (0.29.32) Requirement already satisfied: scikit-image in c:\users\chalmers\anaconda3\lib\site-packages (from scrublet==0.2.3->scTriangulate) (0.19.2) Collecting annoy Using cached annoy-1.17.1.tar.gz (647 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: statsmodels>=0.12.0 in c:\users\chalmers\anaconda3\lib\site-packages (from squidpy==1.2.0->scTriangulate) (0.13.2) Requirement already satisfied: dask-image>=0.5.0 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from squidpy==1.2.0->scTriangulate) (2022.9.0) Requirement already satisfied: leidenalg>=0.8.2 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from squidpy==1.2.0->scTriangulate) (0.9.0) Requirement already satisfied: omnipath>=1.0.5 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from squidpy==1.2.0->scTriangulate) (1.0.5) Requirement already satisfied: typing-extensions in c:\users\chalmers\anaconda3\lib\site-packages (from squidpy==1.2.0->scTriangulate) (4.3.0) Requirement already satisfied: xarray>=0.16.1 in c:\users\chalmers\anaconda3\lib\site-packages (from squidpy==1.2.0->scTriangulate) (0.20.1) Requirement already satisfied: docrep>=0.3.1 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from squidpy==1.2.0->scTriangulate) (0.3.2) Requirement already satisfied: anndata>=0.7.4 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from squidpy==1.2.0->scTriangulate) (0.8.0) Requirement already satisfied: fsspec>=2021.11.0 in c:\users\chalmers\anaconda3\lib\site-packages (from squidpy==1.2.0->scTriangulate) (2022.7.1) Requirement already satisfied: tifffile in c:\users\chalmers\anaconda3\lib\site-packages (from squidpy==1.2.0->scTriangulate) (2021.7.2) Collecting aiohttp>=3.8.1 Downloading aiohttp-3.8.3-cp39-cp39-win_amd64.whl (323 kB) -------------------------------------- 323.5/323.5 kB 5.0 MB/s eta 0:00:00 Requirement already satisfied: scanpy>=1.8.0 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from squidpy==1.2.0->scTriangulate) (1.9.1) Requirement already satisfied: tqdm>=4.50.2 in c:\users\chalmers\anaconda3\lib\site-packages (from squidpy==1.2.0->scTriangulate) (4.64.1) Requirement already satisfied: dask[array]>=2021.02.0 in c:\users\chalmers\anaconda3\lib\site-packages (from squidpy==1.2.0->scTriangulate) (2022.7.0) Requirement already satisfied: matplotlib-scalebar>=0.8.0 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from squidpy==1.2.0->scTriangulate) (0.8.1) Requirement already satisfied: zarr>=2.6.1 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from squidpy==1.2.0->scTriangulate) (2.13.3) Requirement already satisfied: validators>=0.18.2 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from squidpy==1.2.0->scTriangulate) (0.20.0) Requirement already satisfied: Pillow in c:\users\chalmers\anaconda3\lib\site-packages (from squidpy==1.2.0->scTriangulate) (9.2.0) Requirement already satisfied: networkx>=2.6.0 in c:\users\chalmers\anaconda3\lib\site-packages (from squidpy==1.2.0->scTriangulate) (2.8.4) Requirement already satisfied: six>=1.9.0 in c:\users\chalmers\anaconda3\lib\site-packages (from anytree->scTriangulate) (1.16.0) Requirement already satisfied: attrs>=17.3.0 in c:\users\chalmers\anaconda3\lib\site-packages (from aiohttp>=3.8.1->squidpy==1.2.0->scTriangulate) (21.4.0) Collecting async-timeout<5.0,>=4.0.0a3 Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB) Collecting aiosignal>=1.1.2 Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB) Requirement already satisfied: charset-normalizer<3.0,>=2.0 in c:\users\chalmers\anaconda3\lib\site-packages (from aiohttp>=3.8.1->squidpy==1.2.0->scTriangulate) (2.0.4) Collecting yarl<2.0,>=1.0 Downloading yarl-1.8.1-cp39-cp39-win_amd64.whl (56 kB) ---------------------------------------- 56.7/56.7 kB ? eta 0:00:00 Collecting frozenlist>=1.1.1 Downloading frozenlist-1.3.3-cp39-cp39-win_amd64.whl (34 kB) Collecting multidict<7.0,>=4.5 Downloading multidict-6.0.2-cp39-cp39-win_amd64.whl (28 kB) Requirement already satisfied: h5py>=3 in c:\users\chalmers\anaconda3\lib\site-packages (from anndata>=0.7.4->squidpy==1.2.0->scTriangulate) (3.7.0) Requirement already satisfied: natsort in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from anndata>=0.7.4->squidpy==1.2.0->scTriangulate) (8.2.0) Requirement already satisfied: packaging>=20 in c:\users\chalmers\anaconda3\lib\site-packages (from anndata>=0.7.4->squidpy==1.2.0->scTriangulate) (21.3) Requirement already satisfied: pims>=0.4.1 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from dask-image>=0.5.0->squidpy==1.2.0->scTriangulate) (0.6.1) Requirement already satisfied: pyyaml>=5.3.1 in c:\users\chalmers\anaconda3\lib\site-packages (from dask[array]>=2021.02.0->squidpy==1.2.0->scTriangulate) (6.0) Requirement already satisfied: partd>=0.3.10 in c:\users\chalmers\anaconda3\lib\site-packages (from dask[array]>=2021.02.0->squidpy==1.2.0->scTriangulate) (1.2.0) Requirement already satisfied: toolz>=0.8.2 in c:\users\chalmers\anaconda3\lib\site-packages (from dask[array]>=2021.02.0->squidpy==1.2.0->scTriangulate) (0.11.2) Requirement already satisfied: cloudpickle>=1.1.1 in c:\users\chalmers\anaconda3\lib\site-packages (from dask[array]>=2021.02.0->squidpy==1.2.0->scTriangulate) (2.0.0) Requirement already satisfied: igraph<0.11,>=0.10.0 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from leidenalg>=0.8.2->squidpy==1.2.0->scTriangulate) (0.10.2) Requirement already satisfied: setuptools in c:\users\chalmers\anaconda3\lib\site-packages (from numba->scrublet==0.2.3->scTriangulate) (63.4.1) Requirement already satisfied: llvmlite<0.39,>=0.38.0rc1 in c:\users\chalmers\anaconda3\lib\site-packages (from numba->scrublet==0.2.3->scTriangulate) (0.38.0) Requirement already satisfied: wrapt>=1.12.0 in c:\users\chalmers\anaconda3\lib\site-packages (from omnipath>=1.0.5->squidpy==1.2.0->scTriangulate) (1.14.1) Requirement already satisfied: inflect>=4.1.0 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from omnipath>=1.0.5->squidpy==1.2.0->scTriangulate) (6.0.2) Requirement already satisfied: urllib3>=1.26.0 in c:\users\chalmers\anaconda3\lib\site-packages (from omnipath>=1.0.5->squidpy==1.2.0->scTriangulate) (1.26.11) Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\chalmers\anaconda3\lib\site-packages (from pandas->gseapy==0.10.4->scTriangulate) (2.8.2) Requirement already satisfied: pytz>=2020.1 in c:\users\chalmers\anaconda3\lib\site-packages (from pandas->gseapy==0.10.4->scTriangulate) (2022.1) Requirement already satisfied: idna<4,>=2.5 in c:\users\chalmers\anaconda3\lib\site-packages (from requests->gseapy==0.10.4->scTriangulate) (3.3) Requirement already satisfied: certifi>=2017.4.17 in c:\users\chalmers\anaconda3\lib\site-packages (from requests->gseapy==0.10.4->scTriangulate) (2022.9.14) Requirement already satisfied: patsy in c:\users\chalmers\anaconda3\lib\site-packages (from scanpy>=1.8.0->squidpy==1.2.0->scTriangulate) (0.5.2) Requirement already satisfied: session-info in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from scanpy>=1.8.0->squidpy==1.2.0->scTriangulate) (1.0.0) Requirement already satisfied: seaborn in c:\users\chalmers\anaconda3\lib\site-packages (from scanpy>=1.8.0->squidpy==1.2.0->scTriangulate) (0.11.2) Requirement already satisfied: cycler>=0.10 in c:\users\chalmers\anaconda3\lib\site-packages (from matplotlib->gseapy==0.10.4->scTriangulate) (0.11.0) Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\chalmers\anaconda3\lib\site-packages (from matplotlib->gseapy==0.10.4->scTriangulate) (1.4.2) Requirement already satisfied: fonttools>=4.22.0 in c:\users\chalmers\anaconda3\lib\site-packages (from matplotlib->gseapy==0.10.4->scTriangulate) (4.25.0) Requirement already satisfied: pyparsing>=2.2.1 in c:\users\chalmers\anaconda3\lib\site-packages (from matplotlib->gseapy==0.10.4->scTriangulate) (3.0.9) Requirement already satisfied: imageio>=2.4.1 in c:\users\chalmers\anaconda3\lib\site-packages (from scikit-image->scrublet==0.2.3->scTriangulate) (2.19.3) Requirement already satisfied: PyWavelets>=1.1.1 in c:\users\chalmers\anaconda3\lib\site-packages (from scikit-image->scrublet==0.2.3->scTriangulate) (1.3.0) Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\chalmers\anaconda3\lib\site-packages (from scikit-learn->scrublet==0.2.3->scTriangulate) (2.2.0) Requirement already satisfied: colorama in c:\users\chalmers\anaconda3\lib\site-packages (from tqdm>=4.50.2->squidpy==1.2.0->scTriangulate) (0.4.5) Requirement already satisfied: pynndescent>=0.5 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from umap-learn->scrublet==0.2.3->scTriangulate) (0.5.8) Requirement already satisfied: decorator>=3.4.0 in c:\users\chalmers\anaconda3\lib\site-packages (from validators>=0.18.2->squidpy==1.2.0->scTriangulate) (5.1.1) Requirement already satisfied: fasteners in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from zarr>=2.6.1->squidpy==1.2.0->scTriangulate) (0.18) Requirement already satisfied: asciitree in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from zarr>=2.6.1->squidpy==1.2.0->scTriangulate) (0.3.3) Requirement already satisfied: numcodecs>=0.10.0 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from zarr>=2.6.1->squidpy==1.2.0->scTriangulate) (0.10.2) Requirement already satisfied: suds-community>=0.7 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from bioservices->gseapy==0.10.4->scTriangulate) (1.1.2) Requirement already satisfied: xmltodict in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from bioservices->gseapy==0.10.4->scTriangulate) (0.13.0) Requirement already satisfied: requests-cache in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from bioservices->gseapy==0.10.4->scTriangulate) (0.9.7) Requirement already satisfied: lxml in c:\users\chalmers\anaconda3\lib\site-packages (from bioservices->gseapy==0.10.4->scTriangulate) (4.9.1) Requirement already satisfied: grequests in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from bioservices->gseapy==0.10.4->scTriangulate) (0.6.0) Requirement already satisfied: easydev>=0.12.0 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from bioservices->gseapy==0.10.4->scTriangulate) (0.12.0) Requirement already satisfied: beautifulsoup4 in c:\users\chalmers\anaconda3\lib\site-packages (from bioservices->gseapy==0.10.4->scTriangulate) (4.11.1) Requirement already satisfied: appdirs in c:\users\chalmers\anaconda3\lib\site-packages (from bioservices->gseapy==0.10.4->scTriangulate) (1.4.4) Requirement already satisfied: colorlog in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from bioservices->gseapy==0.10.4->scTriangulate) (6.7.0) Requirement already satisfied: pexpect in c:\users\chalmers\anaconda3\lib\site-packages (from easydev>=0.12.0->bioservices->gseapy==0.10.4->scTriangulate) (4.8.0) Requirement already satisfied: texttable>=1.6.2 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from igraph<0.11,>=0.10.0->leidenalg>=0.8.2->squidpy==1.2.0->scTriangulate) (1.6.7) Requirement already satisfied: pydantic>=1.9.1 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from inflect>=4.1.0->omnipath>=1.0.5->squidpy==1.2.0->scTriangulate) (1.10.2) Requirement already satisfied: entrypoints in c:\users\chalmers\anaconda3\lib\site-packages (from numcodecs>=0.10.0->zarr>=2.6.1->squidpy==1.2.0->scTriangulate) (0.4) Requirement already satisfied: locket in c:\users\chalmers\anaconda3\lib\site-packages (from partd>=0.3.10->dask[array]>=2021.02.0->squidpy==1.2.0->scTriangulate) (1.0.0) Requirement already satisfied: slicerator>=0.9.8 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from pims>=0.4.1->dask-image>=0.5.0->squidpy==1.2.0->scTriangulate) (1.1.0) Requirement already satisfied: soupsieve>1.2 in c:\users\chalmers\anaconda3\lib\site-packages (from beautifulsoup4->bioservices->gseapy==0.10.4->scTriangulate) (2.3.1) Requirement already satisfied: gevent in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from grequests->bioservices->gseapy==0.10.4->scTriangulate) (22.10.2) Requirement already satisfied: cattrs>=22.2 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from requests-cache->bioservices->gseapy==0.10.4->scTriangulate) (22.2.0) Requirement already satisfied: url-normalize>=1.4 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from requests-cache->bioservices->gseapy==0.10.4->scTriangulate) (1.4.3) Requirement already satisfied: stdlib-list in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from session-info->scanpy>=1.8.0->squidpy==1.2.0->scTriangulate) (0.8.0) Requirement already satisfied: exceptiongroup in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from cattrs>=22.2->requests-cache->bioservices->gseapy==0.10.4->scTriangulate) (1.0.4) Requirement already satisfied: zope.interface in c:\users\chalmers\anaconda3\lib\site-packages (from gevent->grequests->bioservices->gseapy==0.10.4->scTriangulate) (5.4.0) Requirement already satisfied: greenlet>=2.0.0 in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from gevent->grequests->bioservices->gseapy==0.10.4->scTriangulate) (2.0.1) Requirement already satisfied: cffi>=1.12.2 in c:\users\chalmers\anaconda3\lib\site-packages (from gevent->grequests->bioservices->gseapy==0.10.4->scTriangulate) (1.15.1) Requirement already satisfied: zope.event in c:\users\chalmers\appdata\roaming\python\python39\site-packages (from gevent->grequests->bioservices->gseapy==0.10.4->scTriangulate) (4.5.0) Requirement already satisfied: ptyprocess>=0.5 in c:\users\chalmers\anaconda3\lib\site-packages (from pexpect->easydev>=0.12.0->bioservices->gseapy==0.10.4->scTriangulate) (0.7.0) Requirement already satisfied: pycparser in c:\users\chalmers\anaconda3\lib\site-packages (from cffi>=1.12.2->gevent->grequests->bioservices->gseapy==0.10.4->scTriangulate) (2.21) Building wheels for collected packages: annoy Building wheel for annoy (setup.py): started Building wheel for annoy (setup.py): finished with status 'error' Running setup.py clean for annoy Failed to build annoy Installing collected packages: yattag, annoy, multidict, frozenlist, async-timeout, anytree, yarl, aiosignal, mygene, aiohttp, scrublet, gseapy, squidpy, scTriangulate Running setup.py install for annoy: started Running setup.py install for annoy: finished with status 'error' Note: you may need to restart the kernel to use updated packages. error: subprocess-exited-with-error

python setup.py bdist_wheel did not run successfully. exit code: 1

[12 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\annoy copying annoy__init.py -> build\lib.win-amd64-cpython-39\annoy copying annoy\init__.pyi -> build\lib.win-amd64-cpython-39\annoy copying annoy\py.typed -> build\lib.win-amd64-cpython-39\annoy running build_ext building 'annoy.annoylib' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for annoy error: subprocess-exited-with-error

Running setup.py install for annoy did not run successfully. exit code: 1

[14 lines of output] running install C:\Users\Chalmers\anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\annoy copying annoy__init.py -> build\lib.win-amd64-cpython-39\annoy copying annoy\init__.pyi -> build\lib.win-amd64-cpython-39\annoy copying annoy\py.typed -> build\lib.win-amd64-cpython-39\annoy running build_ext building 'annoy.annoylib' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

Encountered error while trying to install package.

annoy

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

frankligy commented 1 year ago

Hello @chalmers4c,

Thanks for reaching out and sorry about the inconvenience!

I tested the pip install on my mac today and it is successful macos_install.txt, but then I realize from your question that you are using Windows PC. So I tested on my windows and I am able to replicate your error, as the error indicates, we may need to first properly install Microsoft Visual C++ 14.0 for compiling annoy package.

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

I use Windows very rarely, so let me dig into that a bit to see if I can provide some instructions on how to update the Visual C++ tool. While waiting for me, if possible, you may switch to a macOS or Linux system which we have tested multiple times. I will get back to you as soon as I can.

Best, Frank

frankligy commented 1 year ago

Hello @chalmers4c,

So here's the solution that works for me, I followed the instructions on this page (https://stackoverflow.com/questions/64261546/how-to-solve-error-microsoft-visual-c-14-0-or-greater-is-required-when-inst). I went to (https://visualstudio.microsoft.com/visual-cpp-build-tools/) and download the c++ tool, follow the prompt. After that, annoy can be successfully built and sctriangulate is successfully installed. See this windows_install.txt

Let me know if I can help with anything else!

chalmers4c commented 1 year ago

Hello

I installed the package successfully on my PC! Thank you so much!