Skip to content

ImportError: cannot import name 'state' from 'pyphonic' #4

@sedwardsmarsh

Description

@sedwardsmarsh

I got the following two errors after installing Pyphonic 0.9.1 to a new virtual environment.
Here are the results of running pip list in my virtual environment:

mido       1.3.2
numpy      1.26.3
packaging  23.2
pip        21.2.3
Pyphonic   0.9.1
setuptools 57.4.0

I'm using MacOS 14.2 on an M1 chip.


I get the following ImportError when I try to use the provided example from this repo:

  • ImportError: cannot import name 'state' from 'pyphonic' (/Users/sadedwar/code/fun/guitar-pedal/venv/lib/python3.9/site-packages/pyphonic/__init__.py)

I used the following example code:

import pyphonic
from pyphonic import state

def process(midi, audio):
    if state.bpm > 140:
        return [x * 1.1 for x in audio]
    return [0.0] * len(audio)

PORT = 8020
pyphonic.start(process, PORT)

I also tried commenting-out the second line in the example above and then I got an AttributeError:

  • AttributeError: module 'pyphonic' has no attribute 'start'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions