#๐ i have search on the internet. i can't find solutions day work for UserWarning: pkg_resources
61 messages ยท Page 1 of 1 (latest)
@coral cedar
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.
the error is cutoff, provide the error in text form or any way that shows the full error in a readable way
: 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
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
Please also show the code
i am trying to use faster whisper
If you refuse to share the code
The URL provided in the warning serve best at helping you
https://setuptools.pypa.io/en/latest/pkg_resources.html
Still, show the code, at least the first 10 line speech/test2.py
from faster_whisper import WhisperModel
this is the code
Clearly not because the warning is from line 4
that's literally all that's in that file?
This is a single line
jes importing shit
and so what is the contents of test2.py
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
i am testing text to speech
why are you being so reticent about sharing your code?
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
!paste
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.
It is probably faster than keep refusing
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.
Hey @coral cedar!
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
jes
so the warning is for a blank line,,, ?
And this is speech/test2.py ? Weird it point to an empty line
I don't care what your attempt
You run test2.py
And have this warning
So we asked you to show test2.py
For the n th time
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
provide the file that throws the error or there is nothing we can do for you. an unreleated file is completely useless
that also is not the file you're running.
yup
!pypi ctranslate2
cause that has one line, so you are just lying at this point for some reason. or trolling
IN ANY CASE: that's a warning, you can ignore it

so I think you're good! best of luck going forward
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
For now, yes you can just ignore it, it was from a library where they are hopefully gonna fix soon
Relevant GitHub issue:
https://github.com/OpenNMT/CTranslate2/issues/1894
...\site-packages\ctranslate2_init_.py:8: 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 re...
or if one felt so inclined, fork and fix it yourself ๐
Ye
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.