I am experiencing an extremely weird situation, I have a working environment and all work just fine. Recently I clone this environment from this guy and try to duplicate it and attempt to install tensorflow. But, the new env does not work, the worst part is that the old working env stops working!

Here are the commands I used:

  • This installation is unsuccessful, therefore, I am copying one existing virtual environment
  • scanpyBasic
  • ======================================================
  • Step 1: conda create -n myDeepLearning python=3.9
  • Step 2: accept all the NEW packages
  • Step 3: It prompts that “my conda is out of date”, need to upgrate conda by doing
  • Step 3.1: conda install conda=25.3.1
  • Step 4: conda activate myDeepLearning
  • Step 4.1: pip install –upgrade pip
  • Step 5: pip install jupyter
  • Step 5: pip install tensorflow
  • Step 6: conda deactivate
  • ======================================================
  • I am deleting it and copying one existing virtual environment scanpyBasic
  • ======================================================
  • conda env remove –name myDeepLearning
  • Step 1: conda activate scanpyBasic
  • Step 2: pip freeze > requirements.txt
  • Step 3: conda activate scanpyBasic
  • Step 4: pip freeze > requiresment.txt
  • Step 5: conda deactivate
  • Step 6: conda activate myDeepLearning
  • Step 7 pip install -r requirements.txt

The problem is both env do not working, with scanpy module in particular. With my colleague’s help, it is weird:

(scanpyBasic) [li11@cn040701/ib01 ~]$ python3 -c “import scanpy as sc”
Traceback (most recent call last):
  File “<string>”, line 1, in <module>
  File “/ddn/gs1/home/li11/miniconda3/envs/scanpyBasic/lib/python3.9/site-packages/scanpy/__init__.py”, line 20, in <module>
    from ._utils import check_versions
  File “/ddn/gs1/home/li11/miniconda3/envs/scanpyBasic/lib/python3.9/site-packages/scanpy/_utils/__init__.py”, line 34, in <module>
    from anndata import AnnData
  File “/ddn/gs1/home/li11/.local/lib/python3.9/site-packages/anndata/__init__.py”, line 7, in <module>
    from ._core.anndata import AnnData
  File “/ddn/gs1/home/li11/.local/lib/python3.9/site-packages/anndata/_core/anndata.py”, line 17, in <module>
    import h5py
ModuleNotFoundError: No module named ‘h5py’

Now, I am in my virtual env “scanpyBasic”; it seems that it tries to load module anndata from my base python library. Why??


Leave a Reply

Your email address will not be published. Required fields are marked *