Audio Cog failing to import, lavalink has no module 'track' #5324

Closed
opened 2021-09-18 16:04:31 +02:00 by rockcabbage · 2 comments
rockcabbage commented 2021-09-18 16:04:31 +02:00 (Migrated from github.com)

What Red version are you using?

3.4.13

Cog name

Audio

Command name

!load audio

What did you expect to happen?

audio module to load successfully

What actually happened?

C:\Users\rockc\AppData\Local\Programs\Python\Python39\Lib\site-packages\lavalink>redbot redbot
C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\helpers.py:107: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def noop(*args, **kwargs):  # type: ignore
[10:02:17] INFO     [red] Loading packages...
           INFO     [red] Loaded packages: bank, admin
           WARNING  [py.warnings] C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\connector.py:964: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  hosts = await asyncio.shield(self._resolve_host(

           WARNING  [py.warnings] C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\locks.py:21: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  self._event = asyncio.Event(loop=loop)

[10:02:18] INFO     [red] Connected to Discord. Getting ready...

______         _           ______ _                       _  ______       _
| ___ \       | |          |  _  (_)                     | | | ___ \     | |
| |_/ /___  __| |  ______  | | | |_ ___  ___ ___  _ __ __| | | |_/ / ___ | |_
|    // _ \/ _` | |______| | | | | / __|/ __/ _ \| '__/ _` | | ___ \/ _ \| __|
| |\ \  __/ (_| |          | |/ /| \__ \ (_| (_) | | | (_| | | |_/ / (_) | |_
\_| \_\___|\__,_|          |___/ |_|___/\___\___/|_|  \__,_| \____/ \___/ \__|

┌─────────── Redbot ────────────┐ ┌─────────────────────┐
│  Prefixes           │ !       │ │  Shards       │ 1   │
│  Language           │ en-US   │ │  Servers      │ 2   │
│  Red version        │ 3.4.13  │ │  Unique Users │ 79  │
│  Discord.py version │ 1.7.3   │ └─────────────────────┘
│  Storage type       │ JSON    │
└───────────────────────────────┘
Loaded 4 cogs with 47 commands

Invite URL: https://discord.com/oauth2/authorize?client_id=571847988352385055&scope=bot
[10:02:29] ERROR    [red] Package import failed
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\core\core_commands.py:160 in _load   │
│ >  160                 spec = await bot._cog_mgr.find_cog(name)                                                     │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\core\cog_manager.py:288 in find_cog  │
│ > 288             return await self._find_core_cog(name)                                                            │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\core\cog_manager.py:256 in           │
│ _find_core_cog                                                                                                      │
│ > 256             mod = import_module(real_name, package=package)                                                   │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py:127 in import_module                │
│ > 127     return _bootstrap._gcd_import(name[level:], package, level)                                               │
│ <frozen importlib._bootstrap>:1030 in _gcd_import                                                                   │
│ <frozen importlib._bootstrap>:1007 in _find_and_load                                                                │
│ <frozen importlib._bootstrap>:986 in _find_and_load_unlocked                                                        │
│ <frozen importlib._bootstrap>:680 in _load_unlocked                                                                 │
│ <frozen importlib._bootstrap_external>:850 in exec_module                                                           │
│ <frozen importlib._bootstrap>:228 in _call_with_frames_removed                                                      │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\__init__.py:3 in <module> │
│ >  3 from .core import Audio                                                                                        │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\core\__init__.py:19 in    │
│ <module>                                                                                                            │
│ >  19 from . import abc, cog_utils, commands, events, tasks, utilities                                              │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\core\cog_utils.py:10 in   │
│ <module>                                                                                                            │
│ >  10 from ..converters import get_lazy_converter, get_playlist_converter                                           │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\converters.py:15 in       │
│ <module>                                                                                                            │
│ >  15 from .apis.api_utils import standardize_scope                                                                 │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\apis\__init__.py:1 in     │
│ <module>                                                                                                            │
│ >  1 from . import (                                                                                                │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\apis\api_utils.py:82 in   │
│ <module>                                                                                                            │
│ >  82 class QueueFetchResult:                                                                                       │
│ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\apis\api_utils.py:86 in   │
│ QueueFetchResult                                                                                                    │
│ >  86     track_object: lavalink.Track = None                                                                       │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
AttributeError: module 'lavalink' has no attribute 'Track'

How can we reproduce this error?

  1. !load audio
  2. ???
  3. ???
    ...

Anything else?

No response

### What Red version are you using? 3.4.13 ### Cog name Audio ### Command name !load audio ### What did you expect to happen? audio module to load successfully ### What actually happened? ``` C:\Users\rockc\AppData\Local\Programs\Python\Python39\Lib\site-packages\lavalink>redbot redbot C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\helpers.py:107: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead def noop(*args, **kwargs): # type: ignore [10:02:17] INFO [red] Loading packages... INFO [red] Loaded packages: bank, admin WARNING [py.warnings] C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\connector.py:964: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10. hosts = await asyncio.shield(self._resolve_host( WARNING [py.warnings] C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\locks.py:21: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10. self._event = asyncio.Event(loop=loop) [10:02:18] INFO [red] Connected to Discord. Getting ready... ______ _ ______ _ _ ______ _ | ___ \ | | | _ (_) | | | ___ \ | | | |_/ /___ __| | ______ | | | |_ ___ ___ ___ _ __ __| | | |_/ / ___ | |_ | // _ \/ _` | |______| | | | | / __|/ __/ _ \| '__/ _` | | ___ \/ _ \| __| | |\ \ __/ (_| | | |/ /| \__ \ (_| (_) | | | (_| | | |_/ / (_) | |_ \_| \_\___|\__,_| |___/ |_|___/\___\___/|_| \__,_| \____/ \___/ \__| ┌─────────── Redbot ────────────┐ ┌─────────────────────┐ │ Prefixes │ ! │ │ Shards │ 1 │ │ Language │ en-US │ │ Servers │ 2 │ │ Red version │ 3.4.13 │ │ Unique Users │ 79 │ │ Discord.py version │ 1.7.3 │ └─────────────────────┘ │ Storage type │ JSON │ └───────────────────────────────┘ Loaded 4 cogs with 47 commands Invite URL: https://discord.com/oauth2/authorize?client_id=571847988352385055&scope=bot [10:02:29] ERROR [red] Package import failed ┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\core\core_commands.py:160 in _load │ │ > 160 spec = await bot._cog_mgr.find_cog(name) │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\core\cog_manager.py:288 in find_cog │ │ > 288 return await self._find_core_cog(name) │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\core\cog_manager.py:256 in │ │ _find_core_cog │ │ > 256 mod = import_module(real_name, package=package) │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py:127 in import_module │ │ > 127 return _bootstrap._gcd_import(name[level:], package, level) │ │ <frozen importlib._bootstrap>:1030 in _gcd_import │ │ <frozen importlib._bootstrap>:1007 in _find_and_load │ │ <frozen importlib._bootstrap>:986 in _find_and_load_unlocked │ │ <frozen importlib._bootstrap>:680 in _load_unlocked │ │ <frozen importlib._bootstrap_external>:850 in exec_module │ │ <frozen importlib._bootstrap>:228 in _call_with_frames_removed │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\__init__.py:3 in <module> │ │ > 3 from .core import Audio │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\core\__init__.py:19 in │ │ <module> │ │ > 19 from . import abc, cog_utils, commands, events, tasks, utilities │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\core\cog_utils.py:10 in │ │ <module> │ │ > 10 from ..converters import get_lazy_converter, get_playlist_converter │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\converters.py:15 in │ │ <module> │ │ > 15 from .apis.api_utils import standardize_scope │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\apis\__init__.py:1 in │ │ <module> │ │ > 1 from . import ( │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\apis\api_utils.py:82 in │ │ <module> │ │ > 82 class QueueFetchResult: │ │ C:\Users\rockc\AppData\Local\Programs\Python\Python39\lib\site-packages\redbot\cogs\audio\apis\api_utils.py:86 in │ │ QueueFetchResult │ │ > 86 track_object: lavalink.Track = None │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ AttributeError: module 'lavalink' has no attribute 'Track' ``` ### How can we reproduce this error? 1. !load audio 2. ??? 3. ??? ... ### Anything else? _No response_
aikaterna commented 2021-09-18 21:30:00 +02:00 (Migrated from github.com)

Seems like you tried to install a Lavalink library yourself and installed Lavalink.py instead of our library for it. In your activated virtual environment, reinstall Red and its dependencies by using python -m pip install --force-reinstall Red-DiscordBot and then try to run your bot again.

Seems like you tried to install a Lavalink library yourself and installed Lavalink.py instead of our library for it. In your activated virtual environment, reinstall Red and its dependencies by using `python -m pip install --force-reinstall Red-DiscordBot` and then try to run your bot again.
aikaterna commented 2021-10-02 01:41:55 +02:00 (Migrated from github.com)

Hi, it's been a couple weeks since I responded on this issue and we haven't heard back from you. If you need further help, please join the support server at discord.gg/red and ask for help in the #support channel.

Hi, it's been a couple weeks since I responded on this issue and we haven't heard back from you. If you need further help, please join the support server at discord.gg/red and ask for help in the #support channel.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#5324
No description provided.