Teichlab / cellphonedb

MIT License
340 stars 105 forks source link

Python 3.9 breaks pandas-0.23.4 dependency during cellphonedb installation #225

Closed boothbyi closed 3 years ago

boothbyi commented 3 years ago

Hi, I just wanted to let everyone know about an error I've had installing cellphonedb. I kept getting the following error while trying to install cellphonedb in virtual environments created using both miniconda and venv and on both macOS and Linux:

~/miniconda3/envs/cpdb-venv/bin/pip3 install cellphonedb
----------------------------------------
ERROR: Command errored out with exit status 1: /home/iboothby/miniconda3/envs/cpdb-venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6zdc9r21/pandas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6zdc9r21/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-f0kpy3mq/install-record.txt --single-version-externally-managed --compile --install-headers /home/iboothby/miniconda3/envs/cpdb-venv/include/python3.9/pandas Check the logs for full command output.

I eventually realized this was a python version issue and tried to downgrade to python 3.5.5, but ran into #224. Finally, installing python 3.7.9 fixed the issue.

conda install python=3.7.9

The README should be updated to specify the exact version of python that were used to develop cellphonedb and instruct users on how to specify this version within whatever virtual environment they're using to save a big headache.

coffeeCowLu commented 3 years ago

i soved it by python=3.7.8

jliu678 commented 3 years ago

God, tried too many other things before seeing this...

thanks a lot!

rachel662 commented 3 years ago

Hi there, I'm experiencing the same problem

even when I use conda install python 3.7.8 on my mac terminal I first get this error ERROR: Failed building wheel for pandas

and then this error ERROR: Command errored out with exit status 1: /Users/rachelfinlay/cpdb-venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/w9/rgff1n4j2hv2rdgkqzh38gb00000gn/T/pip-install-x_t34fvq/pandas_78a131eef8f74c389e2d317295cc9e29/setup.py'"'"'; file='"'"'/private/var/folders/w9/rgff1n4j2hv2rdgkqzh38gb00000gn/T/pip-install-x_t34fvq/pandas_78a131eef8f74c389e2d317295cc9e29/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/w9/rgff1n4j2hv2rdgkqzh38gb00000gn/T/pip-record-nurch3di/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rachelfinlay/cpdb-venv/include/site/python3.8/pandas Check the logs for full command output.

i have also tried just installing pandas 0.23.4 prior to installing cellphonedb but that doesn't seem to work either, it still fails to install even that version of pandas. I don't know if me upgrading my mac to BigSur has caused this problem?

If anyone can help me I would be really grateful thanks! Rachel

boothbyi commented 3 years ago

Hey Rachel, once you've activated your conda virtual environment, can you try running python python -V to confirm that it is running the desired version of python?

rachel662 commented 3 years ago

hi there,

It says 3.8.3

boothbyi commented 3 years ago

That might be your problem--your venv is using 3.8.3 instead of 3.7.8. Try running conda install python=3.7.8 after activating the environment and then using python -V to confirm that the python version was switched correctly.

rachel662 commented 3 years ago

I've just checked, and i don't seem to be able to switch python version - it's still on 3.8.3

rachel662 commented 3 years ago

just for context here's the error

`Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

(cpdb-venv) (base) rachel@Rachels-MBP-2 ~ % python -V Python 3.8.3 (cpdb-venv) (base) rachel@Rachels-MBP-2 ~ % `

prete commented 3 years ago

Fixed in #264