0

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.

Community
  • 1
  • 1
mr.bjerre
  • 2,384
  • 2
  • 24
  • 37
  • whats the pycharm version? – Marlon Abeykoon Aug 29 '16 at 15:23
  • Is project interpreter configured correct? – Łukasz Rogalski Aug 29 '16 at 15:37
  • Go to File > Settings > Project interpreter and verify if a) Interpreter is correct (path to interpreter is C:\Python27) b) cx_Oracle is listed in package list. – Łukasz Rogalski Aug 30 '16 at 10:56
  • @ŁukaszRogalski did you see my EDIT comment in original post? I can't add cx_Oracle to the path due to the error posted in that comment. – mr.bjerre Aug 30 '16 at 11:50
  • And how you've installed this package in first place? If it was listed under project interpreter packages, there was no reason for it do refuse to work (unless e.g. package files was corrupted on hard drive). – Łukasz Rogalski Aug 30 '16 at 11:59
  • @ŁukaszRogalski I actually do not remember how I installed it in the first place - only that I struggled with it a couple of weeks ago. I'll try to look into it tomorrow. – mr.bjerre Aug 30 '16 at 13:01
  • @ŁukaszRogalski I installed it via .exe from [here](https://pypi.python.org/pypi/cx_Oracle/5.2.1). This also creates `C:\Python27\Lib\site-packages\cx_Oracle-5.2.1-py2.7.egg-info`. Can that be used somehow? I don't know about eggs. – mr.bjerre Aug 31 '16 at 08:08

2 Answers2

2

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__
Marlon Abeykoon
  • 11,927
  • 4
  • 54
  • 75
  • Invalidate and restart didn't work. cx-Oracle 5.2.1 is listed in the Project Interpreter (import is cx_Oracle and not cx-Oracle though). Path of the module is C:\Python27\lib\site-packages\cx_Oracle.pyd – mr.bjerre Aug 30 '16 at 07:07
  • @mr.bjerre is it listed under the project interpreter? – Marlon Abeykoon Aug 30 '16 at 07:08
  • yeah see edited comment. Pycharm version: PyCharm Community Edition 2016.2.1, Build #PC-162.1628.8, built on August 3, 2016, JRE: 1.8.0_76-release-b216 x86, JVM: OpenJDK Server VM by JetBrains s.r.o – mr.bjerre Aug 30 '16 at 07:11
0
  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.

Vasilis G.
  • 7,556
  • 4
  • 19
  • 29
SATYAM SAREEN
  • 41
  • 2
  • 8