Closed fabianegli closed 1 year ago
This is a documentation of the odyssey to reproduce the environment necessary to reproduce the Jupyter notebook in the original repository:
python3.10 -m venv venv
source venv/bin/activate
pip install -U pip
(Luckily we already have a .gitignore that is made for Python development so we can create the venv in the repository's root straight away.) 5. Get JupyterLab
pip install jupyterlab
NB: They should have done a
pip freeze
orconda export
at least to record the used versions and indicated the OS. Other options like using thewatermark
package would also have helped. Of course even better would be a containerization approach of some sorts. But we'll get there later???
For this purpose lets create a env yaml file for conda
% conda create --name scprep python=3.8.2
% conda activate scprep
(scprep) % python -V
Python 3.8.2
reproduce-single-cell-proteomics.yaml
:
name: scprep
channels:
- conda-forge
- defaults
dependencies:
- anndata
- jupyterlab
- matplotlib
- numpy
- pandas
- python=3.8.2
- scanpy=1.8.2
- scipy
- seaborn
- scikit-learn
conda env create --file reproduce-single-cell-proteomics.yaml
conda activate scprep
Then start JupyterLab
% jupyter lab
Open the notebook.
Running the imports raises a SystemError.
SystemError: initialization of _internal failed without raising an exception
According to https://stackoverflow.com/a/74982146/6018688 it might be a numpy issue. The proposed solution is to downgrade numpy to 1.23.5 (currently installed is 1.24.1).
conda install numpy=1.23.5
Retry the notebook import cell.
Now the import works, so the question and the answer on StackOverflow get an upvote.
But there's this warning:
MatplotlibDeprecationWarning: The seaborn styles shipped by Matplotlib are deprecated since 3.6, as they no longer correspond to the styles shipped by seaborn. However, they will remain available as 'seaborn-v0_8-
It would be nice to have one - or multiple - easy ways to set up a Python environment that can run the code.