-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python main.py --platform xhs --lt qrcode --type search 命令行执行时缺少库 import httpx ModuleNotFoundError: No module named 'httpx' #518
Comments
这种问题请自查,不属于MediaCrawler仓库问题范畴。 |
非常不好意思 venv中从pip list来看是有http 0.24.0这个包的 又尝试单独安装 pip install httpx==0.24.0 Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ 可以看到也确实是安装在venv下的 把项目clone下来之后严格按照Readme的步骤执行的命令,运行不起来,可能会有人和我有一样的问题,我的意思如果能找到原因后续可以优化在Readme中 |
这个和仓库没有什么关系的,是你的mac系统python环境问题,你的虚拟环境虽然装了httpx且看起来进了虚拟环境,但是实际的运行的python不是你的虚拟环境的,临时解决方案:直接全局install,然后你要去谷歌搜索下你这个问题的解决方案。 |
多谢作者的认真负责 执行命令改为 ./venv/bin/python3.9 main.py --platform xhs --lt qrcode --type search 就没问题了 很奇怪,ls -l ./venv/bin/python3.9 显示python的位置在/Users/x/.pyenv/versions/3.9.6/bin/python3.9 但如果不用./venv/bin/python3.9执行,确实是“实际的运行的python不是你的虚拟环境的”,奇怪 |
按照顺序执行,都没有问题,python版本是3.9.6
出现问题如下:
(venv) x@MacBook-Air PythonProject % python main.py --platform xhs --lt qrcode --type search
Traceback (most recent call last):
File "/Users/x/PycharmProjects/PythonProject/main.py", line 4, in
import cmd_arg
File "/Users/x/PycharmProjects/PythonProject/cmd_arg/init.py", line 3, in
from .arg import *
File "/Users/x/PycharmProjects/PythonProject/cmd_arg/arg.py", line 7, in
from tools.utils import str2bool
File "/Users/x/PycharmProjects/PythonProject/tools/utils.py", line 4, in
from .crawler_util import *
File "/Users/x/PycharmProjects/PythonProject/tools/crawler_util.py", line 11, in
import httpx
ModuleNotFoundError: No module named 'httpx'
在pycharm里debug模式没有问题,但命令行执行时python main.py 就会报错缺少httpx,可是httpx已经安装了,并且版本确实是0.24.0
The text was updated successfully, but these errors were encountered: