Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

oml4py error interface between python + oracle database

user5716448Aug 9 2019 — edited Mar 2 2020

Hi,

Have ran pip install oml4py and tried to import oml in jupyter but get message below.

import oml

--------------------------------------------------------------------------- ModuleNotFoundError                       Traceback (most recent call last) <ipython-input-1-2d3e0058174b> in <module>() ----> 1 import oml  ModuleNotFoundError: No module named 'oml'

Any thoughts on how to resolve to allow us to use oml4py

Thanks

Comments

Gaz in Oz

With your brief description of the issue its hard to say. Here's some links that might help

https://pypi.org/project/oml4py/

https://towardsdatascience.com/oracle-machine-learning-for-python-e335fc0a50e8

Try getting a simple pyhon script working (without involving jupyter) to verify your python and oml4py install.

user5716448

Thanks for update.

Had been trying below from your 2nd link in jupyter

import oml

from oml.automl import ModelTuning

from oml import algo

import config

# connection to Oracle DB...

oml.connect(config.USER,config.PWD,

'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=1521))(CONNECT_DATA=(service_name=<SID>)))',

automl=True)

# test if connected

oml.isconnected()

# create an OML dataframe connected to DB table

<table> = oml.sync(table = '<table>')

uleNotFoundError  Traceback (most recent call last)

<ipython-input-2-140bf7774210> in <module>()

----> 1 import oml

  2 from oml.automl import ModelTuning

  3 from oml import algo

  4 import config

  5

ModuleNotFoundError: No module named 'oml'

Gaz in Oz

Apologies, all I can offer is another link. This will help you "debug" where your python install looks for packages. Hopefully this will help:

https://leemendelowitz.github.io/blog/how-does-python-find-packages.html

user5716448

No problem - thanks for link

Muthu_SM-Oracle

Facing the same issue with Python 3.7 (which is mentioned as the pre-reg for OML)

Did anyone resolve this issue when we import oml ??

>>> import oml

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ModuleNotFoundError: No module named 'oml'

already oml installed successfully .. Verified the same here

(base) C:\WINDOWS\system32>pip install oml

Requirement already satisfied: oml in c:\\  \appdata\local\continuum\anaconda3\lib\site-packages (0.1.2)

Requirement already satisfied: quik in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from oml) (0.2.2)

Requirement already satisfied: requests in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from oml) (2.22.0)

Requirement already satisfied: lupa in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from oml) (1.8)

Requirement already satisfied: idna<2.9,>=2.5 in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from requests->oml) (2.8)

Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from requests->oml) (3.0.4)

Requirement already satisfied: certifi>=2017.4.17 in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from requests->oml) (2019.9.11)

Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from requests->oml) (1.24.2)

Try setting the environment variable PYTHONPATH to the location of the installed packages.  For example:

$ export PYTHONPATH=$ORACLE_HOME/oml4py/modules

Sherry

user5716448

Thanks for update

gsalem-Oracle

Just to clarify things: the OML4PY you pointed to has nothing to do with Oracle, or with the similarly named module from Oracle. Not sure how this naming conflict will be resolved.

1 - 8

Post Details

Added on Aug 9 2019
8 comments
1,938 views