Skip to content
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

itchatmp env_test(port) 80端口被占用 #46

Open
lovehuanhuan opened this issue Jun 4, 2018 · 5 comments
Open

itchatmp env_test(port) 80端口被占用 #46

lovehuanhuan opened this issue Jun 4, 2018 · 5 comments

Comments

@lovehuanhuan
Copy link

arm上跑,遇到这个问题,
raise environmenterror:port 80 is in use

但是实际上 netstat-ano 并没有任务占用此端口

@lovehuanhuan
Copy link
Author

import itchatmp

itchatmp.update_config(itchatmp.WechatConfig(
token='',
appId = '',
appSecret = ''))

@itchatmp.msg_register(itchatmp.content.TEXT)
def text_reply(msg):
return msg['Content']

itchatmp.run()
appid什么的 我都删掉了 就是这么个基本的demo

@zjyfdu
Copy link

zjyfdu commented Aug 10, 2018

换一个端口吧
itchatmp.run(port=8181)

@JacksonWuxs
Copy link

你好,我碰到了相同的问题。目前的我解决方法是网页服务器识别到微信来的消息后会进行转发,到我机器人绑定的端口。但是我机器人设计的时候,并不是一问一答式的,也就是说用户发送一个消息来,我会先将消息存在队列里,当做完相应的操作的时候,回复使用 itchatmp.send('message', UserID) 这个函数来实现。 但我发现,似乎这个函数没法回复消息?微信那边没报错,我这边也没报错,但就是收不到消息

@ghost
Copy link

ghost commented Jan 16, 2020

ubuntu上跑,遇到这个问题,
raise environmenterror:port 80 is in use

检查80和443端口都没有被占用,求解决方案?

@ghost
Copy link

ghost commented Jan 16, 2020

ubuntu上跑,遇到这个问题,
raise environmenterror:port 80 is in use

解决方案:
公众号支持的端口是80和443,在unix环境下,小于1024的端口不能被普通用户绑定,只能由有root权限的用户来进行绑定。

切换到root用户执行python,可以顺利运行。

在ubuntu下,切换到root用户:
sudo su

PS:使用sudo运行python会报错。

用itchatmp做了一个订阅号,欢迎关注:啊啦嘻哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants