【Python】pip install pysmbc -U失败的问题
升级pysmbc,失败了
$ pip install pysmbc -U
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://www.piwheels.org/simple
Requirement already satisfied: pysmbc in /usr/lib/python3/dist-packages (1.0.15.6)
Collecting pysmbc
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e1/22/528f5cead9765dccd7a0573f701c4b2806cc18a312269560ea93828fedf6/pysmbc-1.0.23.tar.gz (26 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tl0gjn7i/pysmbc_bd869f50090d435697baefc8286c8d88/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tl0gjn7i/pysmbc_bd869f50090d435697baefc8286c8d88/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-nl92s5wf
cwd: /tmp/pip-install-tl0gjn7i/pysmbc_bd869f50090d435697baefc8286c8d88/
Complete output (19 lines):
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-tl0gjn7i/pysmbc_bd869f50090d435697baefc8286c8d88/setup.py", line 120, in <module>
define_macros=pkgconfig_Dversion("smbclient"),
File "/tmp/pip-install-tl0gjn7i/pysmbc_bd869f50090d435697baefc8286c8d88/setup.py", line 85, in pkgconfig_Dversion
ver = str(int(vers[0]))
ValueError: invalid literal for int() with base 10: ''
----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/e1/22/528f5cead9765dccd7a0573f701c4b2806cc18a312269560ea93828fedf6/pysmbc-1.0.23.tar.gz#sha256=08db176281103024b7e8563adef733e56250051d87394c4baec4fd298d0d16f8 (from https://pypi.tuna.tsinghua.edu.cn/simple/pysmbc/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/30/f9/c4ff99b7dc00d775bd53ec94d51875fa4b06767215295359133d08e651fc/pysmbc-1.0.22.tar.gz (29 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tl0gjn7i/pysmbc_38802d016a1f417da1a49f67ca7450a9/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tl0gjn7i/pysmbc_38802d016a1f417da1a49f67ca7450a9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ajuotkk2
cwd: /tmp/pip-install-tl0gjn7i/pysmbc_38802d016a1f417da1a49f67ca7450a9/
Complete output (19 lines):
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-tl0gjn7i/pysmbc_38802d016a1f417da1a49f67ca7450a9/setup.py", line 117, in <module>
define_macros=pkgconfig_Dversion("smbclient"),
File "/tmp/pip-install-tl0gjn7i/pysmbc_38802d016a1f417da1a49f67ca7450a9/setup.py", line 82, in pkgconfig_Dversion
ver = str(int(vers[0]) * 10000 + int(vers[1]) * 100 + int(vers[2]))
ValueError: invalid literal for int() with base 10: ''
----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/30/f9/c4ff99b7dc00d775bd53ec94d51875fa4b06767215295359133d08e651fc/pysmbc-1.0.22.tar.gz#sha256=f9ce6f8cf17a2e7867b3cd87b2a47eca04ed955f37937b617088698c06177eba (from https://pypi.tuna.tsinghua.edu.cn/simple/pysmbc/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/32/91/1683cbe846ae083d37feaa8f901087159157c5ed3af27b7bcea0f4d3590a/pysmbc-1.0.21.tar.bz2 (26 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tl0gjn7i/pysmbc_f17f5b690c4f4425b3cb45a816a0c5e1/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tl0gjn7i/pysmbc_f17f5b690c4f4425b3cb45a816a0c5e1/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-5eeklgl1
cwd: /tmp/pip-install-tl0gjn7i/pysmbc_f17f5b690c4f4425b3cb45a816a0c5e1/
Complete output (19 lines):
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-tl0gjn7i/pysmbc_f17f5b690c4f4425b3cb45a816a0c5e1/setup.py", line 117, in <module>
define_macros=pkgconfig_Dversion("smbclient"),
File "/tmp/pip-install-tl0gjn7i/pysmbc_f17f5b690c4f4425b3cb45a816a0c5e1/setup.py", line 82, in pkgconfig_Dversion
ver = str(int(vers[0]) * 10000 + int(vers[1]) * 100 + int(vers[2]))
ValueError: invalid literal for int() with base 10: ''
----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/32/91/1683cbe846ae083d37feaa8f901087159157c5ed3af27b7bcea0f4d3590a/pysmbc-1.0.21.tar.bz2#sha256=5ea23fdac4cd6e5d5c814a9fff84edbc3701270e6f40fcffa18a4554862b6791 (from https://pypi.tuna.tsinghua.edu.cn/simple/pysmbc/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/06/b3/2d6f8f7086ed322c27aaf87e49e8b0c8bca528385f6c603d9759d977439b/pysmbc-1.0.20.tar.bz2 (26 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pysmbc
Building wheel for pysmbc (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tl0gjn7i/pysmbc_0c73c122d2c04fc29ef5d12801f3b134/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tl0gjn7i/pysmbc_0c73c122d2c04fc29ef5d12801f3b134/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-gu2mtymd
cwd: /tmp/pip-install-tl0gjn7i/pysmbc_0c73c122d2c04fc29ef5d12801f3b134/
Complete output (27 lines):
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.7
creating build/lib.linux-aarch64-3.7/smbc
copying smbc/xattr.py -> build/lib.linux-aarch64-3.7/smbc
copying smbc/__init__.py -> build/lib.linux-aarch64-3.7/smbc
running build_ext
building '_smbc' extension
creating build/temp.linux-aarch64-3.7
creating build/temp.linux-aarch64-3.7/smbc
aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c smbc/smbcmodule.c -o build/temp.linux-aarch64-3.7/smbc/smbcmodule.o
In file included from smbc/smbcmodule.c:30:
smbc/smbcmodule.h:27:10: fatal error: libsmbclient.h: No such file or directory
#include <libsmbclient.h>
^~~~~~~~~~~~~~~~
compilation terminated.
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pysmbc
Running setup.py clean for pysmbc
Failed to build pysmbc
Installing collected packages: pysmbc
Running setup.py install for pysmbc ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tl0gjn7i/pysmbc_0c73c122d2c04fc29ef5d12801f3b134/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tl0gjn7i/pysmbc_0c73c122d2c04fc29ef5d12801f3b134/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xldidp9w/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pi/.local/include/python3.7m/pysmbc
cwd: /tmp/pip-install-tl0gjn7i/pysmbc_0c73c122d2c04fc29ef5d12801f3b134/
Complete output (29 lines):
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
Package smbclient was not found in the pkg-config search path.
Perhaps you should add the directory containing `smbclient.pc'
to the PKG_CONFIG_PATH environment variable
No package 'smbclient' found
running install
/home/pi/.local/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.7
creating build/lib.linux-aarch64-3.7/smbc
copying smbc/xattr.py -> build/lib.linux-aarch64-3.7/smbc
copying smbc/__init__.py -> build/lib.linux-aarch64-3.7/smbc
running build_ext
building '_smbc' extension
creating build/temp.linux-aarch64-3.7
creating build/temp.linux-aarch64-3.7/smbc
aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c smbc/smbcmodule.c -o build/temp.linux-aarch64-3.7/smbc/smbcmodule.o
In file included from smbc/smbcmodule.c:30:
smbc/smbcmodule.h:27:10: fatal error: libsmbclient.h: No such file or directory
#include <libsmbclient.h>
^~~~~~~~~~~~~~~~
compilation terminated.
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tl0gjn7i/pysmbc_0c73c122d2c04fc29ef5d12801f3b134/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tl0gjn7i/pysmbc_0c73c122d2c04fc29ef5d12801f3b134/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xldidp9w/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pi/.local/include/python3.7m/pysmbc Check the logs for full command output.
安装libsmbclient-dev
$ sudo apt-get install libsmbclient-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libsmbclient-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 145 kB of archives.
After this operation, 307 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian-security buster/updates/main arm64 libsmbclient-dev arm64 2:4.9.5+dfsg-5+deb10u1 [145 kB]
Fetched 145 kB in 1s (150 kB/s)
Selecting previously unselected package libsmbclient-dev:arm64.
(Reading database ... 95726 files and directories currently installed.)
Preparing to unpack .../libsmbclient-dev_2%3a4.9.5+dfsg-5+deb10u1_arm64.deb ...
Unpacking libsmbclient-dev:arm64 (2:4.9.5+dfsg-5+deb10u1) ...
Setting up libsmbclient-dev:arm64 (2:4.9.5+dfsg-5+deb10u1) ...
重试升级pysmbc,成功了
$ pip install pysmbc -U
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://www.piwheels.org/simple
Requirement already satisfied: pysmbc in /usr/lib/python3/dist-packages (1.0.15.6)
Collecting pysmbc
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e1/22/528f5cead9765dccd7a0573f701c4b2806cc18a312269560ea93828fedf6/pysmbc-1.0.23.tar.gz (26 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pysmbc
Building wheel for pysmbc (setup.py) ... done
Created wheel for pysmbc: filename=pysmbc-1.0.23-cp37-cp37m-linux_aarch64.whl size=88711 sha256=43519fff5ec5a3af7d1519d0206c245cebd8902cb42710318910789206883706
Stored in directory: /home/pi/.cache/pip/wheels/40/9f/26/1dd32addab749dbf30392191893aab8c0142fd219168e2f49f
Successfully built pysmbc
Installing collected packages: pysmbc
Successfully installed pysmbc-1.0.23
浙公网安备 33010602011771号