ModuleNotFoundError:没有名为';谷歌';-Python&;谷歌TTS

ModuleNotFoundError:没有名为';谷歌';-Python&;谷歌TTS,python,text-to-speech,google-text-to-speech,Python,Text To Speech,Google Text To Speech,我有一个使用Python和Google TTS生成wav文件的批处理文件。此shell脚本在Windows 10上运行良好。我需要在LinuxWeb服务器上运行脚本(作为shell脚本),但是我得到了错误 ModuleNotFoundError:没有名为“google”的模块 在Python shell中运行help('modules')可以提供当前安装的以下google模块: google_auth_httplib2 googleapiclient googlesearch 运行pip安装-

我有一个使用Python和Google TTS生成wav文件的批处理文件。此shell脚本在Windows 10上运行良好。我需要在LinuxWeb服务器上运行脚本(作为shell脚本),但是我得到了错误
ModuleNotFoundError:没有名为“google”的模块

在Python shell中运行
help('modules')
可以提供当前安装的以下google模块:

google_auth_httplib2
googleapiclient
googlesearch
运行
pip安装--升级google
会让我:

Collecting google
  Using cached https://files.pythonhosted.org/packages/81/51/36af1d18648574d13d8f43e863e95a97fe6f43d54a13fbcf272c638c10e9/google-2.0.3-py2.py3-none-any.whl
Collecting beautifulsoup4 (from google)
  Using cached https://files.pythonhosted.org/packages/cb/a1/c698cf319e9cfed6b17376281bd0efc6bfc8465698f54170ef60a485ab5d/beautifulsoup4-4.8.2-py3-none-any.whl
Collecting soupsieve>=1.2 (from beautifulsoup4->google)
  Using cached https://files.pythonhosted.org/packages/81/94/03c0f04471fc245d08d0a99f7946ac228ca98da4fa75796c507f61e688c2/soupsieve-1.9.5-py2.py3-none-any.whl
Installing collected packages: soupsieve, beautifulsoup4, google
Successfully installed beautifulsoup4-4.8.2 google-2.0.3 soupsieve-1.9.5
但是我仍然只有上面提到的三个模块。当我运行脚本
sudo-u www-data sh testfile.sh
时,我得到以下错误:

Traceback (most recent call last):
  File "TTSA.py", line 37, in <module>
    f'<speak>{speech}</speak>'
  File "TTSA.py", line 9, in synthesize_ssml
    from google.cloud import texttospeech
ModuleNotFoundError: No module named 'google'
python3.6谷歌模块:

google_auth_httplib2
google_oauth2_tool
googleapiclient
googlesearch
google_auth_httplib2
googleapiclient
googlesearch
python3.7谷歌模块:

google_auth_httplib2
google_oauth2_tool
googleapiclient
googlesearch
google_auth_httplib2
googleapiclient
googlesearch

在Linux上,您可能同时安装了许多Python—可能在一个Python中安装了
google
,但在另一个Python中运行代码。检查
pip-V
pip2-V
pip3-V
@furas我已将版本添加到问题中。