I have seen this issue with some resolutions already, but none have worked for my issue. I have pip installed the latest version of office365(v 2.2.0) to my knowledge using the command:
pip install office365-rest-client
I am trying to import using the following lines of code:
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.files.file import File
I receive the following error:
ModuleNotFoundError: No module named 'office365'
Just to test it out, I uninstalled and reinstalled pandas, then successfully imported pandas into my project.
Install this
pip install Office365-REST-Python-Client
pip install office365
After that, restart your IDE and errase and write again the imports. I no have idea why this worked for me
ATTENTION - You must make the letter O lowercase in both install commands, as below. Capital O does not work.
pip install office365-REST-Python-Client
pip install office365
You also need to install the office365 library as well as office365-rest-client
pip install office365
Related
After install package:
So the problem that dependency just always install new versions of packages.
import camelot
ImportError: cannot import name 'PDFTextExtractionNotAllowed' from 'pdfminer.pdfpage' (/usr/local/lib/python3.7/site-packages/pdfminer/pdfpage.py)
If somebody has a similar problem after build project.
You should to do pip install pdfminer.six==20200517 it's install an older version.
So pdfminer was updated and package camelot stopped works.
Issue: https://github.com/camelot-dev/camelot/issues/169
I am trying to import the module dnspython in a python 3.6 script using import dnspython.
pip3 freeze shows that the package is installed but I keep getting the error ModuleNotFoundError: No module named 'dnspython'
I have tried:
pip3 install dnspython
uninstalling and reinstalling with pip3
pip3 install git+https://github.com/rthalley/dnspython
Cloning the package from github and installing with sudo python setup.py install
pip3 install dnspython3 and using import dnspython3 in the script
Copying the dns folder of the cloned package in the site-packages folder
I am aware of this post for python 2.7 but none of the solutions worked.
The problem was import dnspython. Changing it into import dns worked fine.
Some test code:
import dns
result = dns.resolver.query('google.com', 'A')
for ipval in result:
print('IP', ipval.to_text())
# Output: IP {your ip}
It worked for me (Python 3.8.5):
pip install dnspython3
code:
import dns
from dns import resolver
result = resolver.resolve('google.com')
for ipval in result:
print('IP', ipval.to_text())
I downloaded multiple modules (Discord API, cx_Freeze) (pip download, Windows 10) and now I wanted to use them.
But when I want to import them, it says there isn’t any module.
From my former Python using (before resetting computer) I‘ve added a pycache folder and it worked for one module. I‘m not able to reproduce it for other modules. What to do?
I‘ve only one Python version (3.6.5) on PC.
I‘ve checked the \site-packages folder and they‘re there.
If you are using python3 then try downloading the library using
pip3 install libname
but if you are using python2 then install the library using
pip2 install libname or just pip install libname
try with these command and reply
try installing your library using the command prompt in normal user and with the admin user so that you will get to know that what is happening and also if it is still not working then try installing the library into the same folder of your project using pip custom install command
pip install -t <direct directory> <package>
then use the import statement
For Example I used
pip2 install -t c:\Users\Nav\Desktop\projectss cx_freeze
then i imported the library using
#from cx_Freeze import setup, Executable
import cx_Freeze
from cx_Freeze import *
it worked.
Previously i was getting error like :
File "C:\Python27\lib\site-packages\cx_Freeze\__init__.py", line 10, in <module>
from cx_Freeze.finder import *
ImportError: No module named finder
After custom install it is working
I am currently running python 2.7.
I already installed python-pushover.
But when I try to import following code
from pushover import init, Client'
I get following error
from pushover import init, Client
ImportError: cannot import name init
I have tried
import pushover
from pushover import init, Client
same error.
My guess is that you did pip install pushover. However, this will install a different package from the one you are interested in. Instead, you will need to uninstall that package:
pip uninstall pushover
and install the correct package:
pip install python-pushover
Once you do that, your code should work as expected.
We are able to import azure.storage, but not access the BlobService attribute
The documentation says to use the following import statement:
from azure.storage import BlobService
But that get's the following error:
ImportError: cannot import name BlobService
We tried the following:
import azure.storage
...
foo = azure.storage.BlobService(...)
But that received the following error:
AttributeError: ‘module’ object has no attribute ‘BlobService’
We also tried all of the above with "azure.storage.blob" instead of "azure.storage"
We tried updating azure-storage package but it is up to date (version 0.30.0)
We also tried uninstalling azure-storage and installing the entire azure package, but we got the same results. We tried installing them with both pip and conda, but same results both times.
I am aware that the output suggests that this version of azure.storage has no BlobService attribute, but the documentation clearly states to import from there.
https://azure.microsoft.com/en-us/documentation/articles/machine-learning-data-science-create-features-blob/
If you want to use BlobService, you could install package azure.storage 0.20.0, there is BlobService in that version. In the latest azure.storage 0.30.0 , BlobSrvice is split into BlockBlobService, AppendBlobService, PageBlobService object, you could use BlockBlobService replace BlobService.
It's possible the library has changed since that tutorial was published, but...
I just tried this a few moments ago, successfully:
from azure.storage.blob import BlockBlobService
blob_service = BlockBlobService(account_name="...",account_key="...")
And I installed Azure storage locally via:
pip install azure-storage
I was able to test this by downloading an object from storage:
blob_service.get_blob_to_path("containername","blobname","localfilename")
Note: You could import PageBlobService in similar fashion, but you might not find that too valuable, since page blobs are primarily for vhd's.
I had the same issue after using pip to install the azure package and, as the chosen answer suggests, this can be fixed by installing azure.storage 0.33.0.
However, if you're using pip, you might need to use the "--upgrade" option for it to install properly (this was my experience):
pip install azure-storage --upgrade
I had version 1.0.3 installed (which includes azure.storage version 0.20) on Ubuntu server 16.04 LTS and pip only reinstalled version 0.20 of azure.storage when I uninstalled and reinstalled the azure package. This was according to the pypi page for the azure package v. 2.0.0rc6 which recommends that to upgrade from 1.0.3 to version 2 you should do
sudo pip3 uninstall azure
sudo pip3 install azure
pypi/azure
Instead, this worked for me,
sudo pip3 uninstall azure
sudo pip3 install azure==2.0.0rc6