-1

In my Conda environment, when I run pip show MetPy, my first and last two lines are:

Name: MetPy
Version: 1.0
...
Requires: scipy, matplotlib, pandas, pyproj, pooch, importlib-resources, traitlets, importlib-metadata, numpy, pint, xarray
Required-by: 

When I run pip show pint, my first and last two lines are:

Name: Pint
Version: 0.16.1
...
Requires: packaging, importlib-metadata
Required-by: MetPy

These should be the latest versions of these packages. Yet, when I try to do...

import metpy.calc as mpcalc

...I get the following error:

Traceback (most recent call last):
  File "redacted.py", line 17, in <module>
    import metpy.calc as mpcalc
  File "~/anaconda3/envs/environment/lib/python3.7/site-packages/metpy/calc/__init__.py", line 7, in <module>
    from .cross_sections import *  # noqa: F403
  File "~/anaconda3/envs/environment/lib/python3.7/site-packages/metpy/calc/cross_sections.py", line 14, in <module>
    from .tools import first_derivative
  File "~/anaconda3/envs/environment/lib/python3.7/site-packages/metpy/calc/tools.py", line 106, in <module>
    def find_intersections(x, a, b, direction='all', log_x=False):
  File "~/anaconda3/envs/environment/lib/python3.7/site-packages/pint/registry_helpers.py", line 248, in decorator
    % (func.__name__, count_params, len(args))
TypeError: find_intersections takes 5 parameters, but 3 units were passed

This makes me think I'm missing something with my package updates. Is there another dependency I'm missing?

smci
  • 32,567
  • 20
  • 113
  • 146
Stephen
  • 19
  • 4
  • 1
    Please please please tag anaconda questions as [tag:anaconda] and pip questions as [tag:pip]. This issue likely has zero to do with the specific packages, so the question title is misleading. – smci Jan 28 '21 at 23:08
  • **If these packages were installed with conda not pip, you should have used `conda show ` not `pip show...`.** It's quite possible you have conflicting versions of a package installed, one under conda, one under pip. (and the obvious way to check that is to uninstall the one(s) installed with pip). Downvoting for confusion. – smci Jan 28 '21 at 23:28
  • 1
    I believe you are correct. I’ve been installing through pip and I believe that muddled everything. Installing a new environment from scratch solely through conda-forge seems to have solved things. Sorry for not using those tags. I have a relationship with the MetPy folks so directed this at them. Newbie poster move. This can be closed, when I figure out how to do so. – Stephen Jan 30 '21 at 01:41

1 Answers1

2

It appears likely that you might not have pip installed within your conda environment or that you are running pip from somewhere outside your conda environment, and so pip show might be misleading you. Check your versions of MetPy and Pint within your conda environment with conda list, as this should be a version conflict error between older versions of MetPy (<=0.11.1) and newer versions of Pint (>0.9).

conda install -c conda-forge metpy==1.0 should get your conda environment caught up to MetPy 1.0.

dcamron
  • 155
  • 5