I wanted to work on OracleDb using Python hence I've installed pip install cx_Oracle
. The entire time when I was working on it, everything went fine but after sometime when again I wanted to open cx_Oracle it showed this error:
'import' is not recognized as an internal or external command, operable program or batch file.
Then I went on to uninstall it:
C:\Users\PRATIKBAWANE>pip uninstall cx_Oracle
Found existing installation: cx-Oracle 8.3.0
Uninstalling cx-Oracle-8.3.0:
Would remove:
c:\users\pratikbawane\appdata\local\programs\python\python310\cx_oracle-doc\license.txt
c:\users\pratikbawane\appdata\local\programs\python\python310\cx_oracle-doc\readme.txt
c:\users\pratikbawane\appdata\local\programs\python\python310\lib\site-packages\cx_oracle-8.3.0.dist-info\*
c:\users\pratikbawane\appdata\local\programs\python\python310\lib\site-packages\cx_oracle.cp310-win_amd64.pyd
Proceed (Y/n)? y
Successfully uninstalled cx-Oracle-8.3.0
And again tried to install it:
C:\Users\PRATIKBAWANE>pip install cx_Oracle
Collecting cx_Oracle
Using cached cx_Oracle-8.3.0-cp310-cp310-win_amd64.whl (213 kB)
Installing collected packages: cx-Oracle
Successfully installed cx-Oracle-8.3.0
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\PRATIKBAWANE\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.
C:\Users\PRATIKBAWANE>import cx_Oracle
'import' is not recognized as an internal or external command,
operable program or batch file.
Then why even after the Successful installation it is showing error:
'import' is not recognized as an internal or external command, operable program or batch file.
I'm not getting it can somebody explain it to me so that whenever it happens atleast I may have the reason for it. Thank You so much!
You're running import cx_Oracle
in a Windows command line, not in a Python interpreter. You need to launch Python first, something like this:
C:\Users\PRATIKBAWANE>python
Python 3.9.9 (main, Dec 13 2021, 17:45:33)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>>
python
may have a different name in Windows cmd, like python3
or py
. If none of these work, you need to check if Python is "added to PATH" (google it)