从.tar.gz将模块安装到Anaconda [英] Installing modules to Anaconda from .tar.gz
问题描述
当我想将模块安装到Anaconda时,我运行conda install
.但是,现在我有一个.tar.gz
文件,并想要安装它.怎么办?
When I want to install modules to Anaconda, I run conda install
. However, now I have a .tar.gz
file and want to install this. How to do?
推荐答案
有几种方法可以实现此目的,我在这里描述一种方法,即使您的默认"python"变量不是anaconda的变量,也应相对简单明了.
There are several way to achieve this, I'm describing one here, which should be relatively straight forward, even if your defualt "python" variable is not anaconda's.
- 检查您所需的anaconda环境是什么(如果不确定这是什么意思,则可能意味着您使用的是默认环境root)
- 运行:
conda info --envs
以查看环境的安装路径 - 转到该路径,然后找到python.exe的绝对路径,例如:
"C:\Program Files\Anaconda3\python.exe"
- 现在,运行以下命令:
- Check what is your desired anaconda environment (if you're not sure what does this mean, it probably means that you are using root, the default environment)
- Run:
conda info --envs
to see the path where your environment is installed - Go to that path, and find the absolute path to python.exe, for example:
"C:\Program Files\Anaconda3\python.exe"
- Now, run the following command:
<absolute path to python.exe> -m pip install <path to tar.gz>
例如:
C:\Program Files\Anaconda3\python.exe -m pip install c:\mymodule\great.tar.gz
请注意,<path to tar.gz>
可以是相对的,绝对的,甚至可以是在线链接.
Note that <path to tar.gz>
can be relative, absolute and even an online link.
这篇关于从.tar.gz将模块安装到Anaconda的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!