Conda环境安装(PyFerret)不成功 [英] Conda Installation of Environment (PyFerret) unsuccessful

查看:169
本文介绍了Conda环境安装(PyFerret)不成功的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Mac上安装PyFerret.我的目标是能够在Jupyter笔记本或终端中调用PyFerret. 我最初使用以下命令下载了它: https://anaconda.org/conda-forge/pyferret 该网站建议在终端中输入以下命令之一:

I try installing PyFerret on my Mac. My goal is to be able to call PyFerret within my jupyter notebook or my terminal. I initially downloaded it using the commands from: https://anaconda.org/conda-forge/pyferret The website suggested to type in one of the following commands into the terminal:

conda install -c conda-forge pyferret
conda install -c conda-forge/label/broken pyferret
conda install -c conda-forge/label/cf201901 pyferret

我没有仔细阅读说明,并安装了其中的三个.现在我不知道如何卸载它们,因为以下命令似乎不起作用:

I did not read the instructions carefully and installed the three of them. Now I do not know how to uninstall them as the commands below did not seem to work:

conda remove 
conda uninstall 

此处PyFerret的安装似乎与此处描述的不同: https://github.com/NOAA-PMEL/PyFerret/blob/master/README.md 它说:允许miniconda将其初始化代码添加到您的启动脚本中(例如$ HOME/.bashrc),并在安装完成后打开一个新的登录窗口."我不知道如何允许anaconda执行此操作. 但是,我确实使用了安装命令:

The installation of PyFerret here seems to be different to what it is described here: https://github.com/NOAA-PMEL/PyFerret/blob/master/README.md It says "Allow miniconda to add its initialization code to your start-up scripts (e.g., $HOME/.bashrc) and open a new login window when the installation is complete. " I do not know how to allow anaconda to do this. However, i did use the installation command:

conda create -n FERRET -c conda-forge pyferret ferret_datasets --yes

根据第二个链接应该足够,并且可以使用

Which according to the second link should be enough and one can activate the environment with

conda activate FERRET

我的终端抱怨的

:

to which my terminal complained:

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

我最终将其初始化为:

conda init -bash

然后让我激活PyFerret.但是,一旦激活,我唯一能注意到的就是终端的名称已更改为(FERRET)Mac:Username $ .我尝试给出一些命令,但无法验证PyFerret是否正常工作,也无法在Jupyter Notebook上调用它,并且无法删除通过第一个链接下载的所有其他内容. 我不确定为什么Anaconda网站在同一环境下会有不同的安装说明,以及为什么我无法卸载错误输入的其他内容. 我希望这很清楚,希望我能尽快得到您的帮助.
但是,这只会将命令行的名称"更改为

Which then allowed me to activate PyFerret. However, once active the only change I was able to notice was that the name of my terminal had change to (FERRET)Mac:Username$ . I tried giving a few commands but I was unable to verify that PyFerret worked nor I was able to call it on my Jupyter Notebook , and unable to delete all the extra stuff I downloaded with the first link. I am unsure as to why the Anaconda website has different installation instructions for the same environment, and why I was unable to uninstall the extra ones I got in by mistake. I hope this is clear enough and that I can get your help soon.
However, this only changed the "name" of the command line to

推荐答案

由于Conda一次只能安装一个软件包的一个版本,因此大概重新安装您实际想要的软件包就足够了

Since Conda can only install one version of a package at a time, it would suffice to reinstall the one you actually want, presumably

conda install -c conda-forge pyferret

,它将替换您可能已安装的任何其他内部版本.至于激活,命令应该是

and it will replace whatever other build you might have installed. As for the activation, the command should be

conda init bash

或者在Mac OS X Catalina上

or if on Mac OS X Catalina

conda init zsh

要在Jupyter笔记本中使用Conda环境,应在要用作内核的环境中安装ipykernel:

To use a Conda environment in a Jupyter notebook, you should install ipykernel in the environment you want to use as a kernel:

conda install -n FERRET ipykernel

包含Jupyter(通常为 base )的环境中的

nb_conda_kernels,例如

and nb_conda_kernels in the env that has Jupyter (usually base), e.g.,

conda install -n base nb_conda_kernels

始终在激活后一个环境的情况下启动jupyter notebook,例如

Always launch jupyter notebook with that latter env activated, e.g.,

conda activate base
jupyter notebook

然后,在创建新笔记本时(或更改现有笔记本以使用它),可以选择FERRET环境作为内核.

Then you can select the FERRET environment as your kernel when creating a new notebook (or change existing notebooks to use it).

这篇关于Conda环境安装(PyFerret)不成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆