EmanuelGoncalves/dtrace

ImportError: cannot import name 'CrispyPlot' from 'crispy'

avallonking opened this issue · 4 comments

Hi Emanuel,

When I tried doing "python3 setup.py sdist bdist_wheel", it prompted out that "ImportError: cannot import name 'CrispyPlot' from 'crispy'". I installed "crispy" from conda, but there is no "CrispyPlot" in this module. What "crispy" module are you using in your scripts? How can I install it? Thanks.

The full error information is below:

Traceback (most recent call last):
File "setup.py", line 14, in
exec(f.read(), version)
File "", line 7, in
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/dtrace/dtrace/init.py", line 7, in
from dtrace.DTracePlot import DTracePlot
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/dtrace/dtrace/DTracePlot.py", line 10, in
from crispy import CrispyPlot
ImportError: cannot import name 'CrispyPlot' from 'crispy' (/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.8/site-packages/crispy/init.py)

Hi Emanuel

I just found the "crispy" module in your repo. But it showed that I need "model_list_20200107.csv" to import crispy. Where can I find this file?

Full error message:

$ python3 setup.py sdist bdist_wheel

/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.metrics.ranking module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.metrics. Anything that cannot be imported from sklearn.metrics is now part of the private API.
warnings.warn(message, FutureWarning)
Traceback (most recent call last):
File "setup.py", line 14, in
exec(f.read(), version)
File "", line 7, in
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/dtrace/dtrace/init.py", line 7, in
from dtrace.DTracePlot import DTracePlot
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/dtrace/dtrace/DTracePlot.py", line 10, in
from crispy import CrispyPlot
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/crispy/init.py", line 8, in
from crispy.QCPlot import QCplot
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/crispy/QCPlot.py", line 15, in
from crispy.CrispyPlot import CrispyPlot
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/crispy/CrispyPlot.py", line 14, in
class CrispyPlot:
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/crispy/CrispyPlot.py", line 91, in CrispyPlot
natsorted(list(Sample().samplesheet["cancer_type"].value_counts().index)),
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/crispy/DataImporter.py", line 37, in init
pd.read_csv(f"{DPATH}/{samplesheet_file}")
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/pandas/io/parsers.py", line 676, in parser_f
return _read(filepath_or_buffer, kwds)
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/pandas/io/parsers.py", line 448, in _read
parser = TextFileReader(fp_or_buf, **kwds)
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/pandas/io/parsers.py", line 880, in init
self._make_engine(self.engine)
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/pandas/io/parsers.py", line 1114, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/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 /u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/crispy/data//model_list_20200107.csv does not exist: '/u/project/eeskin2/k8688933/sanofi/crispr-screening/envs/lib/python3.7/site-packages/crispy/data//model_list_20200107.csv'

Hi,

Thanks for reporting this. Indeed Crispy (Cy) is a dependency and it's listed on the requirements.txt file so I expected it to be automatically installed. That file is outdated and was removed, I've updated Crispy, try to reinstall it.

ImportError: cannot import name 'CrispyPlot' from 'crispy'

Hi Emanuel,
I also have a problem 'ImportError: cannot import name 'CrispyPlot' from 'crispy''