admin管理员组文章数量:1279057
I'm trying to run a script (start.sh) that depends on a Python virtual environment with formant and protobuf. However, I'm encountering an error when importing runtime_version from google.protobuf. I've followed several steps to resolve it, but the issue persists. Below, I provide details about my environment, pre-conditions, actual results, and expected results.
Environment: Operating System: Ubuntu Jellyfish
Python: 3.10
Virtual Environment: mi_entorno (created with python3 -m venv)
Installed Packages:
formant==1.230.2
protobuf==3.19.5 (version compatible with formant)
Pre-Conditions:
I created a virtual environment using python3 -m venv mi_entorno.
I activated the virtual environment: source mi_entorno/bin/activate.
I installed dependencies from a requirements.txt file that includes formant and protobuf.
The requirements.txt file specifies protobuf<=3.19.5,>=3.15.8 as a requirement for formant.
Actual Result: When trying to run the start.sh script, I get the following error:
File "<venv_path>/lib/python3.10/site-packages/formant/protos/agent/v1/agent_pb2.py", line 9, in <module>
from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (<venv_path>/lib/python3.10/site-packages/google/protobuf/__init__.py)
Additionally, when trying to update protobuf, I get a dependency conflict message:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
formant 1.230.2 requires protobuf<=3.19.5,>=3.15.8; python_version >= "3.0.0", but you have protobuf 5.29.3 which is incompatible.
Question: How can I resolve the runtime_version import error from google.protobuf? Is there a way to make formant compatible with a newer version of protobuf, or do I need to modify the code to avoid using runtime_version?
本文标签:
版权声明:本文标题:python - Error importing runtime_version from google.protobuf in a virtual environment with formant and protobuf - Stack Overflo 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741287648a2370365.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论