Open QGB opened 2 years ago
python -m pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com dill flask requests wcwidth ipython
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: http://pypi.douban.com/simple
Collecting dill
Downloading http://pypi.doubanio.com/packages/12/ff/3b1a8f5d59600393506c64fa14d13afdfe6fe79ed65a18d64026fe9f8356/dill-0.3.5.1-py2.py3-none-any.whl (95 kB)
---------------------------------------- 95.8/95.8 kB 1.4 MB/s eta 0:00:00
Collecting flask
Downloading http://pypi.doubanio.com/packages/af/6a/00d144ac1626fbb44c4ff36519712e258128985a5d0ae43344778ae5cbb9/Flask-2.1.3-py3-none-any.whl (95 kB)
---------------------------------------- 95.6/95.6 kB 1.4 MB/s eta 0:00:00
Collecting requests
Downloading http://pypi.doubanio.com/packages/ca/91/6d9b8ccacd0412c08820f72cebaa4f0c0441b5cda699c90f618b6f8a1b42/requests-2.28.1-py3-none-any.whl (62 kB)
---------------------------------------- 62.8/62.8 kB 3.3 MB/s eta 0:00:00
Collecting wcwidth
Downloading http://pypi.doubanio.com/packages/59/7c/e39aca596badaf1b78e8f547c807b04dae603a433d3e7a7e04d67f2ef3e5/wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting ipython
Downloading http://pypi.doubanio.com/packages/fe/10/0a5925e6e8e4c948b195b4c776cae0d9d7bc6382008a0f7ed2d293bf1cfb/ipython-8.4.0-py3-none-any.whl (750 kB)
---------------------------------------- 750.8/750.8 kB 3.0 MB/s eta 0:00:00
Collecting itsdangerous>=2.0
Downloading http://pypi.doubanio.com/packages/68/5f/447e04e828f47465eeab35b5d408b7ebaaaee207f48b7136c5a7267a30ae/itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting click>=8.0
Downloading http://pypi.doubanio.com/packages/c2/f1/df59e28c642d583f7dacffb1e0965d0e00b218e0186d7858ac5233dce840/click-8.1.3-py3-none-any.whl (96 kB)
---------------------------------------- 96.6/96.6 kB 5.4 MB/s eta 0:00:00
Collecting Werkzeug>=2.0
Downloading http://pypi.doubanio.com/packages/c4/44/f50f2d22cdfb6d56c03d1b4cc3cfa03ebee2f21b59a7768f151e43415ba5/Werkzeug-2.1.2-py3-none-any.whl (224 kB)
---------------------------------------- 224.9/224.9 kB 4.6 MB/s eta 0:00:00
Collecting importlib-metadata>=3.6.0
Downloading http://pypi.doubanio.com/packages/d2/a2/8c239dc898138f208dd14b441b196e7b3032b94d3137d9d8453e186967fc/importlib_metadata-4.12.0-py3-none-any.whl (21 kB)
Collecting Jinja2>=3.0
Downloading http://pypi.doubanio.com/packages/bc/c3/f068337a370801f372f2f8f6bad74a5c140f6fda3d9de154052708dd3c65/Jinja2-3.1.2-py3-none-any.whl (133 kB)
---------------------------------------- 133.1/133.1 kB 4.0 MB/s eta 0:00:00
Collecting charset-normalizer<3,>=2
Downloading http://pypi.doubanio.com/packages/94/69/64b11e8c2fb21f08634468caef885112e682b0ebe2908e74d3616eb1c113/charset_normalizer-2.1.0-py3-none-any.whl (39 kB)
Collecting urllib3<1.27,>=1.21.1
Downloading http://pypi.doubanio.com/packages/68/47/93d3d28e97c7577f563903907912f4b3804054e4877a5ba6651f7182c53b/urllib3-1.26.10-py2.py3-none-any.whl (139 kB)
---------------------------------------- 139.2/139.2 kB 4.2 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
Downloading http://pypi.doubanio.com/packages/e9/06/d3d367b7af6305b16f0d28ae2aaeb86154fa91f144f036c2d5002a5a202b/certifi-2022.6.15-py3-none-any.whl (160 kB)
---------------------------------------- 160.2/160.2 kB 4.8 MB/s eta 0:00:00
Collecting idna<4,>=2.5
Downloading http://pypi.doubanio.com/packages/04/a2/d918dcd22354d8958fe113e1a3630137e0fc8b44859ade3063982eacd2a4/idna-3.3-py3-none-any.whl (61 kB)
---------------------------------------- 61.2/61.2 kB ? eta 0:00:00
Collecting pygments>=2.4.0
Downloading http://pypi.doubanio.com/packages/5c/8e/1d9017950034297fffa336c72e693a5b51bbf85141b24a763882cf1977b5/Pygments-2.12.0-py3-none-any.whl (1.1 MB)
---------------------------------------- 1.1/1.1 MB 3.5 MB/s eta 0:00:00
Collecting backcall
Downloading http://pypi.doubanio.com/packages/4c/1c/ff6546b6c12603d8dd1070aa3c3d273ad4c07f5771689a7b69a550e8c951/backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting traitlets>=5
Downloading http://pypi.doubanio.com/packages/83/a9/1059771062cb80901c34a4dea020e76269412e69300b4ba12e3356865ad8/traitlets-5.3.0-py3-none-any.whl (106 kB)
---------------------------------------- 106.8/106.8 kB 3.1 MB/s eta 0:00:00
Collecting matplotlib-inline
Downloading http://pypi.doubanio.com/packages/a6/2d/2230afd570c70074e80fd06857ba2bdc5f10c055bd9125665fe276fadb67/matplotlib_inline-0.1.3-py3-none-any.whl (8.2 kB)
Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0
Downloading http://pypi.doubanio.com/packages/b0/8f/09a88160539a1164de562809f8b1d0a36dc1f9d8c6473f4b71ebed17b953/prompt_toolkit-3.0.30-py3-none-any.whl (381 kB)
---------------------------------------- 381.7/381.7 kB 4.0 MB/s eta 0:00:00
Collecting pickleshare
Downloading http://pypi.doubanio.com/packages/9a/41/220f49aaea88bc6fa6cba8d05ecf24676326156c23b991e80b3f2fc24c77/pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting colorama
Downloading http://pypi.doubanio.com/packages/77/8b/7550e87b2d308a1b711725dfaddc19c695f8c5fa413c640b2be01662f4e6/colorama-0.4.5-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: setuptools>=18.5 in c:\users\qgb\.local\lib\python3.9\site-packages (from ipython) (63.2.0)
Collecting decorator
Downloading http://pypi.doubanio.com/packages/d5/50/83c593b07763e1161326b3b8c6686f0f4b0f24d5526546bee538c89837d6/decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting stack-data
Downloading http://pypi.doubanio.com/packages/f3/99/9e6a7eea1618eecf8767dc7970722003761403893fa978fa30be6f3846eb/stack_data-0.3.0-py3-none-any.whl (23 kB)
Collecting jedi>=0.16
Downloading http://pypi.doubanio.com/packages/b3/0e/836f12ec50075161e365131f13f5758451645af75c2becf61c6351ecec39/jedi-0.18.1-py2.py3-none-any.whl (1.6 MB)
---------------------------------------- 1.6/1.6 MB 3.4 MB/s eta 0:00:00
Collecting zipp>=0.5
Downloading http://pypi.doubanio.com/packages/f0/36/639d6742bcc3ffdce8b85c31d79fcfae7bb04b95f0e5c4c6f8b206a038cc/zipp-3.8.1-py3-none-any.whl (5.6 kB)
Collecting parso<0.9.0,>=0.8.0
Downloading http://pypi.doubanio.com/packages/05/63/8011bd08a4111858f79d2b09aad86638490d62fbf881c44e434a6dfca87b/parso-0.8.3-py2.py3-none-any.whl (100 kB)
---------------------------------------- 100.8/100.8 kB 2.8 MB/s eta 0:00:00
Requirement already satisfied: MarkupSafe>=2.0 in c:\program files\gimp 2.99\lib\python3.9\site-packages (from Jinja2>=3.0->flask) (2.1.0)
Collecting asttokens
Downloading http://pypi.doubanio.com/packages/16/d5/b0ad240c22bba2f4591693b0ca43aae94fbd77fb1e2b107d54fff1462b6f/asttokens-2.0.5-py2.py3-none-any.whl (20 kB)
Collecting executing
Downloading http://pypi.doubanio.com/packages/61/d8/ad89910dc1da01a24135cb3dce702c72a8172f7b8f896ac0c4c34bcaf323/executing-0.8.3-py2.py3-none-any.whl (16 kB)
Collecting pure-eval
Downloading http://pypi.doubanio.com/packages/2b/27/77f9d5684e6bce929f5cfe18d6cfbe5133013c06cb2fbf5933670e60761d/pure_eval-0.2.2-py3-none-any.whl (11 kB)
Collecting six
Downloading http://pypi.doubanio.com/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: wcwidth, pure-eval, pickleshare, executing, backcall, zipp, Werkzeug, urllib3, traitlets, six, pygments, prompt-toolkit, parso, Jinja2, itsdangerous, idna, dill, decorator, colorama, charset-normalizer, certifi, requests, matplotlib-inline, jedi, importlib-metadata, click, asttokens, stack-data, flask, ipython
WARNING: The script pygmentize.exe is installed in 'C:\Users\qgb\.local\bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script normalizer.exe is installed in 'C:\Users\qgb\.local\bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script flask.exe is installed in 'C:\Users\qgb\.local\bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts ipython.exe and ipython3.exe are installed in 'C:\Users\qgb\.local\bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed Jinja2-3.1.2 Werkzeug-2.1.2 asttokens-2.0.5 backcall-0.2.0 certifi-2022.6.15 charset-normalizer-2.1.0 click-8.1.3 colorama-0.4.5 decorator-5.1.1 dill-0.3.5.1 executing-0.8.3 flask-2.1.3 idna-3.3 importlib-metadata-4.12.0 ipython-8.4.0 itsdangerous-2.1.2 jedi-0.18.1 matplotlib-inline-0.1.3 parso-0.8.3 pickleshare-0.7.5 prompt-toolkit-3.0.30 pure-eval-0.2.2 pygments-2.12.0 requests-2.28.1 six-1.16.0 stack-data-0.3.0 traitlets-5.3.0 urllib3-1.26.10 wcwidth-0.2.5 zipp-3.8.1
C:\Program Files\GIMP 2.99\bin>python -m IPython
Python 3.9.11 (main, Mar 18 2022, 16:54:01) [GCC 11.2.0 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com tld qqwry-py3 wdom astor progressbar2
In [4]: sys.path
Out[4]:
['C:\\Program Files\\GIMP 2.99\\bin',
'C:\\Program Files\\GIMP 2.99\\lib\\python39.zip',
'C:\\Program Files\\GIMP 2.99\\lib\\python3.9',
'C:\\Program Files\\GIMP 2.99\\lib\\python3.9\\lib-dynload',
'C:\\Program Files\\GIMP 2.99\\bin',
'',
'C:\\Users\\qgb\\.local\\lib\\python3.9\\site-packages',
'C:\\Program Files\\GIMP 2.99\\lib\\python3.9\\site-packages',
'C:/QGB/babun/cygwin/bin/']
In [5]: !C:\Users\qgb\.local\bin\ipython.exe -V
8.4.0
C:\Users\qgb\.local\lib\python3.9\site-packages
>>> N.rpcServer(globals=globals(),locals=locals(),port=U.pid,currentThread=True)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\QGB/babun/cygwin/bin\qgb\N\__init__.py", line 1142, in rpcServer
return app.run(**flaskArgs)
File "C:\Users\qgb\.local\lib\python3.9\site-packages\flask\app.py", line 909, in run
cli.show_server_banner(self.env, self.debug, self.name, False)
File "C:\Users\qgb\.local\lib\python3.9\site-packages\flask\cli.py", line 649, in show_server_banner
click.echo(message)
File "C:\Users\qgb\.local\lib\python3.9\site-packages\click\utils.py", line 299, in echo
file.write(out) # type: ignore
File "C:\Users\qgb\.local\lib\python3.9\site-packages\click\_compat.py", line 108, in __getattr__
return getattr(self._stream, name)
AttributeError: 'TextBuffer' object has no attribute 'write'
>>>
(base) C:\Users\qgb>python -c "import fputs"
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\qgb\\miniforge3\\python.exe'
sys.base_prefix = 'C:\\qgb\\miniforge3'
sys.base_exec_prefix = 'C:\\qgb\\miniforge3'
sys.platlibdir = 'lib'
sys.executable = 'C:\\qgb\\miniforge3\\python.exe'
sys.prefix = 'C:\\qgb\\miniforge3'
sys.exec_prefix = 'C:\\qgb\\miniforge3'
sys.path = [
'C:\\qgb\\miniforge3\\python39.zip',
'C:\\qgb\\miniforge3\\DLLs',
'C:\\qgb\\miniforge3\\lib',
'C:\\qgb\\miniforge3',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
Traceback (most recent call last):
File "C:\qgb\miniforge3\lib\encodings\__init__.py", line 31, in <module>
File "C:\qgb\miniforge3\lib\codecs.py", line 13, in <module>
ImportError: DLL load failed while importing fputs: 鎵句笉鍒版寚瀹氱殑妯″潡銆
(base) C:\Users\qgb>python -c "import fputs"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: DLL load failed while importing fputs: 找不到指定的模块。
(base) C:\Users\qgb>
>>> from gimpfu import pdb,gimp
>>> img = gimp.Image(100, 100)
>>> img
<<class 'gimpfu.adapters.image.GimpfuImage'> of Image>
>>> pdb.gimp_display_new(img)
GimpFu.GimpfuPDB - WARNING - Args: [<Value (GimpImage) <Gimp.Image object at 0x0000026e9d6f0040 (GimpImage at 0x0000026e9a07f720)>>]
2022-07-27:02:16:19,632 WARNING [pdb.py:145] Args: [<Value (GimpImage) <Gimp.Image object at 0x0000026e9d6f0040 (GimpImage at 0x0000026e9a07f720)>>]
GimpFu.proceed - ERROR - Proceed past error: PDB call fail: gimp-display-new Gimp says: 成功
2022-07-27:02:16:19,633 ERROR [proceed.py:78] Proceed past error: PDB call fail: gimp-display-new Gimp says: 成功
pdb_name_map.__dict__
{'gimp-edit-fill': 'gimp-drawable-edit-fill', 'gimp-edit-clear': 'gimp-drawable-edit-clear', 'gimp-histogram': 'gimp-drawable-histogram', 'gimp-undo-push-group-start': 'gimp-image-undo-group-start', 'gimp-undo-push-group-end': 'gimp-image-undo-group-end', 'gimp-levels': 'gimp-drawable-levels'}
>>>
Python 3.9.11 (main, Mar 18 2022, 16:54:01) [GCC 11.2.0 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from gimpfu import pdb,gimp
GimpFu.GimpType - DEBUG - list_gimp_enums
GimpFu.GimpType - DEBUG - Short names of Gimp enums []
GimpFu.EnumTypeSet - INFO - return from GimpFu.EnumTypeSet.init
GimpFu.GimpType - DEBUG - name_of_type LayerMode
GimpFu.GimpType - DEBUG - name_of_type FillType
GimpFu.GimpType - DEBUG - name_of_type ChannelOps
GimpFu.GimpType - DEBUG - name_of_type GradientType
GimpFu.GimpType - DEBUG - name_of_type RepeatMode
GimpFu.GimpType - DEBUG - name_of_type HistogramChannel
GimpFu.GimpType - DEBUG - name_of_type MaskApplyMode
GimpFu.GimpType - DEBUG - name_of_type AddMaskType
GimpFu.GimpType - DEBUG - name_of_type HueRange
GimpFu.GimpType - DEBUG - name_of_type DesaturateMode
GimpFu.GimpType - DEBUG - name_of_type ConvertDitherType
GimpFu.GimpType - DEBUG - name_of_type ConvertPaletteType
GimpFu.GimpType - DEBUG - name_of_type RotationType
GimpFu.GimpType - DEBUG - name_of_type RunMode
GimpFu.GimpType - DEBUG - name_of_type SizeType
GimpFu.GimpType - DEBUG - name_of_type MergeType
GimpFu.GimpType - DEBUG - name_of_type ImageBaseType
GimpFu.GimpType - DEBUG - name_of_type ImageType
GimpFu.EnumTypeSet - INFO - unchecked_names []
GimpFu - WARNING - translations for domain gimp30-python in C:\Program Files\GIMP 2.99\share\locale
In [2]: img = gimp.Image(150, 100)
(__main__.py:17760): LibGimp-CRITICAL **: 14:11:50.366: _gimp_pdb_new: assertion 'GIMP_IS_PLUG_IN (plug_in)' failed
(__main__.py:17760): LibGimp-CRITICAL **: 14:11:50.368: gimp_pdb_run_procedure_array: assertion 'GIMP_IS_PDB (pdb)' failed
(__main__.py:17760): LibGimpBase-CRITICAL **: 14:11:50.369: gimp_value_array_index: assertion 'value_array != NULL' failed
C:\Users\qgb\.local\lib\python3.9\site-packages\gimpfu\adapters\image.py:91: Warning: g_value_get_enum: assertion 'G_VALUE_HOLDS_ENUM (value)' failed
final_adaptee = Gimp.Image.new(width, height, image_mode)
(__main__.py:17760): LibGimpBase-CRITICAL **: 14:11:50.380: gimp_value_array_unref: assertion 'value_array != NULL' failed
GimpFu.proceed - ERROR - Proceed past error: Error executing: GimpfuImage, err: constructor returned NULL
In [3]:
pip install numpy
ValueError: python39.dll not found in ['C:\Program Files\GIMP 2.99\', 'C:\Program Files\GIMP 2.99\lib', 'C:\Program Files\GIMP 2.99\bin', 'C:\WINDOWS\System32']gimp-python 依赖 mingw,很多库无法安装
anaconda 安装 pygobject ,无法import Gimp。把对应的 typelib文件 复制到 C:\QGB\Anaconda3\Library\lib\girepository-1.0 导入时报错