1

I've successfully installed Python on SQL Server and was able to run simple Python scripts through SSMS without any issues. However, after importing additional libraries (such as matplotlib, etc.), I started encountering the following error:

Unable to communicate with the runtime for 'Python' script for request id: 3807907B-2C09-438E-BBC2-C71CE1C30A1B. Please check the requirements of 'Python' runtime.

At this point, none of my Python scripts execute, even the basic ones that were working earlier.

I've searched extensively online, but haven't found a clear resolution. From what I understand, it might be related to compatibility issues, missing dependencies, or a misconfigured Python environment for SQL Server Machine Learning Services.

If you’ve seen this issue before or have any suggestions on how to fix it, I’d really appreciate your input. Also, if you have a working configuration setup, I'd be grateful if you could share your environment details for comparison.

Here’s what I’ve already checked:

  • Python is still installed and accessible.
  • SQL Server Machine Learning Services for Python is properly installed.
  • The external scripting feature is enabled (sp_configure 'external scripts enabled', 1).
  • The Launchpad service is running correctly.
  • No apparent issues in the logs or permissions.
4
  • Do you get any more info/errors than that? Eventlog might have more information as well! Commented Jun 27 at 16:22
  • 1
    For this, "However, after importing additional libraries" I would recommend do an elimination process. Remove all the additional libraries you added to the point you have a working environment again. Then add 1 library at a time and test it with something simple to use it. This will help you understand what exactly is failing then it will likely make it easier to find the root cause (which is likely a dependency issue, we just need to pinpoint which one). Commented Jun 27 at 18:13
  • Please always use a generic [python] tag for all python related questions Commented Jul 3 at 17:40
  • I believe, before importing additional libraries. you might t have installed it and it upgrade or replace versions of libraries that the built-in SQL Server runtime expects. So try to uninstall those and run your basic program. If its working, you have to install specific version to run on SQL server. Commented Oct 23 at 19:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.