Forum Stats

  • 3,727,527 Users
  • 2,245,403 Discussions
  • 7,852,848 Comments

Discussions

oml4py error interface between python + oracle database

user5716448
user5716448 Member Posts: 1,710 Silver Badge
edited March 2020 in Python

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

Answers

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,774 Bronze Crown
    edited August 2019

    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
  • user5716448
    user5716448 Member Posts: 1,710 Silver Badge
    edited August 2019

    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
    Gaz in Oz Member Posts: 3,774 Bronze Crown
    edited August 2019

    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
  • user5716448
    user5716448 Member Posts: 1,710 Silver Badge
    edited August 2019

    No problem - thanks for link

  • Muthu_SM-Oracle
    Muthu_SM-Oracle Member Posts: 1
    edited November 2019

    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)

  • Sherry Lamonica-Oracle
    Sherry Lamonica-Oracle Posts: 433 Employee
    edited November 2019

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

    $ export PYTHONPATH=$ORACLE_HOME/oml4py/modules

    Sherry

    user5716448
  • user5716448
    user5716448 Member Posts: 1,710 Silver Badge
    edited November 2019

    Thanks for update

  • gsalem-Oracle
    gsalem-Oracle Posts: 143 Employee
    edited March 2020

    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.

Sign In or Register to comment.