You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem was from the previous version of Spyder, before the 3.2.6 and I thought 3.2.6 should fix this problem. However, it is still there when calling Google Cloud API.
Error: RuntimeError: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>
Where is the error: File "/Users/name/anaconda3/lib/python3.6/imp.py", line 271, in find_module "not {}".format(type(path)))
calling a function that uses any services from the google.cloud library
sample:
from google.cloud import language
from google.cloud.language import enums
from google.cloud.language import types
import six
import sys
def entity_sentiment_text(text):
client = language.LanguageServiceClient()
if isinstance(text, six.binary_type):
text = text.decode('utf-8')
document = types.Document(
content=text.encode('utf-8'),
type=enums.Document.Type.PLAIN_TEXT)
encoding = enums.EncodingType.UTF32
if sys.maxunicode == 65535:
encoding = enums.EncodingType.UTF16
result = client.analyze_entity_sentiment(document, encoding)
print(result.entities)
print(entity_sentiment_text("my spyder has some problem"))
What is the expected output? What do you see instead?
The expected output is the json return from Google Cloud API.
I see the error that described above instead. Note, it works fine when I execute the program using terminal, PyCharm or VSCode (I assume other IDEs won't have this issue).
Please provide any additional information below
The program works fine when running from terminal and other IDEs
Versions and main components
Spyder Version: 3.2.6
Python Version: 3.6.3
Qt Version: 5.6.2
PyQt Version: Latest
Operating system: Mac OS 10.13.2
Dependencies
Please go to the menu entry Help > Optional Dependencies (or Help > Dependencies), press the button Copy to clipboard
and paste the contents below:
IPython >=4.0 : 6.1.0 (OK)
cython >=0.21 : 0.26.1 (OK)
jedi >=0.9.0 : 0.11.1 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.13.3 (OK)
pandas >=0.13.1 : 0.20.3 (OK)
psutil >=0.3 : 5.4.3 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.8.2 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.6.6 (OK)
sympy >=0.7.3 : 1.1.1 (OK)
The text was updated successfully, but these errors were encountered:
@ccordoba12 Hi, I have similar problems when calling Google Cloud API in Spyder. I tried to see #5299 but am not sure what is the temporary solution for this. According to the below link, I tried to comment out if HAS_PYXIMPORT: in sitecustomize.py but I still get the same error. May I ask how can I fix that problem? Many thx.
Description of your problem
The problem was from the previous version of Spyder, before the 3.2.6 and I thought 3.2.6 should fix this problem. However, it is still there when calling Google Cloud API.
Error:
RuntimeError: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>
Where is the error:
File "/Users/name/anaconda3/lib/python3.6/imp.py", line 271, in find_module "not {}".format(type(path)))
More details of the error code: https://stackoverflow.com/questions/48516018/anaconda-spyder-runtimeerror-imp-py-line-271
What steps will reproduce the problem?
What is the expected output? What do you see instead?
The expected output is the json return from Google Cloud API.
I see the error that described above instead. Note, it works fine when I execute the program using terminal, PyCharm or VSCode (I assume other IDEs won't have this issue).
Please provide any additional information below
The program works fine when running from terminal and other IDEs
Versions and main components
Dependencies
Please go to the menu entry
Help > Optional Dependencies
(orHelp > Dependencies
), press the buttonCopy to clipboard
and paste the contents below:
IPython >=4.0 : 6.1.0 (OK)
cython >=0.21 : 0.26.1 (OK)
jedi >=0.9.0 : 0.11.1 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.13.3 (OK)
pandas >=0.13.1 : 0.20.3 (OK)
psutil >=0.3 : 5.4.3 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.8.2 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.6.6 (OK)
sympy >=0.7.3 : 1.1.1 (OK)
The text was updated successfully, but these errors were encountered: