ImportError: cannot import name 'lombscargle'
See original GitHub issueHello! I installed Librosa using sudo pip3 install librosa. I get this:
Requirement already satisfied: librosa in /home/nikigre/.local/lib/python3.6/site-packages
Requirement already satisfied: audioread>=2.0.0 in /home/nikigre/.local/lib/python3.6/site-packages (from librosa)
Requirement already satisfied: numpy>=1.8.0 in /home/nikigre/.local/lib/python3.6/site-packages (from librosa)
Requirement already satisfied: six>=1.3 in /home/nikigre/.local/lib/python3.6/site-packages (from librosa)
Requirement already satisfied: decorator>=3.0.0 in /home/nikigre/.local/lib/python3.6/site-packages (from librosa)
Requirement already satisfied: joblib>=0.7.0 in /home/nikigre/.local/lib/python3.6/site-packages (from librosa)
Requirement already satisfied: scipy>=0.13.0 in /home/nikigre/.local/lib/python3.6/site-packages (from librosa)
Requirement already satisfied: scikit-learn>=0.14.0 in /home/nikigre/.local/lib/python3.6/site-packages (from librosa)
Requirement already satisfied: resampy>=0.1.2 in /home/nikigre/.local/lib/python3.6/site-packages (from librosa)
Requirement already satisfied: numba>=0.32 in /home/nikigre/.local/lib/python3.6/site-packages (from resampy>=0.1.2->librosa)
Requirement already satisfied: llvmlite>=0.29.0 in /home/nikigre/.local/lib/python3.6/site-packages (from numba>=0.32->resampy>=0.1.2->librosa)
But when I try using it in deepvoice3_pytorch, I get this error.
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform; print(platform.platform())
Linux-4.4.0-17763-Microsoft-x86_64-with-Ubuntu-18.04-bionic
>>> import sys; print("Python", sys.version)
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
>>> import numpy; print("NumPy", numpy.__version__)
NumPy 1.16.4
>>> import scipy; print("SciPy", scipy.__version__)
SciPy 1.3.0
>>> import librosa; print("librosa", librosa.__version__)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nikigre/.local/lib/python3.6/site-packages/librosa/__init__.py", line 12, in <module>
from . import core
File "/home/nikigre/.local/lib/python3.6/site-packages/librosa/core/__init__.py", line 109, in <module>
from .audio import * # pylint: disable=wildcard-import
File "/home/nikigre/.local/lib/python3.6/site-packages/librosa/core/audio.py", line 10, in <module>
import scipy.signal
File "/home/nikigre/.local/lib/python3.6/site-packages/scipy/signal/__init__.py", line 305, in <module>
from .spectral import *
File "/home/nikigre/.local/lib/python3.6/site-packages/scipy/signal/spectral.py", line 10, in <module>
from ._spectral import lombscargle
ImportError: cannot import name 'lombscargle'
I tried sudo pip3 install lombscargle
But it does not exists (requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/lombscargle/
)
How can I repair this?
Thank you!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Use of scipy.signal.lombscargle - Stack Overflow
The data that we are pulling from is a simple .dat file with lists of numbers. Here is the code, any ideas on...
Read more >LombScargle — Astropy v5.2
Compute the Lomb-Scargle periodogram at a user-specified frequency grid: ... from astropy import units as u >>> t = t * u.s >>>...
Read more >The Generalized Lomb-Scargle Periodogram (GLS)
The Gls class computes the error-weighted Lomb-Scargle periodogram as developed by [ZK09] using various possible normalizations. The constructor of Gls takes a ...
Read more >Fast Lomb-Scargle Periodograms in Python
The Lomb-Scargle periodogram (named for Lomb (1976) and Scargle (1982)) is a ... We'll start with some typical Python import statements:.
Read more >Signal Processing (scipy.signal) — SciPy v1.9.3 Manual
import numpy as np >>> from scipy import signal, misc >>> import ... Filtering is a generic name for any system that modifies...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s quite strange. I can’t reproduce the problem on my machine. Python 3.7 on a Darwin OS.
The crux problem seems to lie at
import scipy.signal
. Can you re-run Python and just type this command:import scipy.signal
, see if the error still happens?lombscargle
is not a module but a function within thescipy.signal.spectral
module. It’s been there since at least 2012 or 2013 (scipy v0.13), if not earlier. https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lombscargle.htmlI’m glad it’s working now!
That version is several years out of date now, but upgrading to 0.7 should work fine if your dependency chain is settled now.