4

I am creating a python env using conda, pip and yml config file by using first:

conda env create -f test.yml -n test_pip

then

conda env update -f test.yml -n test_pip

with the following .yml file (for test only):

channels:
- defaults
- conda-forge
dependencies:
- python=3.5
- numpy
- scipy
- scikit-learn
- jupyter
- ipykernel
- requests
- pandas
- seaborn
- click
- openpyxl
- matplotlib
- pip:
  - watermark
  - "-e git+https://github.com/slundberg/shap#egg=shap"
  - pytest
  - sklearn
  - autopep8

It works fine but the egg file is install in the current dir "src/shap/" while I would like to have it install with all other python packages installed by conda or pip:

/xxx/anaconda/envs/test_pip

I took this test github directory (I know I can install it with pip install directly) but I would like to use later my own git directory.

Why is the egg not installed here?

/xxx/anaconda/envs/test_pip/lib/python3.5/site-packages/

It is the place where I fin the other packages installed by pip and conda.

Any reason for that ? How can I changed that ?

I am using:

anaconda 4.2.0
conda 4.5.1
pip 9.0.3
Dr. Fabien Tarrade
  • 1,556
  • 6
  • 23
  • 49

1 Answers1

4

I don't see any egg file in your config. If by the "egg file" you mean git repository from github than the culprit is option -e — it installs the package in "editable mode". You probably don't need it, so the part of the config should look like this:

- pip:
    …
  - "git+https://github.com/slundberg/shap#egg=shap"
    …

PS. #egg=shap doesn't mean there is an egg file, it's just the way to name the package for pip in VCS (git in your case) URLs so pip could resolve package names and versions before it clones the repositories.

phd
  • 82,685
  • 13
  • 120
  • 165
  • I got confused by the "#egg=" but you are right I just want to install a git repository. https://stackoverflow.com/questions/2051192/what-is-a-python-egg. It works like a charm for this shap got repository and should work as well for my own git repository. I don't know why I was using "-e" and this was creating the issue. – Dr. Fabien Tarrade Jun 23 '18 at 15:19