#๐Ÿ”’ i have search on the internet. i can't find solutions day work for UserWarning: pkg_resources

61 messages ยท Page 1 of 1 (latest)

candid hareBOT
#

@coral cedar

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

compact plover
#

the error is cutoff, provide the error in text form or any way that shows the full error in a readable way

coral cedar
#

: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources #install setuptoolsurces

tiny dagger
#

what's that script doing that you need to import pkg_resources?

#

in any case, that's a warning, it doesn't prevent yoru script from running

fickle sparrow
#

Please also show the code

coral cedar
#

i am trying to use faster whisper

fickle sparrow
fickle sparrow
coral cedar
#

from faster_whisper import WhisperModel
this is the code

fickle sparrow
tiny dagger
#

that's literally all that's in that file?

fickle sparrow
#

This is a single line

coral cedar
#

jes importing shit

compact plover
#

if you dont want to provide information not much help can be provided.

#

as was mentioned already the error is just a warning not a failure

coral cedar
#

i am testing text to speech

tiny dagger
#

why are you being so reticent about sharing your code?

fickle sparrow
#

Show the code

#

We cannot fk imagine code

#

So we can explain it to you

#

Sending the first 10 line of code in a file is not hard

compact plover
#

!paste

candid hareBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

fickle sparrow
#

It is probably faster than keep refusing

coral cedar
#

import speech_recognition as sr
from pynput.keyboard import Controller
from time import sleep

r = sr.Recognizer()

def record():
while 1:
try:
with sr.Microphone() as source:

            r.adjust_for_ambient_noise(source)
            #print("listening")
            audio = r.listen(source)
            texti = r.recognize_google(audio)
            return texti

    except sr.RequestError as e:
        print("Could not request results; {0}".format(e))
    except sr.UnknownValueError:
        print("Unknown error")

stop = False
while True:
text = record()
if text == "start listening":
stop = True
print("Started with listening")
while stop:
text = record()
if text == "stop listening":
stop = False
print("stopped with listening")
else:
c = Controller()
c.type(text)
print(text)
#I want to use fast whisper because it's faster.

candid hareBOT
#

Hey @coral cedar!

Please edit your message to use a code block

```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
fickle sparrow
#

Are you sure line 1 is import speed_recognition as sr?

#

On your code editor

coral cedar
#

jes

compact plover
#

so the warning is for a blank line,,, ?

fickle sparrow
#

And this is speech/test2.py ? Weird it point to an empty line

coral cedar
#

no this is mine attempt at text to speech

fickle sparrow
#

I don't care what your attempt

#

And have this warning

#

For the n th time

coral cedar
fickle sparrow
#

I don't need the warning message

compact plover
#

provide the file that throws the error or there is nothing we can do for you. an unreleated file is completely useless

coral cedar
tiny dagger
#

that also is not the file you're running.

compact plover
#

yup

fickle sparrow
#

!pypi ctranslate2

candid hareBOT
compact plover
#

cause that has one line, so you are just lying at this point for some reason. or trolling

tiny dagger
#

IN ANY CASE: that's a warning, you can ignore it

tiny dagger
#

so I think you're good! best of luck going forward

compact plover
#

yup. And if you want to work on resolving tht error yourself the page the warning links to gives you the information for it.

#

which is all there is with what you provided

fickle sparrow
#

For now, yes you can just ignore it, it was from a library where they are hopefully gonna fix soon

compact plover
fickle sparrow
#

Ye

candid hareBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.