-1

我想创建一个简单的 Whatsapp Bot,所以我搜索了一下。首先我尝试了官方的 Whatsapp API,但我只是为了好玩,所以我认为他们不会接受我的请求。

无论如何,我尝试安装 yowsup,但是当我尝试时pip install yowsup出现此错误:

'''
Collecting yowsup
  Using cached yowsup-3.3.0-py3-none-any.whl (284 kB)
Collecting readline
  Using cached readline-6.2.4.1.tar.gz (2.3 MB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python.e
xe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\
MYUSERNAME\\AppData\\Local\\Temp\\pip-install-bb0mz881\\readline_7491117ff8cb473
5918d11c24f67203d\\setup.py'"'"'; __file__='"'"'C:\\Users\\MYUSERNAME\\AppData\\
Local\\Temp\\pip-install-bb0mz881\\readline_7491117ff8cb4735918d11c24f67203d\\se
tup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exi
sts(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');
code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(cod
e, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\MYUSERNAME\AppData\
Local\Temp\pip-pip-egg-info-ll6z0qh3'
       cwd: C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-bb0mz881\readline
_7491117ff8cb4735918d11c24f67203d\
  Complete output (1 lines):
  error: this module is not meant to work on Windows
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/f4/01/2cf081af8d880b
44939a5f1b446551a7f8d59eae414277fd0c303757ff1b/readline-6.2.4.1.tar.gz#sha256=e0
0f86e03dfe52e7d1502cec5c64070b32621c85509c0081a4cfa6a0294bd107 (from https://pyp
i.org/simple/readline/). Command errored out with exit status 1: python setup.py
 egg_info Check the logs for full command output.
  Using cached readline-6.2.4.tar.gz (2.3 MB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python.e
xe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\
MYUSERNAME\\AppData\\Local\\Temp\\pip-install-bb0mz881\\readline_c1e63cff4e3e43c
c8dad2d680205adf7\\setup.py'"'"'; __file__='"'"'C:\\Users\\MYUSERNAME\\AppData\\
Local\\Temp\\pip-install-bb0mz881\\readline_c1e63cff4e3e43cc8dad2d680205adf7\\se
tup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exi
sts(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');
code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(cod
e, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\MYUSERNAME\AppData\
Local\Temp\pip-pip-egg-info-q3jmdkph'
       cwd: C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-bb0mz881\readline
_c1e63cff4e3e43cc8dad2d680205adf7\
  Complete output (1 lines):
  error: this module is not meant to work on Windows
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/6b/5d/e66651de3ec36e
9cf2a9110e99a9c6905eb6b55e9f8c800bbf8e934c55d1/readline-6.2.4.tar.gz#sha256=ac1c
0e583eb24083b8ca72e077a8b4ff28349e85533718b4c83c1c44e85ffbbb (from https://pypi.
org/simple/readline/). Command errored out with exit status 1: python setup.py e
gg_info Check the logs for full command output.
  Using cached readline-6.2.2.tar.gz (2.3 MB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python.e
xe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\
MYUSERNAME\\AppData\\Local\\Temp\\pip-install-bb0mz881\\readline_643c9369d95543f
ba8c9a0b609385a4e\\setup.py'"'"'; __file__='"'"'C:\\Users\\MYUSERNAME\\AppData\\
Local\\Temp\\pip-install-bb0mz881\\readline_643c9369d95543fba8c9a0b609385a4e\\se
tup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exi
sts(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');
code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(cod
e, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\MYUSERNAME\AppData\
Local\Temp\pip-pip-egg-info-4zznuy13'
       cwd: C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-bb0mz881\readline
_643c9369d95543fba8c9a0b609385a4e\
  Complete output (1 lines):
  error: this module is not meant to work on Windows
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/59/1b/81d5b49abe3dc9
a232e1b79015085b042f506be16f693133ff778384ed65/readline-6.2.2.tar.gz#sha256=b9d3
0e8928530791944ab40c76aebcd4c8a7d6bc8cda05f3b521446fa3782b6d (from https://pypi.
org/simple/readline/). Command errored out with exit status 1: python setup.py e
gg_info Check the logs for full command output.
  Using cached readline-6.2.1.tar.gz (2.3 MB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python.e
xe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\
MYUSERNAME\\AppData\\Local\\Temp\\pip-install-bb0mz881\\readline_7e506aafe78c4ec
7a3d57d354a014a90\\setup.py'"'"'; __file__='"'"'C:\\Users\\MYUSERNAME\\AppData\\
Local\\Temp\\pip-install-bb0mz881\\readline_7e506aafe78c4ec7a3d57d354a014a90\\se
tup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exi
sts(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');
code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(cod
e, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\MYUSERNAME\AppData\
Local\Temp\pip-pip-egg-info-f47mvdea'
       cwd: C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-bb0mz881\readline
_7e506aafe78c4ec7a3d57d354a014a90\
  Complete output (1 lines):
  error: this module is not meant to work on Windows
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/b3/da/998bf0c4286155
20a8e127b2d7752da27f6ae4b57876fff048025913d90a/readline-6.2.1.tar.gz#sha256=2e78
9683f826e45e1580dddf814af6db0e00038e15ac641a36c365bf3f48ff5d (from https://pypi.
org/simple/readline/). Command errored out with exit status 1: python setup.py e
gg_info Check the logs for full command output.
  Using cached readline-6.2.0.tar.gz (2.3 MB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python.e
xe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\
MYUSERNAME\\AppData\\Local\\Temp\\pip-install-bb0mz881\\readline_0881214bd12d46f
39e809c3e7e53c8d9\\setup.py'"'"'; __file__='"'"'C:\\Users\\MYUSERNAME\\AppData\\
Local\\Temp\\pip-install-bb0mz881\\readline_0881214bd12d46f39e809c3e7e53c8d9\\se
tup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exi
sts(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');
code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(cod
e, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\MYUSERNAME\AppData\
Local\Temp\pip-pip-egg-info-bambeq90'
       cwd: C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-bb0mz881\readline
_0881214bd12d46f39e809c3e7e53c8d9\
  Complete output (1 lines):
  error: this module is not meant to work on Windows
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/5c/76/d16c10adc14da4
1058feaa11e7ccc57702a612cd29d9af451af30524f489/readline-6.2.0.tar.gz#sha256=12d7
66352e2f129f99301f2cea392e3065a85abd4f41665f79cbca07e5b1c21f (from https://pypi.
org/simple/readline/). Command errored out with exit status 1: python setup.py e
gg_info Check the logs for full command output.
  Using cached readline-6.1.0.tar.gz (2.3 MB)
  Preparing metadata (setup.py) ... done
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: six==1.10 in c:\users\MYUSERNAME\appdata\local\pr
ograms\python\python39\lib\site-packages (from yowsup) (1.10.0)
Requirement already satisfied: protobuf>=3.6.0 in c:\users\MYUSERNAME\appdata\lo
cal\programs\python\python39\lib\site-packages (from yowsup) (3.19.1)
Collecting consonance==0.1.5
  Using cached consonance-0.1.5-py3-none-any.whl (35 kB)
Collecting python-axolotl==0.2.2
  Using cached python_axolotl-0.2.2-py3-none-any.whl (76 kB)
Collecting appdirs
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting dissononce>=0.34.3
  Using cached dissononce-0.34.3-py3-none-any.whl (51 kB)
Collecting python-axolotl-curve25519
  Using cached python-axolotl-curve25519-0.4.1.post2.tar.gz (79 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: transitions in c:\users\MYUSERNAME\appdata\local\
programs\python\python39\lib\site-packages (from consonance==0.1.5->yowsup) (0.8
.10)
Requirement already satisfied: cryptography in c:\users\MYUSERNAME\appdata\local
\programs\python\python39\lib\site-packages (from python-axolotl==0.2.2->yowsup)
 (36.0.1)
Requirement already satisfied: cffi>=1.12 in c:\users\MYUSERNAME\appdata\local\p
rograms\python\python39\lib\site-packages (from cryptography->python-axolotl==0.
2.2->yowsup) (1.15.0)
Requirement already satisfied: pycparser in c:\users\MYUSERNAME\appdata\local\pr
ograms\python\python39\lib\site-packages (from cffi>=1.12->cryptography->python-
axolotl==0.2.2->yowsup) (2.21)
Using legacy 'setup.py install' for readline, since package 'wheel' is not insta
lled.
Using legacy 'setup.py install' for python-axolotl-curve25519, since package 'wh
eel' is not installed.
Installing collected packages: python-axolotl-curve25519, dissononce, readline,
python-axolotl, consonance, argparse, appdirs, yowsup
    Running setup.py install for python-axolotl-curve25519 ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python
.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Us
ers\\MYUSERNAME\\AppData\\Local\\Temp\\pip-install-bb0mz881\\python-axolotl-curv
e25519_cfa10636c2964a5092e6b8bfdf08363a\\setup.py'"'"'; __file__='"'"'C:\\Users\
\MYUSERNAME\\AppData\\Local\\Temp\\pip-install-bb0mz881\\python-axolotl-curve255
19_cfa10636c2964a5092e6b8bfdf08363a\\setup.py'"'"';f = getattr(tokenize, '"'"'op
en'"'"', 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 'C:\Users\MYUSERNAME\AppData\Local\Temp\pip-record-2hnt91wv\install-recor
d.txt' --single-version-externally-managed --compile --install-headers 'c:\users
\MYUSERNAME\appdata\local\programs\python\python39\Include\python-axolotl-curve2
5519'
         cwd: C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-bb0mz881\python
-axolotl-curve25519_cfa10636c2964a5092e6b8bfdf08363a\
    Complete output (7 lines):
    c:\users\MYUSERNAME\appdata\local\programs\python\python39\lib\site-packages
\setuptools\dist.py:458: UserWarning: Normalizing '0.4.1-2' to '0.4.1.post2'
      warnings.warn(tmpl.format(**locals()))
    running install
    running build
    running build_ext
    building 'axolotl_curve25519' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for V
isual Studio": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\MYUSERNAME\appdata\loca
l\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, to
kenize; sys.argv[0] = '"'"'C:\\Users\\MYUSERNAME\\AppData\\Local\\Temp\\pip-inst
all-bb0mz881\\python-axolotl-curve25519_cfa10636c2964a5092e6b8bfdf08363a\\setup.
py'"'"'; __file__='"'"'C:\\Users\\MYUSERNAME\\AppData\\Local\\Temp\\pip-install-
bb0mz881\\python-axolotl-curve25519_cfa10636c2964a5092e6b8bfdf08363a\\setup.py'"
'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__fi
le__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f
.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __fil
e__, '"'"'exec'"'"'))' install --record 'C:\Users\MYUSERNAME\AppData\Local\Temp\
pip-record-2hnt91wv\install-record.txt' --single-version-externally-managed --co
mpile --install-headers 'c:\users\MYUSERNAME\appdata\local\programs\python\pytho
n39\Include\python-axolotl-curve25519' Check the logs for full command output.
'''

我真的不明白那些 cmd 错误。正如我在文档中阅读的那样,我尝试使用 安装pip install -e git+https://github.com/jlmadurga/yowsup.git@issue_1181#egg=yowsup,但它也不起作用。我应该怎么办?

4

1 回答 1

1

错误:此模块不适用于 Windows

这是 yowsup 轮子中的一个错误。该问题已解决,但以错误的方式解决。setup.py必须以声明方式定义依赖项,因为在安装期间pip不运行setup.py,仅在构建阶段运行。轮子显然是在 Linux 上构建的,因此readline被添加为依赖项而不是pyreadline.

尝试使用直接 URL 从 sdist 安装:

pip install https://files.pythonhosted.org/packages/95/1e/2ca683a638f25a022f68b522db68924f06501db2f695bbf5738d2038af02/yowsup-3.3.0.tar.gz

并请报告错误

于 2021-12-31T14:37:45.923 回答