centos7
Python3.6.8
ImportError: No module named google.cloud appears even though I installed it.
The source of the error is as follows.
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import typesfrom google.cloud import speech_v1 as speech
from google.cloud.speech_v1 import enums
from google.cloud.speech_v1 import types
The actual error is:
ErrorTraceback (most recent call last):
File "./app/trans.py", line 139, in<module>
samplename = transcribe_gcs (args.path)
File "./app/trans.py", line 39, in transcribe_gcs
from google.cloud import speech
ImportError: No module named google.cloud
The following 3 lines are written on the 39th line.
from google.cloud import speech_v1 as speech
from google.cloud.speech_v1 import enums
from google.cloud.speech_v1 import types
Line 139 is
recog_result_text, finding_name = transcribe_gcs (args.path)
The voice analysis result is stored in recog_result_text as a return value.
ImportError: No module named google.cloud is displayed as an import error. But
Installed related modulesgcloud 0.18.3
google 2.0.2
google-api-core 1.14.2
google-auth 1.6.3
google-cloud 0.34.0
google-cloud-core 1.0.3
google-cloud-speech 1.2.0
google-cloud-storage 1.20.0
google-cloud-texttospeech 0.5.0
google-resumable-media 0.3.3
googleapis-common-protos 1.6.0
grpc-google-cloud-speech-v1 0.8.1
grpc-google-cloud-speech-v1beta1 1.0.1
The above and linux commands are actually importing.
Furthermore, even if you actually type the code for installation, it will be natural, but you will get an error that it has already been installed like the following error.
Even if you uninstall and install again, the above error will appear.
First of all, it works normally without errors.
Even with linux
from google.cloud import texttospeech works normally. But
from google.cloud import speech_v1 as speech
from google.cloud import speech
ImportError: No module named google.cloud
Will be rejected by the error. The same error will occur even if version is imported with _v1 removed.
storage_speech_pyfile all_text Requirement already satisfied: google-cloud-storage in /usr/local/lib/python3.6/site-packages (1.19.0)
Requirement already satisfied: google-resumable-media>= 0.3.1 in /usr/local/lib/python3.6/site-packages (from google-cloud-storage) (0.3.3)
Requirement already satisfied: google-auth>= 1.2.0 in /usr/local/lib/python3.6/site-packages (from google-cloud-storage) (1.6.3)
Requirement already satisfied: google-cloud-core<2.0dev,>= 1.0.3 in /usr/local/lib/python3.6/site-packages (from google-cloud-storage) (1.0.3)
Requirement already satisfied: six in /usr/local/lib/python3.6/site-packages (from google-resumable-media>= 0.3.1->google-cloud-storage) (1.12.0)
Requirement already satisfied: cachetools>= 2.0.0 in /usr/local/lib/python3.6/site-packages (from google-auth>= 1.2.0->google-cloud-storage) (3.1.1)
Requirement already satisfied: rsa>= 3.1.4 in /usr/local/lib/python3.6/site-packages (from google-auth>= 1.2.0->google-cloud-storage) (4.0)
Requirement already satisfied: pyasn1-modules>= 0.2.1 in /usr/local/lib/python3.6/site-packages (from google-auth>= 1.2.0->google-cloud-storage) (0.2.6)
Requirement already satisfied: google-api-core<2.0.0dev,>= 1.14.0 in /usr/local/lib/python3.6/site-packages (from google-cloud-core<2.0dev,>= 1.0.3 ->google-cloud-storage) (1.14.2)
Requirement already satisfied: pyasn1>= 0.1.3 in /usr/local/lib/python3.6/site-packages (from rsa>= 3.1.4->google-auth>= 1.2.0->google-cloud-storage ) (0.4.7)
Requirement already satisfied: protobuf>= 3.4.0 in /usr/local/lib64/python3.6/site-packages (from google-api-core<2.0.0dev,>= 1.14.0->google-cloud-core<2.0dev,>= 1.0.3->google-cloud-storage) (3.9.1)
Requirement already satisfied: googleapis-common-protos<2.0dev,>= 1.6.0 in /usr/local/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>= 1.14.0 ->google-cloud-core<2.0dev,>= 1.0.3->google-cloud-storage) (1.6.0)
Requirement already satisfied: pytz in /usr/local/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>= 1.14.0->google-cloud-core<2.0dev,>= 1.0.3->google-cloud-storage) (2019.2)
Requirement already satisfied: requests<3.0.0dev,>= 2.18.0 in /usr/local/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>= 1.14.0->google -cloud-core<2.0dev,>= 1.0.3->google-cloud-storage) (2.22.0)
Requirement already satisfied: setuptools>= 34.0.0 in /usr/local/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>= 1.14.0->google-cloud-core<2.0dev,>= 1.0.3->google-cloud-storage) (41.2.0)
Requirement already satisfied: idna<2.9,>= 2.5 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0dev,>= 2.18.0->google-api-core<2.0.0dev ,>= 1.14.0->google-cloud-core<2.0dev,>= 1.0.3->google-cloud-storage) (2.8)
Requirement already satisfied: urllib3! = 1.25.0,! = 1.25.1,<1.26,>= 1.21.1 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0dev,>= 2.18.0->google-api-core<2.0.0dev,>= 1.14.0->google-cloud-core<2.0dev,>= 1.0.3->google-cloud-storage) (1.25.3)
Requirement already satisfied: certifi>= 2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0dev,>= 2.18.0->google-api-core<2.0.0dev, >= 1.14.0->google-cloud-core<2.0dev,>= 1.0.3->google-cloud-storage) (2019.9.11)
Requirement already satisfied: chardet<3.1.0,>= 3.0.2 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0dev,>= 2.18.0->google-api-core<2.0.0dev,>= 1.14.0->google-cloud-core<2.0dev,>= 1.0.3->google-cloud-storage) (3.0.4)
Reference URL
https://www.tutorialfor.com/go.php?id=123983
https://stackoverflow.com/questions/51644146/python-cant-find-google-cloud-module/51651971
https://stackoverflow.com/questions/54836399/modulenotfounderror-no-module-named-google-cloud
-
Answer # 1
-
Answer # 2
According to this, the module name seems to be different. Is the module name correct?
Like Google ’s official site
Why not try this module instead ofgoogle-cloud-storage
?$pip install --upgrade google-cloud-speech
Related articles
- pycharm runs with ImportError: No module named
- django - how to resolve modulenotfounderror: no module named 'environ'
- Use python3 to call wxpy module to monitor linux logs and send messages to groups or friends regularly
- -ModuleNotFoundError: No module named 'geventwebsocket' after restarting the pagoda panel
- How to connect linux using paramiko module
- python - what does no module named 'image' mean?
- python - modulenotfounderror: no module named 'django_appsettings' is displayed
- no module named 'numpytestingdecorators' appears and the program cannot be executed
- linux/dns server construction named error
- i get a no module named error when i try to run a program in python
- linux - cannot insmod kernel module
- python no module named mysqldb error
- centos - python doesn't work (importerror: no module named site)
- python - importerror module cannot be installed from other packages
- cuda - modulenotfounderror: no module named i want to resolve'toolstest'
- python - modulenotfounderror: no module named error
- python 27 - python library installed but importerror: no module named
- python - importerror: no module named'imblearn'
- linux - it was cool in x window, but i got an error when i ran it from ssh usb qr code reader
- linux - serial port on raspberry pi
- linux - output to a file line by line after processing with for in
- python 3x - i want to daemonize a python program, but i want to see if this method works
- i want to output multiple lines of html code using python
- linux - i get a modulenotfounderror even though the directory should be there
I think the v1 description method is different.