guofei9987 / blind_watermark

Blind&Invisible Watermark ,图片盲水印,提取水印无须原图!
https://blindwatermark.github.io/blind_watermark/#/en/
MIT License
5.75k stars 683 forks source link

缺少pywt库支持 lack of pywt lib support #13

Closed GSUI5051 closed 3 years ago

GSUI5051 commented 3 years ago

安装模组:pip install blind_watermark, 成功 module install:pip install blind_watermark, SUCCESS

运行示范代码,记录如下: Run Demo Code, log:

C:\Users\40411>F:\<REDACTED>\加密.py
Traceback (most recent call last):
  File "F:\<REDACTED>\加密.py", line 1, in <module>
    from blind_watermark import WaterMark
  File "C:\Program Files\Python39\lib\site-packages\blind_watermark\__init__.py", line 1, in <module>
    from .blind_watermark import WaterMark
  File "C:\Program Files\Python39\lib\site-packages\blind_watermark\blind_watermark.py", line 9, in <module>
    from pywt import dwt2, idwt2
ModuleNotFoundError: No module named 'pywt'

随后输入pip install pywt, 记录如下: Run pip install pywt in cmd, log:

C:\Users\40411>pip install pywt
ERROR: Could not find a version that satisfies the requirement pywt
ERROR: No matching distribution found for pywt

目前可用解决方案:使用豆瓣镜像,成功 Current solution: Use Douban mirror, SUCCESS

C:\Users\40411>pip install pywt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='pypi.doubanio.com', port=80): Read timed out. (read timeout=15)")': /simple/pywt/
Collecting pywt
  Downloading http://pypi.doubanio.com/packages/36/e7/f66773672b8d6ab98594c0f3116745810b03ba5399647a51985243978914/pywt-1.0.6-py3-none-any.whl (3.7 kB)
Requirement already satisfied: requests in c:\program files\python39\lib\site-packages (from pywt) (2.25.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\program files\python39\lib\site-packages (from requests->pywt) (1.26.2)
Requirement already satisfied: idna<3,>=2.5 in c:\program files\python39\lib\site-packages (from requests->pywt) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in c:\program files\python39\lib\site-packages (from requests->pywt) (2020.12.5)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\program files\python39\lib\site-packages (from requests->pywt) (3.0.4)
Installing collected packages: pywt
Successfully installed pywt-1.0.6
GSUI5051 commented 3 years ago

进一步的测试:无法导入dwt2, idwt2, 记录: further test:can't import dwt2, idwt2, log:

C:\Users\40411>F:\<REDACTED>\加密.py
Traceback (most recent call last):
  File "F:\<REDACTED>\加密.py", line 1, in <module>
    from blind_watermark import WaterMark
  File "C:\Program Files\Python39\lib\site-packages\blind_watermark\__init__.py", line 1, in <module>
    from .blind_watermark import WaterMark
  File "C:\Program Files\Python39\lib\site-packages\blind_watermark\blind_watermark.py", line 9, in <module>
    from pywt import dwt2, idwt2
ImportError: cannot import name 'dwt2' from 'pywt' (C:\Program Files\Python39\lib\site-packages\pywt\__init__.py)

备用解决方案:用如下代码安装库 ALTN solution: Use these code to install lib deps

pip install pywt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip install PyWavelets
guofei9987 commented 3 years ago

大赞! 👍👍👍