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

No module named 'src' #101

Open
MrRabbit2MissCat opened this issue Dec 4, 2023 · 3 comments
Open

No module named 'src' #101

MrRabbit2MissCat opened this issue Dec 4, 2023 · 3 comments
Assignees
Labels

Comments

@MrRabbit2MissCat
Copy link

QPT版本

1.0b7

操作系统版本

Windows 10

核心信息填写

复现步骤/报错截图
image

【如报错则必须提供】Requirements文件内容

# Here is the list of packages automatically derived by QPT
# you can ignore the dependent packages in the main package and only care about the main package
# For example, you need to install paddlepaddle and pillow, because paddlepaddle relies on pillow, so you only need to install paddlepaddle.
# ---------------------------------------------------------------------
# QPT Home:        https://github.com/GT-ZhangAcer/QPT
# ---------------------------------------------------------------------
# 
# -------------Mainly depends on package analysis results--------------

paddleocr==2.7.0.3
mfio==1.3.4

# ----------------------Ignored dependent packages---------------------
#nuitka==1.9.2
#qenvpython39==3.9.13
#qpt==1.0b7
#qvcredist==1.0.3
#paddlepaddle_gpu==2.4.2.post116
#twine==4.0.2
#wheel==0.41.2

# ----------------------Ignored sub dependent packages---------------------

# -----Dependencies of paddleocr
#shapely
#scikit_image
#imgaug
#pyclipper
#lmdb
#tqdm
#numpy
#visualdl
#rapidfuzz
#opencv_python<=4.6.0.66
#opencv_contrib_python<=4.6.0.66
#cython
#lxml
#premailer
#openpyxl
#attrdict
#pymupdf<1.21.0
#pillow>=10.0.0
#pyyaml
#python_docx
#beautifulsoup4
#fonttools>=4.24.0
#fire>=0.3.0
#pdf2docx

# -----Dependencies of mfio
#loguru
#xlrd==1.2.0
#xlwt
#numpy
#opencv_python
#xmltodict
#pyyaml
#requests
#openpyxl
#rich


...  
  
↑建议在此处粘贴完整Requirements(Python第三方依赖)列表信息↑  

【如报错则必须提供】完整打包日志

→[2023-12-04 10:13:43,194] [INFO] | ----------ERROR SUMMARY
→[2023-12-04 10:13:43,194] [INFO] | 53|在执行终端命令时检测到了失败,完整信息如下:
(base) PS C:\> cd C:\ ; C:\Users\pc\Desktop\code\sample_program\out\Release\Python\python.exe -m pip download -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt -d C:\Users\pc\Desktop\code\sample_program\out\Release\opt/packages --no-deps -i https://mirrors.aliyun.com/pypi/simple --isolated --disable-pip-version-check --cache-dir C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\pip_cache --timeout 10 --prefer-binary ; echo "---QPT OUTPUT STATUS CODE---" $?
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting shapely==2.0.2 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 3))  Downloading https://mirrors.aliyun.com/pypi/packages/51/18/7a6dfefc08d5899dfca0cde9ada7a58006d06cccc0818e68b2a60bdba8e3/shapely-2.0.2-cp39-cp39-win_amd64.whl (1.4 MB)
     ---------------------------------------- 1.4/1.4 MB 3.7 MB/s eta 0:00:00
Collecting numpy==1.22.4 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 4))
  Downloading https://mirrors.aliyun.com/pypi/packages/99/2e/de8dcdbe1579b96f202685d8811d864291c374ea5fce13c63c70fdaf905d/numpy-1.22.4-cp39-cp39-win_amd64.whl (14.7 MB)
     ---------------------------------------- 14.7/14.7 MB 2.4 MB/s eta 0:00:00
Collecting scikit_image==0.22.0 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 5))
  Downloading https://mirrors.aliyun.com/pypi/packages/3d/97/a09a526eee08683922ca2e37c69742ffdcc879ee40bfe29d3e3d55e821c0/scikit_image-0.22.0-cp39-cp39-win_amd64.whl (24.5 MB)
     ---------------------------------------- 24.5/24.5 MB 2.4 MB/s eta 0:00:00
Collecting scipy==1.11.4 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 6))
  Downloading https://mirrors.aliyun.com/pypi/packages/ac/a0/8b8e5495ba759f99ec99d90973d481e8a6682c320fcf875b4f084591f4d8/scipy-1.11.4-cp39-cp39-win_amd64.whl (44.3 MB)
     ---------------------------------------- 44.3/44.3 MB 2.4 MB/s eta 0:00:00
Collecting networkx==3.2.1 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 7))
  Downloading https://mirrors.aliyun.com/pypi/packages/d5/f0/8fbc882ca80cf077f1b246c0e3c3465f7f415439bdea6b899f6b19f61f70/networkx-3.2.1-py3-none-any.whl (1.6 MB)
     ---------------------------------------- 1.6/1.6 MB 6.2 MB/s eta 0:00:00
Collecting pillow==10.1.0 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 8))  File was already downloaded c:\users\pc\desktop\code\sample_program\out\release\opt\packages\Pillow-10.1.0-cp39-cp39-win_amd64.whl
Collecting imageio==2.33.0 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 9))
  Downloading https://mirrors.aliyun.com/pypi/packages/fa/04/9abe71dfe8c77f5ee58e8c50df3b562884f7494b56c318b867bd2dcb6ec8/imageio-2.33.0-py3-none-any.whl (313 kB)
     ------------------------------------- 313.3/313.3 kB 18.9 MB/s eta 0:00:00
Collecting tifffile==2023.9.26 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 10))
  Downloading https://mirrors.aliyun.com/pypi/packages/f5/72/68ea763b5f3e3d9871492683059ed4724fd700dbe54aa03cdda7a9692129/tifffile-2023.9.26-py3-none-any.whl (222 kB)
     ------------------------------------- 222.9/222.9 kB 13.3 MB/s eta 0:00:00
Collecting packaging==23.2 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 11))
  Downloading https://mirrors.aliyun.com/pypi/packages/ec/1a/610693ac4ee14fcdf2d9bf3c493370e4f2ef7ae2e19217d7a237ff42367d/packaging-23.2-py3-none-any.whl (53 kB)
     ---------------------------------------- 53.0/53.0 kB 2.7 MB/s eta 0:00:00
Collecting lazy_loader==0.3 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 12))
  Downloading https://mirrors.aliyun.com/pypi/packages/a1/c3/65b3814e155836acacf720e5be3b5757130346670ac454fee29d3eda1381/lazy_loader-0.3-py3-none-any.whl (9.1 kB)
Collecting imgaug==0.4.0 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 13))  Downloading https://mirrors.aliyun.com/pypi/packages/66/b1/af3142c4a85cba6da9f4ebb5ff4e21e2616309552caca5e8acefe9840622/imgaug-0.4.0-py2.py3-none-any.whl (948 kB)
     ------------------------------------- 948.0/948.0 kB 10.0 MB/s eta 0:00:00
Collecting six==1.16.0 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 14))
  File was already downloaded c:\users\pc\desktop\code\sample_program\out\release\opt\packages\six-1.16.0-py2.py3-none-any.whl
Collecting matplotlib==3.8.2 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 15))
  Downloading https://mirrors.aliyun.com/pypi/packages/5e/4b/f228e012312120c8b4ef02c43230499e9df7d3075fd1e965086e529a0f49/matplotlib-3.8.2-cp39-cp39-win_amd64.whl (7.6 MB)
     ---------------------------------------- 7.6/7.6 MB 3.0 MB/s eta 0:00:00
Collecting contourpy==1.2.0 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 16))
  Downloading https://mirrors.aliyun.com/pypi/packages/ba/e5/05fdbe3a7570777464595ab1de9047adef7de99659cf969dbfe007e165cb/contourpy-1.2.0-cp39-cp39-win_amd64.whl (181 kB)
     -------------------------------------- 181.9/181.9 kB 2.7 MB/s eta 0:00:00
Collecting cycler==0.12.1 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 17))
  Downloading https://mirrors.aliyun.com/pypi/packages/e7/05/c19819d5e3d95294a6f5947fb9b9629efb316b96de511b418c53d245aae6/cycler-0.12.1-py3-none-any.whl (8.3 kB)
Collecting fonttools==4.45.1 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 18))
  Downloading https://mirrors.aliyun.com/pypi/packages/a0/81/d05174467a9e9460366325c84d032ea2505178c0b4df9b8ae76877cbb13b/fonttools-4.45.1-cp39-cp39-win_amd64.whl (2.2 MB)
     ---------------------------------------- 2.2/2.2 MB 8.6 MB/s eta 0:00:00
Collecting kiwisolver==1.4.5 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 19))
  Downloading https://mirrors.aliyun.com/pypi/packages/ca/c1/1f986c8119c0c57c2bd71d1941da23332c38ee2c90117e46dff4358b70f7/kiwisolver-1.4.5-cp39-cp39-win_amd64.whl (56 kB)
     ---------------------------------------- 56.2/56.2 kB ? eta 0:00:00
Collecting pyparsing==3.1.1 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 20))
  Downloading https://mirrors.aliyun.com/pypi/packages/39/92/8486ede85fcc088f1b3dba4ce92dd29d126fd96b0008ea213167940a2475/pyparsing-3.1.1-py3-none-any.whl (103 kB)
     ---------------------------------------- 103.1/103.1 kB ? eta 0:00:00
Collecting python_dateutil==2.8.2 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 21))
  Downloading https://mirrors.aliyun.com/pypi/packages/36/7a/87837f39d0296e723bb9b62bbb257d0355c7f6128853c78955f57342a56d/python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ------------------------------------- 247.7/247.7 kB 14.8 MB/s eta 0:00:00
Collecting importlib_resources==6.1.1 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 22))
  Downloading https://mirrors.aliyun.com/pypi/packages/93/e8/facde510585869b5ec694e8e0363ffe4eba067cb357a8398a55f6a1f8023/importlib_resources-6.1.1-py3-none-any.whl (33 kB)
Collecting zipp==3.17.0 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 23))
  Downloading https://mirrors.aliyun.com/pypi/packages/d9/66/48866fc6b158c81cc2bfecc04c480f105c6040e8b077bc54c634b4a67926/zipp-3.17.0-py3-none-any.whl (7.4 kB)
Collecting opencv_python==4.5.3.56 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 24))
  Downloading https://mirrors.aliyun.com/pypi/packages/4f/5b/5b128d3fb796d04e064d5f455a1c3edfd0484942dabd13b45065acd62ab1/opencv_python-4.5.3.56-cp39-cp39-win_amd64.whl (34.9 MB)
     ---------------------------------------- 34.9/34.9 MB 2.4 MB/s eta 0:00:00
Collecting pyclipper==1.3.0.post5 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 25))
  Downloading https://mirrors.aliyun.com/pypi/packages/97/d7/78140d011dbe7887a8205222e0ddfc0fc60a2b6223202b4504de2ebda3e1/pyclipper-1.3.0.post5-cp39-cp39-win_amd64.whl (108 kB)
     -------------------------------------- 108.6/108.6 kB 2.1 MB/s eta 0:00:00
Collecting lmdb==1.4.1 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 26))
  Downloading https://mirrors.aliyun.com/pypi/packages/ff/59/6b14c0d05a5366a558dbde51339062d77aa9f9af132a478860609ba69943/lmdb-1.4.1-cp39-cp39-win_amd64.whl (105 kB)
     -------------------------------------- 105.9/105.9 kB 2.0 MB/s eta 0:00:00
Collecting tqdm==4.66.1 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 27))
  Downloading https://mirrors.aliyun.com/pypi/packages/00/e5/f12a80907d0884e6dff9c16d0c0114d81b8cd07dc3ae54c5e962cc83037e/tqdm-4.66.1-py3-none-any.whl (78 kB)
     ---------------------------------------- 78.3/78.3 kB 4.3 MB/s eta 0:00:00
Collecting colorama==0.4.6 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 28))
  Downloading https://mirrors.aliyun.com/pypi/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting visualdl==2.5.3 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 29))
  Downloading https://mirrors.aliyun.com/pypi/packages/ea/b5/37726c750a4f4598660998327c3566b2d2ed5a1a5f44e9f0dde875602447/visualdl-2.5.3-py3-none-any.whl (6.3 MB)
     ---------------------------------------- 6.3/6.3 MB 3.3 MB/s eta 0:00:00
Collecting bce_python_sdk==0.8.97 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 30))
  Downloading https://mirrors.aliyun.com/pypi/packages/0d/8e/a5e4d584c226e9eed2ea12334b8bc83dca53313c9ed35c6837b1f0ad772c/bce_python_sdk-0.8.97-py3-none-any.whl (241 kB)
     -------------------------------------- 241.5/241.5 kB 5.0 MB/s eta 0:00:00
Collecting pycryptodome==3.19.0 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 31))
  Downloading https://mirrors.aliyun.com/pypi/packages/87/c4/c979db0914a23541d62c9e4b5e8a30f56a78c6dec8677db6a5327d306be5/pycryptodome-3.19.0-cp35-abi3-win_amd64.whl (1.7 MB)
     ---------------------------------------- 1.7/1.7 MB 5.0 MB/s eta 0:00:00
Collecting future==0.18.3 (from -r C:\Users\pc\AppData\Local\Temp\QPT_Cache_V/1.0b7\Cache\requirements_dev.txt (line 32))
  Downloading https://mirrors.aliyun.com/pypi/packages/8f/2e/cf6accf7415237d6faeeebdc7832023c90e0282aa16fd3263db0eb4715ec/future-0.18.3.tar.gz (840 kB)
     -------------------------------------- 840.9/840.9 kB 3.5 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  python setup.py egg_info did not run successfully.
  exit code: 1

  [6 lines of output]
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\pc\AppData\Local\Temp\pip-download-f5a8duh1\future_086a452f2aca4a9689065d941ea2b6ca\setup.py", line 86, in <module>
      import src.future
  ModuleNotFoundError: No module named 'src'
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

→[2023-12-04 10:13:43,196] [INFO] | ----------生成状态WARNING:53 ERROR:1
→[2023-12-04 10:13:43,196] [WARNING] | SUMMARY结束,发现上述异常情况,请确认后按任意键继续!
  
## 其他信息
@GT-ZhangAcer
Copy link
Member

future的这个报错与future作者的打包方式有较大关系,目前主流的是whl格式而不是egg,在一些环境中可能存在不兼容的情况,具体解决方案可以参考如下 https://www.jianshu.com/p/a7522ca6dec4
图片

在QPT中,可以在requirements.txt文件中指定#$QPT_FLAG$copy标识符,指定该包的安装方式进行解决。

paddleocr
paddlepaddle
future #$QPT_FLAG$copy
其它库...

方便的话尽量也提供一下打包时候的代码or命令,我尝试复现一下这个情况,之前测试这个案例是可以通过的。

@MrRabbit2MissCat
Copy link
Author

run.py

# -*- coding: utf-8 -*-#
from paddleocr import PaddleOCR, draw_ocr

ocr = PaddleOCR(use_angle_cls=True, use_gpu=True, ocr_version='PP-OCRv3', show_log=False)

environment:

conda 23.10.0
python3.9.0

command:

直接cmd输入qpt运行的,
(py39) PS C:\Users\pc\Desktop\code> qpt
→[2023-12-04 15:58:18,346] [DEBUG] | 操作系统类型:Windows
→[2023-12-04 15:58:18,346] [DEBUG] | 操作系统位数:AMD64
D:\software\miniconda3\envs\py39\lib\site-packages_distutils_hack_init_.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
[项目文件夹]请输入待打包的文件夹路径: C:\Users\pc\Desktop\code\sample_program
[主程序文件]请输入待打包的主要Py脚本文件路径: C:\Users\pc\Desktop\code\sample_program\run.py
[输出目录]请输入打包后文件保存的路径: C:\Users\pc\Desktop\code\out
[Python依赖]请输入requirements.txt文件路径,若无该文件可直接按下[回车键]自动生成该文件 [auto]:

question

跟我用conda有关系吗,用原始的python环境,bug会少点吧

@GT-ZhangAcer
Copy link
Member

目测与conda有关

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

No branches or pull requests

2 participants