From replit import audio error

Question:

I have students who are to create an assignment in Python that uses audio. The following 2 lines were working a few weeks ago when Semester 1 ended:

from replit import audio
import time

Now I am receiving an error as below.

Repl link/Link to where the bug appears:
https://replit.com/@DarrellCobb1/BluevioletFloweryTriangles

Screenshots, links, or other helpful context:

--> poetry add replit
Using version ^3.5.0 for replit

Updating dependencies
Resolving dependencies...

Because no versions of replit match >3.5.0,<4.0.0
 and replit (3.5.0) depends on Flask (>=2.0.0,<3.0.0), replit (>=3.5.0,<4.0.0) requires Flask (>=2.0.0,<3.0.0).
So, because python-template depends on both flask (^3.0.0) and replit (^3.5.0), version solving failed.
exit status 1
Traceback (most recent call last):
  File "/home/runner/BluevioletFloweryTriangles/main.py", line 1, in <module>
    from replit import audio
ModuleNotFoundError: No module named 'replit'

Thanks!

Hey, @DarrellCobb1!
Could you try running this command in the shell?
poetry remove replit flask && poetry add flask@">=2.0.0,<3.0.0" && poetry add replit


Please keep in mind that Replit Teams for Edu will be removed entirely by August 1st. To ease this transition, Replit should release a program to export your courses by the end of March.

2 Likes

in addition to what RedCoder said make sure your pitches aren’t overlapping when it comes to security because that could also be a problem because the console will want to run them as separate things so causing it to make a kinda clicky sound

What do you mean?


It shouldn’t emit any sound…

1 Like

my bad I misread the issue I thought it was about a problem with sounds not being emitted as opposed to an audio not being installed

No problem, just remember to carefully read the issue before offering a solution next time.

2 Likes
~/BluevioletFloweryTriangles$ poetry remove replit flask && poetry add flask@">=2.0.0,<3.0.0" && poetry add replit

The following packages were not found: replit
~/BluevioletFloweryTriangles$

Try running this:
poetry remove flask && poetry add flask@">=2.0.0,<3.0.0" && poetry add replit

Wouldn’t that also work if you removed flask, and then added flask and Replit together so it did version checking?

~/BluevioletFloweryTriangles$ poetry add flask@">=2.0.0,<3.0.0" && poetry add replit

Updating dependencies
Resolving dependencies... (0.1s)

Package operations: 0 installs, 1 update, 0 removals

  • Updating flask (3.0.0 -> 2.3.3)

Writing lock file
Using version ^3.5.0 for replit

Updating dependencies
Resolving dependencies... (4.0s)

Package operations: 24 installs, 0 updates, 0 removals

  • Installing pycparser (2.21)
  • Installing cffi (1.16.0)
  • Installing frozenlist (1.4.1)
  • Installing idna (3.6)
  • Installing multidict (6.0.5)
  • Installing aiosignal (1.3.1)
  • Installing argon2-cffi-bindings (21.2.0)
  • Installing attrs (23.2.0)
  • Installing yarl (1.9.4)
  • Installing async-timeout (4.0.3)
  • Installing aiohttp (3.9.3)
  • Installing argon2-cffi (23.1.0)
  • Installing certifi (2024.2.2)
  • Installing charset-normalizer (3.3.2)
  • Installing cryptography (42.0.4)
  • Installing iso8601 (2.1.0)
  • Installing pycryptodomex (3.20.0)
  • Installing urllib3 (1.26.18)
  • Installing aiohttp-retry (2.8.3)
  • Installing protobuf (4.25.3)
  • Installing pyseto (1.7.8)
  • Installing requests (2.31.0)
  • Installing typing-extensions (4.9.0)
  • Installing replit (3.5.0)

Writing lock file
~/BluevioletFloweryTriangles$

Try running your Repl now.

Hi,

I have the audio sample playing now. Will all my students need to run this command from the Shell for audio to work for them?

Thanks!

If they fork your working Repl, no they will not.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.