简体   繁体   中英

PyCharm wrong notification: no module named cx_Oracle

I've installed cx_Oracle 5.2.1 for Python 2.7.10, and it works (running Win). My problem is though; PyCharm notifies me that the module name does not exists, which is not a problem in runtime. But because of this PyCharm is unable to assist me on the modules different function etc.

Can anyone clarify please?

I already looked into this PyCharm: Python's standard lib's names and functions are underlined as "No module named such" and I though it might be related. I don't see any solution though.

EDIT 1:

I read that it might fix the problem to delete cx-Oracle from the Project Interpreter and add it again. Problem is though that I get an error trying to install cx_Oracle: error: command 'C:\\\\Program Files (x86)\\\\Common Files\\\\Microsoft\\\\Visual C++ for Python\\\\9.0\\\\VC\\\\Bin\\\\link.exe' failed with exit status 1120 . I use PyCharm through a proxy.

EDIT 2:

As mentioned in a comment

import cx_Oracle
print cx_Oracle.__file__

yields C:\\Python27\\lib\\site-packages\\cx_Oracle.pyd , and you can see the Project Interpreter Paths here.

Go to File > Invalidate Caches > Invalidate and Restart or Invalidate and check.

If you want to check the library inside pyCharm go to File > Settings > Project > Project Interpreter . Select the interpreter and check the library is listed.

If you want to check the path where the said module is installed.

import cx_Oracle
print cx_Oracle.__file__
  1. Open Pycharm

  2. Go to File -> Settings -> Project interpreter

  3. In the package column, click the pip package and find cx_Oracle from the list. Select it and click the install button, now it will work fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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