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

python报错没有qrcode 安装也没用 #28

Open
jzh20042003 opened this issue Apr 28, 2020 · 8 comments
Open

python报错没有qrcode 安装也没用 #28

jzh20042003 opened this issue Apr 28, 2020 · 8 comments

Comments

@jzh20042003
Copy link

jzh20042003 commented Apr 28, 2020

安装以后不管执行什么命令都会提示没有模块叫qrcode
然后我试了pip install qrcode也没有
然后我又试了pip uninstall qrcode再pip install qrcode也没用啊
改密码什么也不行 直接跳出来一堆错误然后问我要不要下载图片.......
然后我就只能卸载了...

@GluAusor
Copy link

GluAusor commented Mar 7, 2021

centos安装qrcode的方法(依次执行):
yum -y install epel-release
yum -y install python-pip
pip install --upgrade pip
pip install qrcode

@leitbogioro
Copy link
Owner

centos安装qrcode的方法(依次执行):
yum -y install epel-release
yum -y install python-pip
pip install --upgrade pip
pip install qrcode

可以的,我更新一下

@Docop2
Copy link

Docop2 commented Jun 15, 2021

I got some issue as well, just running ssr when going to view config : it ask for a qr install, click Y. but told : /root/ssr_qrcode.png - no such file..
i then put the pip3.8 install qrcode, and also do the update from the menu, but i still get a : /etc/init.d/shadowsocks line 41 /usr/local/shadowsocks/server.py no such file. and shadowsocksR failed. and if i just start : ssr , and just try to change port, i got:

Traceback (most recent call last):
File "/usr/local/SSR.Go/changeport.py", line 3, in
import ssrextra
File "/usr/local/SSR.Go/ssrextra.py", line 9, in
import qrcode
ImportError: No module named qrcode
ShadowsocksR is stopped
/etc/init.d/shadowsocks: line 41: /usr/local/shadowsocks/server.py: No such file or directory
Starting ShadowsocksR failed

hope it help.

@Ventulus-lab
Copy link

@leitbogioro
我的问题跟@Docop2 一样
Traceback (most recent call last):
File "/usr/local/SSR.Go/connectinfo.py", line 3, in
import readjson, base64, os, json
File "/usr/local/SSR.Go/readjson.py", line 4, in
from ssrextra import byteify
File "/usr/local/SSR.Go/ssrextra.py", line 3, in
import os, random, string, socket, urllib2, base64, qrcode, subprocess, ssl
ImportError: No module named qrcode
找不到qrcode
我估计是这样的:
首先pip的安装脚本估计用了python3的语法,而你脚本里默认给装的是python2.
所以我们手动安装py3,
yum install python3
然后使用pip3来更新
pip3 install --upgrade pip
pip install --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.6/site-packages (21.3.1)

再安装qrcode
pip3 install qrcode
pip install qrcode
Requirement already satisfied: qrcode in /usr/local/lib/python3.6/site-packages (7.3.1)
所以现在qrcode这个模块是安装到python3.6这个目录了。
所以我怀疑你的脚本里是不是还用的py2,然后就找不到这个模块了。
最糟糕的是,qr模块不行,你这配置脚本改密码改端口协议啥的都不能用了,
讲道理,对用户来说这个二维码模块其实并不是必要的。自己填个端口密码之类的又不麻烦。
建议你赶紧更新py脚本。。把这功能解耦

@Ventulus-lab
Copy link

从记录中可以看到
Traceback (most recent call last):
File "/usr/local/SSR.Go/changemethod.py", line 3, in
from readjson import ConfMethod
File "/usr/local/SSR.Go/readjson.py", line 4, in
from ssrextra import byteify
File "/usr/local/SSR.Go/ssrextra.py", line 3, in
import os, random, string, socket, urllib2, base64, qrcode, subprocess, ssl
ImportError: No module named qrcode
Traceback (most recent call last):
File "/usr/local/SSR.Go/connectinfo.py", line 3, in
import readjson, base64, os, json
File "/usr/local/SSR.Go/readjson.py", line 4, in
from ssrextra import byteify
File "/usr/local/SSR.Go/ssrextra.py", line 3, in
import os, random, string, socket, urllib2, base64, qrcode, subprocess, ssl
ImportError: No module named qrcode
无论干啥子都要readjson,而这个readjson.py又要 ssrextra中的byteify功能,而ssrextra一上来加载的一大堆功能,其中qrcode不行你就彻底完蛋。。影响了主要功能

@Ventulus-lab
Copy link

所以解决方案:
修改/usr/local/SSR.Go/ssrextra.py文件
把开头
“import os, random, string, socket, urllib2, base64, qrcode, subprocess, ssl”
中的“qrcode,”给去掉
然后最后一段函数
def genQR_Code(ssr_url, path):
qr = qrcode.QRCode(version=2, error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=1)
qr.add_data(ssr_url)
qr.make(fit=True)
img = qr.make_image()
img.save(path)
直接修改成
def genQR_Code(ssr_url, path):
return
咱不要生成二维码,就正常干就好了
(如果你想直接删除这函数,还得同时删除其他文件中调用这函数的语句)

@Ventulus-lab
Copy link

建议在安装脚本里把这个二维码功能作为可选项。。

@Ventulus-lab
Copy link

另外,我个人推荐 加密使用none(auth_chain协议已自带rc4)或者chacha20-ietf (谷歌推荐的算法)或者aes系列(现在处理器有专门加速指令集)
协议使用auth_chain系列
主要是auth_akarin_spec_a支持的手机客户端太少了
混淆使用plain或者http_simpl
这个很重要,使用各种伪装混淆就是画蛇添足,反而引起怀疑和阻断。

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

5 participants