Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yaml dependency problem #237

Open
emiliom opened this issue Jun 25, 2019 · 7 comments
Open

yaml dependency problem #237

emiliom opened this issue Jun 25, 2019 · 7 comments
Milestone

Comments

@emiliom
Copy link
Member

emiliom commented Jun 25, 2019

I'm running into a strange problem with the yaml package, when creating a conda environment for wofpy. Hopefully this problem will be familiar to you (I'm guessing it's not specific to wofpy).

I've created a wofpy conda env the usual way:
conda create -n wofpy -c conda-forge python=2.7 wofpy

yaml is installed:

(wofpy) $ conda list | grep yaml
yaml                      0.1.7             h14c3975_1001    conda-forge

But import yaml produces the error "ImportError: No module named yaml".

I tried explicitly installing yaml after creating the env, but the response was that it was already installed:

(wofpy) $ conda install -c conda-forge yaml
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.

I ran into this yesterday on two independent Ubuntu machines (my laptop and a server), with conda environments created within a two-hour period.

@emiliom
Copy link
Member Author

emiliom commented Jun 25, 2019

From @ocefpaf:

The yaml package is not a python package and we need to fix the wofpy
dependency declaration.
That is the C yaml, see
https://github.com/conda-forge/yaml-feedstock/blob/master/recipe/meta.yaml

What you want is pyyaml. I'll send a PR to fix the package.

@emiliom
Copy link
Member Author

emiliom commented Jun 25, 2019

I was seeing references to pyyaml in the discussions I found. But I was assuming the wofpy dependency declaration was fine, b/c we used it a lot when developing (or installing) wofpy.

From @ocefpaf:
On second thought yaml/pyyaml does not depend on yaml at all.
Only one example uses it but that is not core code.

@emiliom
Copy link
Member Author

emiliom commented Jun 25, 2019

@ocefpaf, since it turned out to be a problem with wofpy directly, I've opened this issue and copied over our exchanges so far. Thanks again!

@ocefpaf
Copy link
Member

ocefpaf commented Jun 25, 2019

yaml, via pyyaml, is only imported in

, and that is an example, not core code. If yaml is really needed to run WOFpy it is an indirect dependency then, is that correct?

@emiliom
Copy link
Member Author

emiliom commented Jun 25, 2019

It's correct that odm2/timeseries/odm2_timeseries_dao.py is not part of the core WOFpy, strictly speaking. But it's more than an example. It's the template "Data Access Object" (DAO) for reading an ODM2 timeseries database, where ODM2 is our primary target for WOFpy. Also, that same code should eventually be added to

def __init__(self, db_connection_string):

But that DAO hasn't been as fully developed and tested as odm2/timeseries (there's actually a PR from Miguel with improvements to it, but I haven't merged it yet because it needs to be broken up).

Anyway, let's add pyyaml to the build. It's lightweight anyways, and we already have odm2api in the build, which is much dependency-heavier and is also not required by the core WOFpy.

Is https://github.com/ODM2/WOFpy/blob/master/setup.py#L54 used directly in the conda build? If so, pyyaml could be added there, right?

@ocefpaf
Copy link
Member

ocefpaf commented Jun 25, 2019

Is https://github.com/ODM2/WOFpy/blob/master/setup.py#L54 used directly in the conda build? If so, pyyaml could be added there, right?

Not directly but that should be update first, then a new release, than a conda package update to keep things consistent.

@emiliom
Copy link
Member Author

emiliom commented Jun 25, 2019

Ok. For now I'm able to get past this problem by simply installing pyyaml. There are other changes to WOFpy that I already have on my local clone, and a few more coming. I'll plan on sending a PR to update setup.py in the next few days, but I'll wait a while (couple of weeks) before issuing a new release.

@emiliom emiliom added this to the Release 2.3.1 milestone Jun 25, 2019
emiliom added a commit that referenced this issue Aug 4, 2019
Performance optimizations for ODM2 timeseries DAO get_variables requests. Also addresses #237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants