简体   繁体   English

在python中本地安装模块

[英]Install module in python locally

I have a very basic question.我有一个非常基本的问题。 I want to install a new module on my computer in order to use it in Python (via Spyder).我想在我的计算机上安装一个新模块,以便在 Python 中使用它(通过 Spyder)。 When I install the package via pip everything seems to work fine.当我通过 pip 安装软件包时,一切似乎都正常。 When I want to import the package in my script it says that there is no module by that name (see scrennshot below)当我想在我的脚本中导入包时,它说没有该名称的模块(请参阅下面的屏幕截图)

Any suggestions what might be the problem?任何建议可能是什么问题?

Thanks a lot :)非常感谢 :)

screenshot of this problem这个问题的截图

You're using pip3 to install.您正在使用pip3进行安装。

Try installing using pip install nibabel .尝试使用pip install nibabel

Failing that, I would refer you to the following question: Which pip is with which python?如果做不到这一点,我会向您提出以下问题: 哪个 pip 与哪个 python?

This is a common pitfall of using different versions of Python and pip.这是使用不同版本的 Python 和 pip 的常见陷阱。

Thanks for asking the question.感谢您提出问题。 Have tried conda install Since we are in anaconda dev env.尝试过 conda install 因为我们在 anaconda dev env 中。

I think我认为

/Applications/Spyder.app/Contents/MacOS/python -m pip install nibabel or /Applications/Spyder.app/Contents/MacOS/python -m pip3 install nibabel /Applications/Spyder.app/Contents/MacOS/python -m pip install nibabel/Applications/Spyder.app/Contents/MacOS/python -m pip3 install nibabel

will solve your problem会解决你的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM