kmayerb / tcrdist3

flexible CDR based distance metrics
MIT License
53 stars 17 forks source link

Installing with python 3.9.10, Avoid Numpy/Numba/Fisher package conflicts #70

Open kmayerb opened 2 years ago

kmayerb commented 2 years ago

tcrdist3 uses Numba for speed which currently requires numpy < 1.22 (see https://numba.readthedocs.io/en/stable/user/installing.html), but lower version of numpy will not work in Python 3.10, so be sure you don't use a python version > 3.9.10:

Ok on a Mac I installed tcrdist3 fresh as follows:

  1. Download Python Python 3.9.10 - Jan. 14, 2022
  2. Install Python
  3. Create venv
python3 -m venv ./tcr39
source tcr39/bin/activate
python3 -m pip install --upgrade pip
pip3 install numpy==1.20.3
pip3 install fisher==0.1.10
pip3 install numba
pip3 install tcrdist3==0.2.2

Which now works on OSX macOS Mojave 10.14.6

Python 3.9.10 (v3.9.10:f2f3f53782, Jan 13 2022, 17:02:14)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import fisher
>>> import numba
>>> import tcrdist
>>> import pandas as pd
>>> from tcrdist.repertoire import TCRrep
>>>
>>> df = pd.read_csv("dash.csv")
>>> tr = TCRrep(cell_df = df,
...             organism = 'mouse',
...             chains = ['alpha','beta'],
...             db_file = 'alphabeta_gammadelta_db.tsv')

>>>
>>> import hierdiff
(tcr39) Aueiku-MBP:~ kmayerbl$ pip3 freeze
cycler==0.11.0
dill==0.3.4
feather-format==0.4.1
fisher==0.1.10
fishersapi==0.3
fonttools==4.29.1
hierdiff==0.8
Jinja2==3.0.3
joblib==1.1.0
kiwisolver==1.3.2
llvmlite==0.38.0
MarkupSafe==2.1.0
matplotlib==3.5.1
numba==0.55.1
numpy==1.20.3
olga==1.2.4
packaging==21.3
palmotif==0.4
pandas==1.4.1
parasail==1.2.4
parmap==1.5.3
patsy==0.5.2
Pillow==9.0.1
progress==1.6
pwseqdist==0.6
pyarrow==7.0.0
pyparsing==3.0.7
python-dateutil==2.8.2
pytz==2021.3
scipy==1.8.0
six==1.16.0
statsmodels==0.13.2
svgwrite==1.4.1
tcrdist3==0.2.2
tcrsampler==0.1.9
zipdist==0.1.5

Originally posted by @kmayerb in https://github.com/kmayerb/tcrdist3/issues/69#issuecomment-1062138313

kmayerb commented 2 years ago

TODO: add to documentation page