我正在尝试使用以下命令在 python 中安装上下文模块:
pip install context
但我遇到这个错误:
ERROR : could not find a version that satisfies the requirement context.viewer (from context)
ERROR : no matching distribution found for context.viewer
我尝试了网站上提到的所有解决方案,但没有得到任何结果。
context
需要context.api
和context.viewer
;前者可用,但后者不可用。
两个可用模块均为 0.0 版本,于 2012 年发布。底线:该模块已被废弃和损坏,别管它了。
您确定您确实需要这个模块而不是另一个吗? “上下文”这个词在编程中用得相当多……
晚上好, 我可以在 pycharm 中安装上下文,也可以在我的 PC 的终端中安装上下文。 升级 pip、setuptools、wheel:
python3 -m pip install --升级 pip setuptools 轮
apt-get 安装 python3-venv
进入 venv 模式:
源/home/vb1/PycharmProjects/sub-vb1.py/venv/bin/activate
pip 安装 context.api
创建 venv(虚拟环境)有 3 种方法: https://virtualenvwrapper.readthedocs.io/en/latest/ https://packaging.python.org/en/latest/tutorials/installing-packages/#optionally-create-a-virtual-environment
https://docs.python.org/3/library/venv.html
#总而言之,最简单的方法就是使用pycharm:
我的 github 页面中也有一些代码示例:
https://github.com/amin-tayebi/Smart-Irrigation-Precision-Agriculture-using-Lorawan/tree/main/API
如果您尝试直接从 sqlalchemy 导入上下文,请尝试 sqlalchemy.orm
如果您尝试渲染 wxPython、PyGame 和 GLUT 的上下文(包括导航)以及 Tkinter 的部分上下文,请使用此工具。
pip install OpenGLContext