模块已安装在Conda上,但是在导入Spyder(Python IDE)时出现错误 [英] Module installed on Conda, but gives error on importing in Spyder (Python IDE)
问题描述
我最近在我的Conda中安装了 pybedtools 环境,使用他们提到的命令-
I recently installed pybedtools in my Conda environment, using the command they mentioned -
conda install -c bioconda pybedtools
但是当我在这种环境中激活spyder并尝试运行import pybedtools
时,它给了我错误-
But then when I activated spyder in this environment, and tried to run import pybedtools
it gave me the error-
Modulenotfounderror: no module named 'pybedtools'
我回过头来,也尝试使用pip
(pip install pybedtools
)使用该模块进行安装,但是它说我已经拥有它-
I went back and tried to install using the module using pip
too (pip install pybedtools
) but it said that I already had it -
Requirement already satisfied: pybedtools in /anaconda3/envs/env1/lib/python3.5/site-packages
Requirement already satisfied: six in ./anaconda3/envs/env1/lib/python3.5/site-packages (from pybedtools)
Requirement already satisfied: pybedtools in /anaconda3/envs/env1/lib/python3.5/site-packages
Requirement already satisfied: six in ./anaconda3/envs/env1/lib/python3.5/site-packages (from pybedtools)
因此,我无法理解模块的安装方式,但Spyder不允许我导入它.我以前从未遇到过Anaconda的问题.任何帮助都会很棒!
So, I am unable to understand how it is that the module is installed yet Spyder does not allow me to import it. I have never faced this issue with Anaconda before. Any help would be great!
推荐答案
这是我解决问题的方法-
Here is how I was able to solve the issue -
- 激活
root
环境.这可以通过Windows中的activate root
和Ubuntu/Mac中的source activate root
来完成 - 在此处安装上述软件包.可以使用在以前的环境中安装软件包所用的命令来完成此操作
- 回到您的原始环境.该问题现在已解决.
- activate the
root
environment. This can be done byactivate root
in Windows andsource activate root
in Ubuntu/Mac - install the said package here. This can be done using the same command that you used to install the package in your previous environment
- Go back to your original environment. The problem will now be resolved.
不过,我很想知道为什么该方法有效!
I would love to know, though, why this method works!
这篇关于模块已安装在Conda上,但是在导入Spyder(Python IDE)时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!