0

I try to run the example in https://learn.microsoft.com/vi-vn/sql/advanced-analytics/tutorials/sqldev-py3-explore-and-visualize-the-data?view=sql-server-2017

EXEC [dbo].[PyPlotMatplotlib]
GO

I got error, I don't know how to fix it.

Msg 39004, Level 16, State 20, Line 4
A 'Python' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004.
Msg 39019, Level 16, State 2, Line 4

An external script error occurred:

Error in execution.  Check the output for more information.
Traceback (most recent call last):
  File "<string>", line 5, in <module>
  File "C:\PROGRA~1\MICROS~2\MSSQL1~1.MSS\MSSQL\EXTENS~1\MSSQLSERVER01\E92CD4AC-875A-4CB1-93CF-1F9271D30179\sqlindb.py", line 45, in transform
    rental_model = pickle.loads(py_model)
TypeError: a bytes-like object is required, not 'NoneType'

SqlSatelliteCall error: Error in execution.  Check the output for more information.
STDOUT message(s) from external script: 
SqlSatelliteCall function failed. Please see the console output for more information.
Traceback (most recent call last):
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\revoscalepy\computecontext\RxInSqlServer.py", line 406, in rx_sql_satellite_call
    rx_native_call("SqlSatelliteCall", params)
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py", line 291, in rx_native_call
    ret = px_call(functionname, params)
RuntimeError: revoscalepy function failed.
Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
  • 2
    Welcome to StackOverflow. Can you please show us what you have tried to identify / solve the error you're finding? What have you reserached after the `TypeError: a bytes-like object is required, not 'NoneType'` bit? – PavoDive Aug 10 '19 at 14:40
  • the erorr now: Error in execution. Check the output for more information. Traceback (most recent call last): File "", line 5, in File "C:\PROGRA~1\MICROS~2\MSSQL1~1.MSS\MSSQL\EXTENS~1\MSSQLSERVER01\030AA8D5-31D0-4899-A7C4-E8F4ECD4DF22\sqlindb.py", line 85, in transform plot3 = pd.DataFrame(data =[pickle.dumps(fig_handle)], columns=["plot"]) MemoryError – Anh Nguyet Aug 14 '19 at 19:22
  • It looks like you're missing some of the required dependencies, did you [install the NYC Taxi demo data](https://learn.microsoft.com/en-us/sql/machine-learning/tutorials/demo-data-nyctaxi-in-sql?view=sql-server-ver15) first before trying to run the examples? – yanniskatsaros Feb 01 '21 at 18:11
  • In case it helps someone in future, it might be possible to address the `MemoryError` by increasing the memory available to Python by altering the external resource pool. See my answer here: https://stackoverflow.com/a/69082468/1714 – Hobo Sep 07 '21 at 04:40

0 Answers0