1

Fist of all, I'm a total newbie, please bear my idiocy :)

I run this:

conda env create -f env.yml 

Here's the yml file:

name: DAND
channels: !!python/tuple
- defaults
dependencies:
- _nb_ext_conf=0.3.0=py27_0
- anaconda-client=1.6.0=py27_0
- appnope=0.1.0=py27_0
- backports=1.0=py27_0
- backports_abc=0.5=py27_0
- beautifulsoup4=4.5.1=py27_0
- clyent=1.2.2=py27_0
- configparser=3.5.0=py27_0
- cycler=0.10.0=py27_0
- decorator=4.0.10=py27_1
- entrypoints=0.2.2=py27_0
- enum34=1.1.6=py27_0
- freetype=2.5.5=1
- functools32=3.2.3.2=py27_0
- get_terminal_size=1.0.0=py27_0
- icu=54.1=0
- ipykernel=4.5.2=py27_0
- ipython=5.1.0=py27_1
- ipython_genutils=0.1.0=py27_0
- ipywidgets=5.2.2=py27_0
- jinja2=2.8=py27_1
- jsonschema=2.5.1=py27_0
- jupyter=1.0.0=py27_3
- jupyter_client=4.4.0=py27_0
- jupyter_console=5.0.0=py27_0
- jupyter_core=4.2.1=py27_0
- libpng=1.6.22=0
- markupsafe=0.23=py27_2
- matplotlib=1.5.3=np111py27_1
- mistune=0.7.3=py27_1
- mkl=11.3.3=0
- nb_anacondacloud=1.2.0=py27_0
- nb_conda=2.0.0=py27_0
- nb_conda_kernels=2.0.0=py27_0
- nbconvert=4.2.0=py27_0
- nbformat=4.2.0=py27_0
- nbpresent=3.0.2=py27_0
- nltk=3.2.1=py27_0
- notebook=4.3.0=py27_0
- numpy=1.11.2=py27_0
- openssl=1.0.2j=0
- pandas=0.19.1=np111py27_0
- path.py=8.2.1=py27_0
- pathlib2=2.1.0=py27_0
- pexpect=4.0.1=py27_0
- pickleshare=0.7.4=py27_0
- pip=9.0.1=py27_1
- prompt_toolkit=1.0.9=py27_0
- ptyprocess=0.5.1=py27_0
- pygments=2.1.3=py27_0
- pymongo=3.3.0=py27_0
- pyparsing=2.1.4=py27_0
- pyqt=5.6.0=py27_1
- python=2.7.12=1
- python-dateutil=2.6.0=py27_0
- python.app=1.2=py27_4
- pytz=2016.10=py27_0
- pyyaml=3.12=py27_0
- pyzmq=16.0.2=py27_0
- qt=5.6.2=0
- qtconsole=4.2.1=py27_1
- readline=6.2=2
- requests=2.12.3=py27_0
- scikit-learn=0.17.1=np111py27_2
- scipy=0.18.1=np111py27_0
- seaborn=0.7.1=py27_0
- setuptools=27.2.0=py27_0
- simplegeneric=0.8.1=py27_1
- singledispatch=3.4.0.3=py27_0
- sip=4.18=py27_0
- six=1.10.0=py27_0
- sqlite=3.13.0=0
- ssl_match_hostname=3.4.0.2=py27_1
- terminado=0.6=py27_0
- tk=8.5.18=0
- tornado=4.4.2=py27_0
- traitlets=4.3.1=py27_0
- unicodecsv=0.14.1=py27_0
- wcwidth=0.1.7=py27_0
- wheel=0.29.0=py27_0
- widgetsnbextension=1.2.6=py27_0
- xlrd=1.0.0=py27_0
- yaml=0.1.6=0
- zlib=1.2.8=3
- pip:
  - backports-abc==0.5
  - backports.shutil-get-terminal-size==1.0.0
  - backports.ssl-match-hostname==3.4.0.2
  - ipython-genutils==0.1.0
  - jupyter-client==4.4.0
  - jupyter-console==5.0.0
  - jupyter-core==4.2.1
  - nb-anacondacloud==1.2.0
  - nb-conda==2.0.0
  - nb-conda-kernels==2.0.0
  - prompt-toolkit==1.0.9
prefix: /Users/mat/anaconda/envs/DAND

The error I run into:

Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound: 
  - jupyter_console==5.0.0=py27_0
  - freetype==2.5.5=1
  - pyzmq==16.0.2=py27_0
  - configparser==3.5.0=py27_0
  - scipy==0.18.1=np111py27_0
  - libpng==1.6.22=0
  - ...then the list goes on and list all of the dependencies in the yml file, except the ones under pip 

Things I've attempted:

  1. I got this yaml file from a Udacity online class I'm taking, I downloaded from the website, so I don't think conda env export --no-builds > env.yml method applies to me.

  2. I tried the solution in here, I simply moved everything under pip block, and run into a new error. Maybe I'm misunderstanding the solution.

The new error I run into:

Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies.  Conda may not use the correct pip to install your packages, and they may end up in the wrong place.  Please add an explicit pip dependency.  I'm adding one for you, but still nagging you.
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Ran pip subprocess with arguments:
['/Users/yulia/anaconda3/envs/DAND/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/yulia/data analysis -uda/condaenv.mo_ctuap.requirements.txt']
Pip subprocess output:

Pip subprocess error:
ERROR: Double requirement given: backports_abc==0.5=py27_0 (from -r /Users/yulia/data analysis -uda/condaenv.mo_ctuap.requirements.txt (line 12)) (already in backports-abc==0.5 (from -r /Users/yulia/data analysis -uda/condaenv.mo_ctuap.requirements.txt (line 1)), name='backports-abc')

CondaEnvException: Pip failed

I read some other posts suggesting to use pip to install the requirements.txt file, and some posts about "CondaEnvException: Pip failed" situation. But they didn't write explicit solutions, most of the time I'm really confused about those solutions.

Please let me know what I'm missing here, this is getting frustrating as I cannot set up the proper environment to continue the class. Thank you so much in advance!

kuku
  • 109
  • 1
  • 6
  • Move all the dependencies to pip and try again – bigbounty Oct 26 '19 at 13:36
  • I attempted that several times, I moved everything to pip block, indented it, and it keeps giving me the same error CondaEnvException: Pip failed – kuku Oct 26 '19 at 13:41
  • You need to first install `pip` I suppose – bigbounty Oct 26 '19 at 15:57
  • I do have pip installed ;( also I attempted to solve the "CondaEnvException: Pip failed" issue, the error message said something about double requirement given, so I tried to remove one line, then the error message become "No matching distribution found for XXX". I'm pretty sure the whole file is useless at this point, I've attempted to remove a dozen of lines and everytime the same error message, "No matching distribution found for XXX" – kuku Oct 26 '19 at 22:29
  • This `env.yml` file specifies the exact version of every package it wants to install, so if any one of those is not available from your configured conda channels then I think the whole lot is going to fail. Probably you don't need *precisely* those versions to do your course. Try editing out the version specifiers for everything except Python itself? For example change `jupyter_console==5.0.0=py27_0` to just `jupyter-console`, and so on. If that works and you're worried about version differences you can try again, this time adding some of the version specifiers back in. – nekomatic Oct 28 '19 at 09:15
  • Another option would be to try using the conda-forge channel by adding `-c conda-forge` to your `conda` command, in case the missing packages are available there. – nekomatic Oct 28 '19 at 09:16

1 Answers1

0

UPDATE

It seems that things might work better in the end when you skip using the env file. Instead, create an env with required dependencies manually, this way libraries are up-to-date and notebooks appear to work properly.

$ conda create -n DAND python=2 numpy pandas matplotlib seaborn

Look for required libraries in your course's "Setting up your system" (or similar) section. The ones in my example are based on Udacity's "Intro to Data Analysis" course.


Older answer

I had a similar problem and what eventually worked for me was adding two more channels in the channels section of this YAML file.

Before:

channels: !!python/tuple
  - defaults

After:

channels: !!python/tuple
  - defaults
  - conda-forge
  - anaconda

Then all the packages even with the version restrictions were found.


In case you get some errors about conflicting version, make sure to set conda config channel_priority to false:

$ conda config --set channel_priority false
Murdho
  • 1
  • 1
  • 2