【发布时间】:2020-12-08 04:30:00
【问题描述】:
我一直在尝试导入一些用于抓取 cmets 的包,但每次它在终端中正确下载时,都会在 python 中出现模块未找到错误。我尝试使用 sudo 创建一个虚拟环境,使用终端下载中的路径,更改终端 和 python 本身中的路径。我已经找到了要使用的路径 setup.py 和 pyproject.toml,如上所示,但什么也没有(没有 pyproject 和许多设置,但它们都来自 Unity 或内部模块)。当我输入“pip3 list”时,我的所有模块都会出现。我从this website粘贴了代码来更改目录,只编辑了Users/Oscar/myenv/lib/python3.7/site-packages的三个路径并得到了这个:(其代码的路径)
Current Working Directory /Users/Oscar/Desktop/Python Scripts/Stolen Codes
Can't change the Current Working Directory
Current Working Directory /Users/Oscar/Desktop/Python Scripts/Stolen Codes
Can't change the Current Working Directory
Current Working Directory /Users/Oscar/Desktop/Python Scripts/Stolen Codes
此外,在终端输入“pip3 install selenium ~/myenv/lib/python3.7/site-packages”时,我收到了这个错误:
ERROR: Directory '/Users/Oscar/myenv/lib/python3.7/site-packages' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
我是管理员,所以有人知道如何解决吗?我在网上花了很长时间试图导入,对不起全文
【问题讨论】:
-
如果您只尝试
pip install selenium会发生什么?
标签: python import terminal module path