#🔒 calling on imports that are not included

29 messages · Page 1 of 1 (latest)

stable estuary
#

i am working on a bot for a server and my code keeps calling on import datetime when it is not conected to anything. because of this its stopping the code from working

tranquil talonBOT
#

@stable estuary

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.

naive citrus
#

This sounds quite vague to me.

ripe crater
#

and pip list for virtual environment?

naive citrus
#

I don't see anything related to datetime in there. For that error though, cgi is deprecated and removed in later versions of Python.

#

Deprecated since version 3.11, will be removed in version 3.13: The cgi module is deprecated (see PEP 594 for details and alternatives).

#

And you're using Python 3.13, so that error is expected.

uneven grotto
#

You could try upgrading your aiohttp package, might be updated for the new release.

stable estuary
#

sorry i said the wrong one i resolved the datetime problem and its the cgi i need

uneven grotto
#

(Because it's aiohttp which it trying to import it.)

stable estuary
uneven grotto
#

Try rolling back to Python 3.12 if this is problem.

#

PEP 594: https://peps.python.org/pep-0594/
Alas, it does not list an alternative source for the cgi module. So you're stuck with Python 3.12 for now until aiohttp gets updated to handle the new situation.

stable estuary
uneven grotto
#

Traceback?

#

Have you installed audioop? If not, do so.

stable estuary
#

shouldn't that already be installed

uneven grotto
#

I have no idea. Try it.

#

The traceback would say if it's installed.

dusky quail
#

audioop was a stdlib but was recently removed in 3.13

#

!pypi audioop-lts

tranquil talonBOT
dusky quail
#

use this if you still need it

tranquil talonBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.