nealpsmith / neals_python_functions

Random useful python functions
MIT License
0 stars 1 forks source link

A problem with tcr_genes.tsv #1

Open RachellyN opened 3 years ago

RachellyN commented 3 years ago

When trying to import the package I get the following error: (commenting out the 4 final lines in analysis/gene_sets.py solved the problem for now)

import neals_python_functions as np Traceback (most recent call last): File "", line 1, in File "/home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/neals_python_functions/init.py", line 1, in from . import ( File "/home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/neals_python_functions/analysis/init.py", line 1, in from . import ( File "/home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/neals_python_functions/analysis/gene_sets.py", line 90, in tcr_data = pd.read_csv(os.path.join(os.path.dirname(os.path.abspath(file)), "db", "tcr_genes.tsv"), sep = "\t")[["Approved symbol", "Approved name"]] File "/home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/pandas/io/parsers.py", line 676, in parser_f return _read(filepath_or_buffer, kwds) File "/home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/pandas/io/parsers.py", line 448, in _read parser = TextFileReader(fp_or_buf, kwds) File "/home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/pandas/io/parsers.py", line 880, in init self._make_engine(self.engine) File "/home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/pandas/io/parsers.py", line 1114, in _make_engine self._engine = CParserWrapper(self.f, self.options) File "/home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/pandas/io/parsers.py", line 1891, in init self._reader = parsers.TextReader(src, **kwds) File "pandas/_libs/parsers.pyx", line 374, in pandas._libs.parsers.TextReader.cinit File "pandas/_libs/parsers.pyx", line 674, in pandas._libs.parsers.TextReader._setup_parser_source FileNotFoundError: [Errno 2] File /home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/neals_python_functions/analysis/db/tcr_genes.tsv does not exist: '/home/rnormand/.conda/envs/CellBrowser_env/lib/python3.6/site-packages/neals_python_functions/analysis/db/tcr_genes.tsv'

nealpsmith commented 3 years ago

I cannot seem to replicate this error...how are you installing?

RachellyN commented 3 years ago

Through anaconda: pip install git+https://github.com/nealpsmith/neals_python_functions.git

nealpsmith commented 3 years ago

Aha! There is the problem. I'm not sure why as of now, but it doesn't work by direct pip installation like this. You need to clone the directory first

git clone https://github.com/nealpsmith/neals_python_functions.git

Then go into the repo's directory cd neals_python_functions

install it with pip

pip install -e .

That should do it. I'll update the readme to saay this and also try to figure out why other installation routes don't work.