importerror

ImportError: cannot import name Session, when using Azure SDK

。_饼干妹妹 提交于 2019-12-19 11:19:12
问题 I am running code using Azure SDK. First, I download the sdk by pip install azure . Then I write to run the following python code. import requests import os # make sure you configure these three variables correctly before you try to run the code AZURE_ENDPOINT_URL='https://login.microsoftonline.com/xxxxxx-xx-155715822801/oauth2/token' AZURE_APP_ID='6dxxxxx8-c4af-4522xxx6-5a8f8155a616' AZURE_APP_SECRET='password' def get_token_from_client_credentials(endpoint, client_id, client_secret):

Why am I getting this ImportError?

这一生的挚爱 提交于 2019-12-19 09:11:17
问题 I have a tkinter app that I am compiling to an .exe via py2exe . In the setup file, I have set it to include lxml , urllib , lxml.html , ast , and math . When I run python setup.py py2exe in a CMD console, it compiles fine. I then go to the dist folder It has created, and run the .exe file. When I run the .exe I get this popup window. (source: gyazo.com) I then procede to open the Trader.exe.log file, and the the contents say the following; Traceback (most recent call last): File "Trader.py",

Cannot install PyPdf 2 module

♀尐吖头ヾ 提交于 2019-12-18 14:53:12
问题 Trying to install PyPdf2 module, I downloaded the zip and unzipped it, I executed python setup.py build and python setup.py install , but it seems that it has not been installed , when I try to import it from a python script, it returns an ImportError : import pyPdf Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named pyPdf Any help please. I'm using python 2.7 under windows XP. 回答1: It appears the README file for PyPDF2 is incorrect. It suggests

relative path not working even with __init__.py

筅森魡賤 提交于 2019-12-18 13:07:03
问题 I know that there are plenty of similar questions on stack overflow. But the common answer doesn't seem to be working for me. I have a file structure like this proj/ lib/ __init__.py aa.py bb.py test/ __init__.py aa_test.py I figured that if I include the code in my test.py import lib.aa or from lib import aa I would be able to reference the modules in the lib/ directory. But that did not work. So I tried to add to path, and it adds it correctly: os.environ["PATH"] += ":%s" % os.path.abspath

python3: ImportError: No module named xxxx [duplicate]

家住魔仙堡 提交于 2019-12-18 10:49:10
问题 This question already has answers here : Changes in import statement python3 (4 answers) Closed 3 years ago . I am new to Python and I am trying to understand a problem, which I see when creating a package. I have the following file structure: (Working-Directory is /my/Python/jmLib2) /my/Python/jmLib2 |--- Phone | |--- __init__.py | |--- Pots.py |- Test2.py --------------------------------- cat ./jmLib2/Pots.py #!/usr/bin/python def Pots(): print ("I'm Pots Phone") ---------------------------

python3: ImportError: No module named xxxx [duplicate]

空扰寡人 提交于 2019-12-18 10:49:07
问题 This question already has answers here : Changes in import statement python3 (4 answers) Closed 3 years ago . I am new to Python and I am trying to understand a problem, which I see when creating a package. I have the following file structure: (Working-Directory is /my/Python/jmLib2) /my/Python/jmLib2 |--- Phone | |--- __init__.py | |--- Pots.py |- Test2.py --------------------------------- cat ./jmLib2/Pots.py #!/usr/bin/python def Pots(): print ("I'm Pots Phone") ---------------------------

Python ImportError: No module named wx

喜你入骨 提交于 2019-12-18 10:42:12
问题 Im sorry to ask this question again. I have searched and found endles repeats of it both on stackoverflow and also on general google search. Unfortunatly I just cant get my system sorted. I have the following: C:\Python27\Lib\site-packages\wx-2.8-msw-unicode this folder contains the wx folder and also wx & wxPython folders which each contain the _init_.py files When I import wx I get the error message "no module named wx" What do I need to do in order to get Python to find the relevant files

ImportError: libSM.so.6: cannot open shared object file: No such file or directory

余生颓废 提交于 2019-12-18 10:17:46
问题 When trying to import OpenCV, using import cv2 I get the following error: /usr/local/lib/python2.7/dist-packages/cv2/__init__.py in <module>() 7 8 # make IDE's (PyCharm) autocompletion happy ----> 9 from .cv2 import * 10 11 # wildcard import above does not import "private" variables like __version__ ImportError: libSM.so.6: cannot open shared object file: No such file or directory Not sure how to fix this - trying to play around with Google's new Colaboratory tool. Notebook is here: https:/

ImportError: No module named extern

自闭症网瘾萝莉.ら 提交于 2019-12-18 03:57:09
问题 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

PyInstaller, spec file, ImportError: No module named 'blah'

假如想象 提交于 2019-12-17 22:50:26
问题 I am trying to build a python script via PyInstaller. I have used the following commands to configure, generate a spec file, and build: wget pyinstaller.zip, extracted it, python Configure.py, etc, then: python pyinstaller/Makespec.py --onefile myscript.py python pyinstaller/Build.py myscript.spec Here is the spec file it generated: # -*- mode: python -*- a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'), os.path.join(HOMEPATH,'support/useUnicode.py'), 'icinga.py'], pathex=['/home