question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Librosa no attributes

See original GitHub issue

Description

Installed Librosa thru pip using ‘pip install librosa.’ It seems to import fine when running thru a script as seen in the versions part but when attempting to import it thru the IDLE, it produces another error.

Steps/Code to Reproduce

Ran this code that resulted in the errors shown under for versions import platform; print(platform.platform()) import sys; print(“Python”, sys.version) import numpy; print(“NumPy”, numpy.version) import scipy; print(“SciPy”, scipy.version) import librosa; print(“librosa”, librosa.version)

removing ‘; print(“librosa”, librosa.version)’ produces no errors

Error

>>> import librosa
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import librosa
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\librosa\__init__.py", line 12, in <module>
    from . import core
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\librosa\core\__init__.py", line 108, in <module>
    from .time_frequency import *  # pylint: disable=wildcard-import
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\librosa\core\time_frequency.py", line 10, in <module>
    from ..util.exceptions import ParameterError
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\librosa\util\__init__.py", line 67, in <module>
    from .utils import *  # pylint: disable=wildcard-import
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\librosa\util\utils.py", line 5, in <module>
    import scipy.ndimage
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\ndimage\__init__.py", line 161, in <module>
    from .filters import *
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\ndimage\filters.py", line 37, in <module>
    from scipy.misc import doccer
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\misc\__init__.py", line 53, in <module>
    from scipy.interpolate._pade import pade
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\interpolate\__init__.py", line 176, in <module>
    from .interpolate import *
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\interpolate\interpolate.py", line 21, in <module>
    import scipy.special as spec
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\special\__init__.py", line 648, in <module>
    from ._ellip_harm import ellip_harm, ellip_harm_2, ellip_normal
  File "C:\Users\zairm\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\special\_ellip_harm.py", line 7, in <module>
    from ._ellip_harm_2 import _ellipsoid, _ellipsoid_norm
ImportError: cannot import name '_ellipsoid'

Versions

Windows-10-10.0.15063-SP0
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]
NumPy 1.13.1
SciPy 0.19.0
Traceback (most recent call last):
  File "D:\Windows\Desktop\librosa.py", line 8, in <module>
    import librosa; print("librosa", librosa.__version__)
  File "D:\Windows\Desktop\librosa.py", line 8, in <module>
    import librosa; print("librosa", librosa.__version__)
AttributeError: module 'librosa' has no attribute '__version__'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ZairMahmoodcommented, Jul 26, 2017

Yup that was the error. That was pretty foolish of me to name a file like that. Thanks again for figuring out Scipy was the issue. I wouldn’t have been able to figure that out.

1reaction
dpwecommented, Jul 26, 2017

From the original message:

File “D:\Windows\Desktop\librosa.py”, line 8, in <module> import librosa; print(“librosa”, librosa.version)

It looks to me like you have a file called librosa.py on your Desktop, perhaps it’s the commands you’re running to test out librosa. It’s quite possible (in my python 2.7 mind, at least) that that file is being “imported” instead of the actual installed version. If you have created a file called librosa.py, try renaming or deleting it. Then I think librosa.version will become accessible.

DAn.

On Wed, Jul 26, 2017 at 3:41 PM, Brian McFee notifications@github.com wrote:

Sorry, I missed that in the original post. When you say “provided by python”, what python distribution are you using?

If the version attribute is not accessible, then something is still wrong, and I’d like to get to the bottom of it before closing this out.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/librosa/librosa/issues/601#issuecomment-318160352, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhs0ZwLZdLT21Tr1Dhobkxjs49IKl4Xks5sR5ZUgaJpZM4OjXtW .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting — librosa 0.10.0.dev0 documentation
AttributeError: module 'librosa' has no attribute 'display'. it is because the librosa.display submodule needs to be imported explicitly in librosa versions ...
Read more >
module 'librosa' has no attribute 'load' · Issue #774
module 'librosa' has no attribute 'load' getting this error -> signal, sr = lr.load(path, res_type='kaiser_fast') I'm passing a wav file ...
Read more >
AttributeError: module 'librosa' has no attribute 'output'
I am using librosa 0.6 in anaconda and i ...
Read more >
AttributeError: module 'librosa' has no attribute 'output' - Gogs
#1 AttributeError: module 'librosa' has no attribute 'output' ; Labels. Clear labels. No Label ; Milestone. Clear milestone. No Milestone ; Assignee. Clear ......
Read more >
module 'librosa' has no attribute 'display'
AttributeError: module 'librosa' has no attribute 'display' site:stackoverflow.com ; 1. # just import the display ; 2. ​ ; 3. import librosa.display ;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found