简体   繁体   English

使用ModuleNotFoundError导入ibm_db失败:没有名为'ibm_db'的模块

[英]import ibm_db failed with ModuleNotFoundError: No module named 'ibm_db'

I am trying to connect to ibm_db through python but it says the error 我试图通过python连接到ibm_db,但它说错误

import ibm_db
Traceback (most recent call last):

  File "<ipython-input-1-fe3bb08c8a05>", line 1, in <module>
    import ibm_db

ModuleNotFoundError: No module named 'ibm_db'

As suggested in many other sites I tried to re-install using 正如许多其他网站所建议我尝试重新安装使用

pip install ibm_db==2.0.8a but that does not install either pip install ibm_db==2.0.8a但是也没有安装

import ibm_db
Traceback (most recent call last):

  File "<ipython-input-1-fe3bb08c8a05>", line 1, in <module>
    import ibm_db

ModuleNotFoundError: No module named 'ibm_db'

I expect the ibm_db to get connected 我希望ibm_db能够连接起来

db I am trying to connect is on the cloud 我试图连接的数据库是在云端

I am not sure if there is any setting I am missing here. 我不确定这里是否有任何设置。

Any pointers or suggestions will be of great help. 任何指针或建议都会有很大帮助。

Thanks all. 谢谢大家。

What Python version are you using? 您使用的是什么Python版本?

If you're using python 3 you should install it using pip3 如果您使用的是python 3,则应使用pip3安装

pip3 install ibm_db==2.0.8a

Give it a shot. 试一试。

pip install ibm-db==3.0.1

这是链接: https//pypi.org/project/ibm-db/3.0.1/

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

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