如何在Windows中使用python包资源?

new9mtju  于 2022-11-18  发布在  Windows
关注(0)|答案(1)|浏览(106)

我尝试导入资源,但出现了一个错误,没有模块命名为资源。但是,我已经通过pip安装了这个包。如何修复这个问题?enter image description here
尝试导入资源。希望知道如何修复Windows中的错误。

ruarlubt

ruarlubt1#

您可以执行pip install resource来查看软件包的安装位置,您将得到类似于下面的结果:

Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /opt/homebrew/anaconda3/lib/python3.9/site-packages (from jsonschema->JsonForm>=0.0.2->resource) (0.18.0)
Requirement already satisfied: attrs>=17.4.0 in /opt/homebrew/anaconda3/lib/python3.9/site-packages (from jsonschema->JsonForm>=0.0.2->resource) (21.4.0)

然后,检查安装路径(对我来说:/opt/homebrew/anaconda 3/lib/python3.9/site-packages)添加到Windows环境变量中

相关问题