pip install SciPy from git fails with
  • 09-May-2023
Lightrun Team
Author Lightrun Team
Share
pip install SciPy from git fails with

BUG: pip install SciPy from git fails with “openblas” not found

Lightrun Team
Lightrun Team
09-May-2023

Explanation of the problem

SymPy CI has encountered an error while building SciPy on Python 3.11b1 from git using pip. The build failed with an error message that reads “Dependency ‘openblas’ not found, tried pkgconfig and cmake.” Although the setup was successful a few days ago, the same setup is now failing. However, the user has observed that NumPy and SciPy were successfully built and tested on Python 3.11b1 from git using pip a few days ago. The user suspects that installing the necessary dependencies using ‘apt install libopenblas-dev liblapack-dev’ might resolve the issue. Nonetheless, the user has expressed skepticism about why the setup was previously working, but it is not working now. Additionally, the user has shared a link to the last successful run, where the build was successful, but a later test failed. The user has also provided a code example to reproduce the error.

Troubleshooting with the Lightrun Developer Observability Platform

Getting a sense of what’s actually happening inside a live application is a frustrating experience, one that relies mostly on querying and observing whatever logs were written during development.
Lightrun is a Developer Observability Platform, allowing developers to add telemetry to live applications in real-time, on-demand, and right from the IDE.

  • Instantly add logs to, set metrics in, and take snapshots of live applications
  • Insights delivered straight to your IDE or CLI
  • Works where you do: dev, QA, staging, CI/CD, and production

Start for free today

Problem solution for BUG: pip install SciPy from git fails with “openblas” not found

Based on the top answer for the question, it seems that adding an openblas.pc file based on a template sample provided by @rgommers, and setting the PKG_CONFIG_PATH, allowed the user to successfully build scipy and complete their TVM build and install. This solution may work for others who encounter a similar issue.

It’s worth noting that the success of this solution may depend on individual system configurations and dependencies. However, using a template provided by a trusted source like @rgommers may increase the likelihood of success.

Overall, if someone encounters an error related to building scipy with openblas, they may want to consider trying this solution and adjusting it based on their own system’s configuration. Additionally, seeking support from the open source community or relevant forums may also provide helpful insights and potential solutions.

Other popular problems with SciPy

Problem: Installation Issues

One of the most common issues faced by users of SciPy is installation problems. This could be due to a variety of reasons, such as outdated dependencies, missing libraries or dependencies, and compatibility issues. These problems can lead to difficulties installing SciPy, and may even prevent users from using the package altogether.

Solution:

To resolve installation issues, it is recommended to use a package manager such as Anaconda or pip, which should ensure that all necessary dependencies are installed and compatible. Additionally, users can check for any missing dependencies or outdated packages, and install or update them as necessary. If compatibility issues persist, users may need to consider using a different version of SciPy or an alternative package that better suits their needs

Problem: Performance Issues

Another common issue with SciPy is performance problems. Due to the nature of the package, users may experience slow or inefficient performance when using certain functions or operations. This can be particularly problematic when dealing with large datasets or complex calculations, as it can significantly slow down the processing time.

Solution:

To overcome performance issues, users can take advantage of various optimization techniques and tools offered by SciPy, such as Cython or NumPy. Additionally, users may need to consider using parallel processing or distributed computing to speed up their calculations. It is also important to ensure that the hardware being used is optimized for the type of calculations being performed.

Problem: Compatibility Issues

Compatibility issues can also be a problem when using SciPy. These issues may arise due to differences in hardware or software configurations, changes in operating systems or Python versions, or other factors. Compatibility issues can prevent users from being able to run SciPy or certain functions, or may result in errors or unexpected results.

Solution:

To resolve compatibility issues, users can start by checking the version of SciPy and any dependencies being used, as well as the version of Python and the operating system. If compatibility issues persist, users may need to consider updating their software or hardware configurations to ensure compatibility with SciPy.

 

A brief introduction to SciPy

SciPy is a scientific computing library that is built on top of the Python programming language. It provides a vast array of numerical routines that allow for the manipulation and analysis of data. The library is made up of several sub-modules that cover a variety of scientific domains, including optimization, signal processing, linear algebra, and statistics. Each of these sub-modules provides a collection of algorithms and functions that are specifically designed to solve problems in their respective domains.

One of the core features of SciPy is its support for numerical integration and solving differential equations. These features are especially useful in scientific and engineering applications where complex systems need to be modeled and analyzed. Additionally, SciPy provides a number of tools for data analysis, including functions for interpolation, optimization, and statistical analysis. This makes it an ideal tool for working with large data sets and performing complex analyses. Overall, SciPy is an essential library for anyone working in scientific computing, data analysis, or engineering.

Most popular use cases for SciPy

  1. SciPy can be used for scientific and technical computing tasks such as optimization, integration, interpolation, linear algebra, signal and image processing, and statistical analysis. It provides efficient and robust implementations of a wide range of algorithms and mathematical functions, making it a powerful tool for researchers, engineers, and data scientists.
  2. In particular, SciPy’s optimization module provides various optimization algorithms for solving nonlinear optimization problems, including unconstrained and constrained optimization, least-squares minimization, and nonlinear programming. For example, to minimize a nonlinear function using the Nelder-Mead simplex algorithm, one can use the following code block:
from scipy.optimize import minimize

def fun(x):
    return (x[0] - 1)**2 + (x[1] - 2.5)**2

x0 = [0, 0]
res = minimize(fun, x0, method='nelder-mead',
               options={'xatol': 1e-8, 'disp': True})

print(res.x)


This will print the values of x that minimize the given function. The optimization module also provides many other algorithms and options for tuning the optimization process.

  1. Another useful feature of SciPy is its integration module, which provides several numerical integration methods for computing definite integrals. This can be useful for solving problems in physics, engineering, and other fields that involve integration. For example, to compute the integral of a function using the trapezoidal rule, one can use the following code block:
from scipy.integrate import trapz

x = [0, 1, 2, 3, 4]
y = [0, 1, 4, 9, 16]
result = trapz(y, x)

print(result)

This will compute the area under the curve defined by the x and y values using the trapezoidal rule. The integration module also provides other integration methods, such as Simpson’s rule and Gaussian quadrature, as well as functions for double and triple integration.

Share

It’s Really not that Complicated.

You can actually understand what’s going on inside your live applications.

Try Lightrun’s Playground

Lets Talk!

Looking for more information about Lightrun and debugging?
We’d love to hear from you!
Drop us a line and we’ll get back to you shortly.

By clicking Submit I agree to Lightrun’s Terms of Use.
Processing will be done in accordance to Lightrun’s Privacy Policy.