Closed zhongzheng1999 closed 3 years ago
Hi @zhongzheng1999 could you provide your versions of python (python -V
) and pandas numpy and cellphonedb (pip show pandas numpy cellphonedb
) ?
@prete My versions of python is 3.7.10. Pandas is 0.23.4. Numpy is 1.20.3. CellphoneDB is 1.1.0
Your CellPhoneDB version is quite outdated, could you try updating your CellPhoneDB to the latest version (v2.1.7)?
You can do that withpip install -U CellphoneDB
@prete I tried and it didn't work.
but I saw in another question that @mvento said it was a Windows problem!
https://github.com/Teichlab/cellphonedb/issues/142
Windows 10 is not directly supported by CellPhoneDB team because rpy2 library is not available in Windows. Please use docker image to run CellPhoneDB on Windows.
Do you think so? Thank you
C:\Users\22693>pip install -U CellphoneDB Requirement already satisfied: CellphoneDB in d:\software\program\miniconda3.0\envs\cpdb\lib\site-packages (1.1.0) Collecting CellphoneDB Using cached CellPhoneDB-2.1.7-py3-none-any.whl (12.7 MB) Collecting h5py<3.0.0 Using cached h5py-2.10.0-cp37-cp37m-win_amd64.whl (2.5 MB) Collecting boto3<1.7.99,>=1.7 Using cached boto3-1.7.84-py2.py3-none-any.whl (128 kB) Collecting geosketch==0.3 Using cached geosketch-0.3.tar.gz (7.2 kB) Collecting tqdm<4.32.99,>=4.32 Using cached tqdm-4.32.2-py2.py3-none-any.whl (50 kB) Requirement already satisfied: requests in d:\software\program\miniconda3.0\envs\cpdb\lib\site-packages (from CellphoneDB) (2.19.1) Collecting rpy2<3.0.99,>=3.0.4 Using cached rpy2-3.0.5.tar.gz (117 kB) ERROR: Command errored out with exit status 1: command: 'D:\Software\Program\Miniconda3.0\envs\cpdb\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\22693\AppData\Local\Temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\setup.py'"'"'; file='"'"'C:\Users\22693\AppData\Local\Temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\22693\AppData\Local\Temp\pip-pip-egg-info-68nllx8s' cwd: C:\Users\22693\AppData\Local\Temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\ Complete output (91 lines): c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_NaN' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_NaReal' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_NaInt' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_NaString' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_BlankString' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_BlankScalarString' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_GlobalEnv' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_EmptyEnv' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_BaseEnv' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_BaseNamespace' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_BaseNamespaceRegistry' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_NilValue' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_UnboundValue' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_MissingArg' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_ClassSymbol' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_NameSymbol' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py:165: UserWarning: Global variable 'R_DimSymbol' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern') "(usually 'extern')" % (decl.name,)) Traceback (most recent call last): File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py", line 336, in _parse ast = _get_parser().parse(fullcsource) File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\pycparser-2.20-py3.7.egg\pycparser\c_parser.py", line 152, in parse debug=debuglevel) File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\pycparser-2.20-py3.7.egg\pycparser\ply\yacc.py", line 331, in parse return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc) File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\pycparser-2.20-py3.7.egg\pycparser\ply\yacc.py", line 1199, in parseopt_notrack tok = call_errorfunc(self.errorfunc, errtoken, self) File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\pycparser-2.20-py3.7.egg\pycparser\ply\yacc.py", line 193, in call_errorfunc r = errorfunc(token) File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\pycparser-2.20-py3.7.egg\pycparser\c_parser.py", line 1861, in p_error column=self.clex.find_tok_column(p))) File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a.eggs\pycparser-2.20-py3.7.egg\pycparser\plyparser.py", line 67, in _parse_error raise ParseError("%s: %s" % (coord, msg)) pycparser.plyparser.ParseError:
:23:5: before: blah1 During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\22693\AppData\Local\Temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\setup.py", line 184, in <module>
'rpy2': ['doc/source/rpy2_logo.png', ]}
File "D:\Software\Program\Miniconda3.0\envs\cpdb\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "D:\Software\Program\Miniconda3.0\envs\cpdb\lib\distutils\core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "D:\Software\Program\Miniconda3.0\envs\cpdb\lib\site-packages\setuptools\dist.py", line 456, in __init__
k: v for k, v in attrs.items()
File "D:\Software\Program\Miniconda3.0\envs\cpdb\lib\distutils\dist.py", line 292, in __init__
self.finalize_options()
File "D:\Software\Program\Miniconda3.0\envs\cpdb\lib\site-packages\setuptools\dist.py", line 801, in finalize_options
ep(self)
File "D:\Software\Program\Miniconda3.0\envs\cpdb\lib\site-packages\setuptools\dist.py", line 808, in _finalize_setup_keywords
ep.load()(self, ep.name, value)
File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\setuptools_ext.py", line 219, in cffi_modules
add_cffi_module(dist, cffi_module)
File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\setuptools_ext.py", line 49, in add_cffi_module
execfile(build_file_name, mod_vars)
File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\setuptools_ext.py", line 25, in execfile
exec(code, glob, glob)
File "rpy/_rinterface_cffi_build.py", line 546, in <module>
""" if os.name == 'nt' else ''
File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\api.py", line 112, in cdef
self._cdef(csource, override=override, packed=packed, pack=pack)
File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\api.py", line 126, in _cdef
self._parser.parse(csource, override=override, **options)
File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py", line 389, in parse
self._internal_parse(csource)
File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py", line 394, in _internal_parse
ast, macros, csource = self._parse(csource)
File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py", line 338, in _parse
self.convert_pycparser_error(e, csource)
File "c:\users\22693\appdata\local\temp\pip-install-rch_tag9\rpy2_8edee25e0b8a48e3aebcff46ab53c75a\.eggs\cffi-1.14.5-py3.7-win-amd64.egg\cffi\cparser.py", line 367, in convert_pycparser_error
raise CDefError(msg)
cffi.CDefError: cannot parse "blah1 ReadConsole;"
<cdef source string>:23:5: before: blah1
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c7/43/401afad8556bf92b08bd7d422cacac614b0e8dd2bce31848318bbcb18f48/rpy2-3.0.5.tar.gz#sha256=c1fcd966780ebc3ea2400f73b558a801fbc17c09312f55d27b391b48fc24c8f9 (from https://pypi.org/simple/rpy2/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Hi @zhongzheng1999 you can try two things here:
a) Create the environment using the steps described here: https://github.com/Teichlab/cellphonedb/issues/270#issuecomment-785355935 and try to re-run the process. It may still yield errors in windows, but it's your best bet. Conda will gather the required binaries and packages.
b) Run CellPhoneDB in google colab like this: https://colab.research.google.com/drive/1OD1L05NDXQZbFCwGYsZQpqVYXy3-az7R?usp=sharing
Hello @prete I tried two solutions. I think creating the environment is the best way. But there are still a lot of errors.
ERROR: Command errored out with exit status 1: 'D:\Software\Program\Miniconda3.0\envs\cpdb\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\22693\AppData\Local\Temp\pip-install-1asjd8lk\pandas_5bd71de1b7a0464e96e5eec26097c20b\setup.py'"'"'; file='"'"'C:\Users\22693\AppData\Local\Temp\pip-install-1asjd8lk\pandas_5bd71de1b7a0464e96e5eec26097c20b\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\22693\AppData\Local\Temp\pip-record-nbv1vcww\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Software\Program\Miniconda3.0\envs\cpdb\Include\pandas' Check the logs for full command output. failed CondaEnvException: Pip failed
Upon checking, the environment was created successfully, but only the packages installed by the conda install command were installed. Dependent packages after PIP in the environment.yml file are not installed.
I export the package information for the PIP installation from the source environment pip list --format=freeze > requirements.txt
and pip install -r requirements.txt
.
(cpdb) C:\Users\22693>pip list Package Version
aniso8601 9.0.1 certifi 2021.5.30 chardet 3.0.4 click 6.7 Flask 1.0.4 idna 2.7 itsdangerous 2.0.1 Jinja2 3.0.1 MarkupSafe 2.0.1 numpy 1.20.3 pip 21.1.2 python-dateutil 2.8.1 pytz 2021.1 PyYAML 3.13 requests 2.19.1 setuptools 52.0.0.post20210125 six 1.16.0 SQLAlchemy 1.2.19 urllib3 1.23 Werkzeug 2.0.1 wheel 0.36.2 wincertstore 0.2
But CellphoneDB is not installed. I tried to install it manually. There are three major errors: rpy2 pandas etc.
Using cached rpy2-3.0.5.tar.gz (117 kB) ERROR: Command errored out with exit status 1: command: 'D:\Software\Program\Miniconda3.0\envs\cpdb\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\22693\AppData\Local\Temp\pip-install-x8ei5vqw\rpy2_5d66839465e94268bc94d3b8a58feef8\setup.py'"'"'; file='"'"'C:\Users\22693\AppData\Local\Temp\pip-install-x8ei5vqw\rpy2_5d66839465e94268bc94d3b8a58feef8\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\22693\AppData\Local\Temp\pip-pip-egg-info-cjizz8tm'
Building wheel for pandas (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'D:\Software\Program\Miniconda3.0\envs\cpdb\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\22693\AppData\Local\Temp\pip-install-x8ei5vqw\pandas_90712f2e944742a585913fee216da752\setup.py'"'"'; file='"'"'C:\Users\22693\AppData\Local\Temp\pip-install-x8ei5vqw\pandas_90712f2e944742a585913fee216da752\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\22693\AppData\Local\Temp\pip-wheel-m0hb94kv' cwd: C:\Users\22693\AppData\Local\Temp\pip-install-x8ei5vqw\pandas_90712f2e944742a585913fee216da752\
Exception: Cython-generated file 'pandas_libs/algos.c' not found. Cython is required to compile pandas from a development branch. Please install Cython or download a release package of pandas. pandas._libs.algos: -> [['pandas\_libs/algos.c']]
ERROR: Command errored out with exit status 1: 'D:\Software\Program\Miniconda3.0\envs\cpdb\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\22693\AppData\Local\Temp\pip-install-x8ei5vqw\pandas_90712f2e944742a585913fee216da752\setup.py'"'"'; file='"'"'C:\Users\22693\AppData\Local\Temp\pip-install-x8ei5vqw\pandas_90712f2e944742a585913fee216da752\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\22693\AppData\Local\Temp\pip-record-w_d_xxo3\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Software\Program\Miniconda3.0\envs\cpdb\Include\pandas' Check the logs for full command output.
By this time, I was desperate. Thanks for your help all the same. The second way you provided me was the first time I learned about this amazing tool, GoogleColab.
I successfully used this step to create the environment: #270 (comment).Thank you @prete
@zhongzheng1999 ,你好,我也遇到了CondaEnvException: Pip failed的问题,请问你是如何解决的?谢谢!
@Lovelock1998 哈哈,为你提供两个解决方案, 1、Run CellPhoneDB in google colab like this: https://colab.research.google.com/drive/1OD1L05NDXQZbFCwGYsZQpqVYXy3-az7R?usp=sharing 2、在你的电脑上装WSL2,然后使用cellphoneDB 3、使用cellchat 主要原因在于windows并不支持rpy2最新版本的模块,你就是拷贝别人的环境也很难完成整个环境安装,还浪费你的时间。如果你仍不能解决问题,也可以添加我的微信biozheng1999
Dear all, I ran cellphonedb with the test_counts.txt and test_meta.txt. but got this error:
Any ideas? Thank you!