importerror

ImportError: No module named oauth2client

99封情书 提交于 2019-11-29 12:50:59
I'm following instructions in the Google Sign-In for Android documentation ( https://developers.google.com/identity/sign-in/android/backend-auth ) and am trying to implement the token verification in my Python code. I am developing on local host. For some reason, I am getting this error when I try this import from oauth2client import client, crypt into my Google App Engine backend, I get this error: ImportError: No module named oauth2client.client` I've installed oauth2 using sudo pip install --upgrade google-api-python ( https://developers.google.com/api-client-library/python/start

Python3: Attempted relative import in non-package

空扰寡人 提交于 2019-11-29 11:42:35
I'm so sorry about this basic question, because it's similar to this: Stumped by relative imports But I'm trying to follow the PEP328 http://www.python.org/dev/peps/pep-0328/#guido-s-decision and it doesn't work for me :( These are my files: dev@desktop:~/Desktop/test$ ls controller.py __init__.py test.py 2to3 says all it's right: dev@desktop:~/Desktop/test$ 2to3 . RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: ws_comma RefactoringTool: No files

Python Import Class With Same Name as Directory [duplicate]

无人久伴 提交于 2019-11-29 09:36:18
This question already has an answer here: Python import precedence: packages or modules? 4 answers Lets say I have the following python source file layout: lib/foo.py lib/foo/bar.py and then in my source code: from foo import gaz I get an import error: ImportError: No module named foo How can I have a .py file and a directory with the same name so I can do the following: from foo import gaz from foo.bar import wakawaka thanks in advance! The actual problem you are having, using a single import, is due to the packages having the precedence over modules: Note that when using from package import

Import statement works on PyCharm but not from terminal

六月ゝ 毕业季﹏ 提交于 2019-11-29 05:31:10
Pycharm 2016.2.3, Mac OS X 10.11.1, Python 3.5 (Homebrew); I have this folder structure project /somepackage /subpackage __init__.py bar.py __init__.py foo.py foo.py: import somepackage.subpackage.bar print("foo") bar.py: print("bar") So my expected output is bar foo This works fine when run from PyCharm. However, when I run it from my terminal I get an ImportError: $ pwd $ /home/project (not the actual path; just omitting some personal stuff) $ python3.5 somepackage/foo.py File "foo.py", line 1, in <module> import somepackage.subpackage.bar ImportError: No module named 'somepackage' I have

Why can't Python import Image from PIL?

安稳与你 提交于 2019-11-29 05:26:35
The single line that I am trying to run is the following: from PIL import Image However simple this may seem, it gives an error: Traceback (most recent call last): File "C:\...\2014-10-22_12-49.py", line 1, in <module> from PIL import Image File "C:\pyzo2014a\lib\site-packages\PIL\Image.py", line 29, in <module> from PIL import VERSION, PILLOW_VERSION, _plugins ImportError: cannot import name 'VERSION' In case that's helpful, I installed pillow from https://pypi.python.org/pypi/Pillow/2.6.1 (file Pillow-2.6.1.win-amd64-py3.4.exe ) before running this (before that there was already som PIL

ImportError: No module named extern

假装没事ソ 提交于 2019-11-29 03:22:02
I'm getting this error when trying to install any package with pip. I have two pip instances, one with Python 2.7 and other with Python 3. Could not import setuptools which is required to install from a source distribution. Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 375, in setup_py import setuptools # noqa File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 11, in <module> from setuptools.extern.six.moves import filterfalse, map File "/usr/local/lib/python2.7/dist-packages/setuptools/extern/__init__.py",

g++ error on import of Theano on Windows 7

╄→гoц情女王★ 提交于 2019-11-29 03:08:31
问题 I'm attempting to get setup with a proper g++ installation according to the theano installation guide. I've previously had theano working with the python only implementation. I'm using the bleeding edge version of theano from their git repo on python 3.4. I've tried using the theano suggested TDM-GCC-64 method as well as MinGW, and both result in the exact same error. (copied as readable as possible) Problem occurred during compilation with the command line below: C:\MinGW\bin\g++.exe -shared

Importing python modules in jython

馋奶兔 提交于 2019-11-29 01:56:22
I'm having some issues importing scapy under jython. I've been doing java forever, but python for only a day or two. The simple case to reproduce the problem is: $jython >>> import sys >>> sys.path ['', '/usr/share/jython/Lib', '/usr/lib/site-python', '__classpath__'] >>> from scapy.all import * Traceback (innermost last): File "<console>", line 1, in ? ImportError: no module named scapy If I do these exact same steps under python , everything works. How do I tell jython to use scapy? If it helps, I'm running ubuntu 10.04 and installed jython and scapy via apt-get install You've done the right

What does “Symbol not found / Expected in: flat namespace” actually mean?

三世轮回 提交于 2019-11-29 01:48:49
问题 When I import a module I built, I get this boost-python related error: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: dlopen(./myMod.so, 2): Symbol not found: __ZN5boost6python7objects15function_objectERKNS1_11py_functionERKSt4pairIPKNS0_6detail7keywordES9_E Referenced from: ./myMod.so Expected in: flat namespace in ./myMod.so What does this actually mean? Why was this error raised? 回答1: Description The problem was caused by mixing objects that compiled

Import urllib.request, ImportError: No module named request

家住魔仙堡 提交于 2019-11-28 21:12:47
I am trying to import urllib.request for python 2.7.10 on PyCharm 4.5.4 on Window 10 but getting the error "ImportError: No module named request". The urllib.request modules have been deprecated .. just use import urllib And for your function if you were earlier writing say urllib.request.urlretrieve Now you just write urllib.urlretrieve Bu-gae Park I have also faced the same error and Googled to solve it. urlib.request is for Python 3.0. You may use the code below: import urllib urllib.urlopen(url) Try to use this in Python3 try: x = urllib.request.urlopen('https://www.google.com/search?q