在 Anaconda 上安装metview包的问题

Posted

技术标签:

【中文标题】在 Anaconda 上安装metview包的问题【英文标题】:Problem on installing metview package on Anaconda 【发布时间】:2020-05-30 15:57:44 【问题描述】:

我正在尝试通过它的安装页面安装 Metview 包:

https://anaconda.org/conda-forge/metview

使用代码:conda install -c conda-forge metview

我遇到了这个问题:

(base) C:\Users\Saeed>conda install -c conda-forge metview
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - metview

Current channels:

      - https://conda.anaconda.org/conda-forge/win-64
      - https://conda.anaconda.org/conda-forge/noarch
      - https://repo.anaconda.com/pkgs/main/win-64
      - https://repo.anaconda.com/pkgs/main/noarch
      - https://repo.anaconda.com/pkgs/r/win-64
      - https://repo.anaconda.com/pkgs/r/noarch
      - https://repo.anaconda.com/pkgs/msys2/win-64
      - https://repo.anaconda.com/pkgs/msys2/noarch
      - https://conda.anaconda.org/conda-canary/win-64

  - https://conda.anaconda.org/conda-canary/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

我正在使用 Anaconda 并尝试使用 Anaconda 提示符。

提前感谢您的帮助。

【问题讨论】:

【参考方案1】:

conda-forgemetview 包仅适用于 osx-64linux-64。看起来你在win-64系统上。尝试使用pip install metview 安装。如果不成功,您将不得不从源代码构建。

【讨论】:

【参考方案2】:

我刚刚做了并得到了这个:

(base) C:\Users\Saeed>pip install metview
Collecting metview
  Using cached metview-1.4.2-py2.py3-none-any.whl (19 kB)
Requirement already satisfied: pandas in c:\programdata\anaconda3\lib\site-packages (from metview) (1.0.3)
Requirement already satisfied: cffi in c:\programdata\anaconda3\lib\site-packages (from metview) (1.14.0)
Requirement already satisfied: numpy in c:\programdata\anaconda3\lib\site-packages (from metview) (1.18.1)
Requirement already satisfied: pytz>=2017.2 in c:\programdata\anaconda3\lib\site-packages (from pandas->metview) (2020.1)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\programdata\anaconda3\lib\site-packages (from pandas->metview) (2.8.1)
Requirement already satisfied: pycparser in c:\programdata\anaconda3\lib\site-packages (from cffi->metview) (2.20)
Requirement already satisfied: six>=1.5 in c:\programdata\anaconda3\lib\site-packages (from python-dateutil>=2.6.1->pandas->metview) (1.14.0)
Installing collected packages: metview
Successfully installed metview-1.4.2

问题是它不是正确和合适的包装!它正在安装错误的版本,或者至少是不正确的! 我在 jupyter 中运行它并得到了这个:

import metview as mv
--------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-6bf5b378b3e8> in <module>
----> 1 import metview as mv

C:\ProgramData\Anaconda3\lib\site-packages\metview\__init__.py in <module>
     24 if len(sys.argv) != 2 or sys.argv[0] != "-m" or sys.argv[1] != "selfcheck":
     25 
---> 26     from . import bindings as _bindings
     27 
     28     _bindings.bind_functions(globals(), module_name=__name__)

C:\ProgramData\Anaconda3\lib\site-packages\metview\bindings.py in <module>
    168 
    169 
--> 170 mi = MetviewInvoker()
    171 
    172 try:

C:\ProgramData\Anaconda3\lib\site-packages\metview\bindings.py in __init__(self)
     64         pid = os.getpid()
     65         # print('PYTHON:', pid, ' ', env_file.name, ' ', repr(signal.SIGUSR1))
---> 66         signal.signal(signal.SIGUSR1, self.signal_from_metview)
     67         # p = subprocess.Popen(['metview', '-edbg', 'tv8 -a', '-slog', '-python-serve',
     68         #     env_file.name, str(pid)], stdout=subprocess.PIPE)

AttributeError: module 'signal' has no attribute 'SIGUSR1'

【讨论】:

以上是关于在 Anaconda 上安装metview包的问题的主要内容,如果未能解决你的问题,请参考以下文章

如何在Ubuntu 16.04上安装Anaconda Python Distribution

大写 PyPI 包的 Anaconda 问题

windows下安装python和依赖包的利器——Anaconda

anaconda包的管理

在Anaconda虚拟环境中pip安装的包无法使用

Anaconda安装与环境配置