我正在尝试运行程序,但收到错误消息
You need to install pysmb
pip install pysmb
ERROR:root:pysmb missing
我愿意
pip3 install pysmb
并且还在不同的帖子中建议使用
安装pip2.7 install pysmb
最后给出错误
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pysmb
Using cached pysmb-1.2.7.zip (1.3 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lLiHMf/pysmb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lLiHMf/pysmb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-USW4PM
cwd: /tmp/pip-install-lLiHMf/pysmb/
Complete output (8 lines):
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'egg_info'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
我设法使用 pip install pysmb 成功安装,但是当我尝试运行该程序时,它一直说
你需要安装pysmb
pip install pysmb
ERROR:root:pysmb missing
当我也得到
Requirement already satisfied: pysmb in /usr/local/lib/python3.9/dist-packages (1.2.7)
Requirement already satisfied: pyasn1 in /usr/lib/python3/dist-packages (from pysmb) (0.4.8)
我该如何解决这个问题?
编辑:
尝试通过三种不同的方式安装pysmb
┌──(root?kali)-[~]
└─# pip3 install pysmb
Requirement already satisfied: pysmb in /usr/local/lib/python3.9/dist-packages (1.2.7)
Requirement already satisfied: pyasn1 in /usr/lib/python3/dist-packages (from pysmb) (0.4.8)
┌──(root?kali)-[~]
└─# pip2.7 install pysmb
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pysmb
Using cached pysmb-1.2.7.zip (1.3 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1eaRAy/pysmb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1eaRAy/pysmb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-L4CJ2C
cwd: /tmp/pip-install-1eaRAy/pysmb/
Complete output (8 lines):
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'egg_info'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
┌──(root?kali)-[~]
└─# pip install pysmb 1 ⨯
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pysmb
Using cached pysmb-1.2.7.zip (1.3 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8zLzuI/pysmb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8zLzuI/pysmb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-6Zi3wo
cwd: /tmp/pip-install-8zLzuI/pysmb/
Complete output (8 lines):
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'egg_info'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
编辑 2:
导入系统; sys.executable 输出
┌──(root?kali)-[~/Desktop]
└─# python sys.executable.py
/usr/bin/python
┌──(root?kali)-[~/Desktop]
└─# python3 sys.executable.py
/usr/bin/python3
┌──(root?kali)-[~/Desktop]
└─# python2.7 sys.executable.py
/usr/local/bin/python2.7