SEQ-SERVER-2019

Algotar, Kalpana A 1 Reputation point
2021-11-16T20:25:34.323+00:00

Hi,

I have Python 3.7 embedded in SQL Server 2019. I installed tensorflow but when I am importing tensorflow in python then first it complains about "absl". I installed "absl-py" and then complains about "google-protobuf". I tried to install "protobuf" but its giving me the following error.

ProgrammingError Traceback (most recent call last)
C:\Python39\lib\site-packages\sqlmlutils\sqlqueryexecutor.py in execute_query(self, query, params, out_file)
79 #
---> 80 while self._cursor.nextset():
81 try:

ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]A \'Python\' script error occurred during execution of \'sp_execute_external_script\' with HRESULT 0x80004004. (39004) (SQLMoreResults); [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]An external script error occurred: \n\r\nError in execution. Check the output for more information.\r\nTraceback (most recent call last):\r\n File "<string>", line 5, in <module>\r\n File "C:\ProgramData\SQL01\Temp-PY\Appcontainer1\A0A35556-9D0C-41DE-8F6D-F49B16267CD4\sqlindb_0.py", line 60, in transform\r\n assert package_exists_in_scope("protobuf", "public") != False\r\nAssertionError\r\n\r\nSqlSatelliteCall error: Error in execution. Check the output for more information. (39019); [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]STDOUT message(s) from external script: \nSqlSatelliteCall function failed. Please see the console output for more information.\r\nTraceback (most recent call last):\r\n File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\revoscalepy\computecontext\RxInSqlServer.py", line 605, in rx_sql_satellite_call\r\n rx_native_call("SqlSatelliteCall", params)\r\n File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py", line 375, in rx_native_call\r\n ret = px_call(functionname, params)\r\nRuntimeError: revoscalepy function failed.\r (39005)')

During handling of the above exception, another exception occurred:

RuntimeError Traceback (most recent call last)
C:\Python39\lib\site-packages\sqlmlutils\packagemanagement\sqlpackagemanager.py in _install_many(self, target_package_file, dependency_files, scope, out_file)
194 print("Done with dependencies, installing main package...")
--> 195 self._install_single(sqlexecutor, target_package_file, scope, True, out_file=out_file)
196 sqlexecutor._cnxn.commit()

C:\Python39\lib\site-packages\sqlmlutils\packagemanagement\sqlpackagemanager.py in _install_single(self, sqlexecutor, package_file, scope, is_target, out_file)
214 builder = CheckLibraryBuilder(pkg_name=name, scope=scope, language_name=self._language_name)
--> 215 sqlexecutor.execute(builder, out_file=out_file)
216

C:\Python39\lib\site-packages\sqlmlutils\sqlqueryexecutor.py in execute(self, builder, out_file)
40 def execute(self, builder: SQLBuilder, out_file=None):
---> 41 return self.execute_query(builder.base_script, builder.params, out_file=out_file)
42

C:\Python39\lib\site-packages\sqlmlutils\sqlqueryexecutor.py in execute_query(self, query, params, out_file)
93 except Exception as e:
---> 94 raise RuntimeError("Error in SQL Execution: " + str(e))
95

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,702 questions
{count} votes

1 answer

Sort by: Most helpful
  1. CathyJi-MSFT 21,086 Reputation points Microsoft Vendor
    2021-11-17T00:22:45.477+00:00

    Hi @Algotar, Kalpana A ,

    How did you install tensorflow? The package tensorflow cannot be installed using sqlmlutils.

    Workaround

    Using a command prompt in administrator mode, run the following command, replacing "MSSQLSERVER" with the name of your SQL instance:

    "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\PYTHON_SERVICES\python.exe" -m pip install --upgrade tensorflow  
    

    If you get a "TLS/SSL" error, see 7. Unable to install Python packages using pip earlier in this article.

    Refer to this MS document.

    0 comments No comments