Hi I am using one application which runs fine in windows with python 2.7 , which is copying files to azure blob storage , same setup i am facing issue in linux/ubuntu setup when we try to import below packges:
from azure.storage.blob import ContentSettings
from azure.storage.blob import BlobClient
Error : ImportError: No module named parse
Can someone help in this regard?
Use the latest version via:
pip install azure-storage –upgrade
And also try with this
1. Uninstall azure-storage-blob using: pip uninstall azure-storage-blob.
2. Reinstall azure-storage-blob using: pip install azure-storage-blob.
For more details refer this github issue
Related
When I try to import BaseBlobService on my IDE (Pycharm), it throw an error: ModuleNotFoundError: No module named 'azure.storage.blob.baseblobservice'
However it works fine on Databricks
Please note that, azure.storage.blob.baseblobservice belongs to azure-storage the older version of Azure Storage SDK. The newer one is azure-storage-blob.
Check whether you are using the older SDK going to this site-packages/azure/storage/blob in your machine and check the blockblobservice.py file.
You can install the latest version of Azure Storage SDK by executing the below command:
pip install azure-storage-blob
And use BlobServiceClient instead of BaseBlobService.
If still the issue persists, try upgrading the SDK like below:
pip install azure-storage-blob --upgrade
And also check whether azure-storage package is installed using pip list, If present the uninstall it.
References:
Getting error No module named 'azure.storage.blob.blockblobservice' while executing on server by Gaurav Mantri
error importing 'BlobServiceClient' from 'azure.storage.blob' by rakshith91
Scenario:
1.I am using Machine learning studio for creating machine learning pipeline and when I am trying to call the .py file which has below code:
import os
os.system(f"pip install pandas")
os.system(f"pip install scikit-learn")
os.system(f"pip install pyodbc")
os.system(f"pip install SQLAlchemy")
import glob
import json
import pandas as pd
from sklearn import preprocessing
import logging
import os
import sys
import pyodbc
import urllib
from sqlalchemy.pool import NullPool
import sqlalchemy
and when I am trying to create and run pipeline from note book getting error:
Collecting pyodbc
Downloading pyodbc-4.0.32.tar.gz (280 kB)
Building wheels for collected packages: pyodbc
Building wheel for pyodbc (setup.py): started
Building wheel for pyodbc (setup.py): finished with status 'error
.....
....
....
...
ModuleNotFoundError: No module named 'pyodbc'
Below are the following workarounds that you can try to resolve the error:
Solution 1:
Install the Microsoft ODBC Driver for SQL Server on Windows, from installing microsoft pyodbc driver for SQL server.
Open the cmd.exe as an administrator
Navigate to the python scripts folder that contains pip
Type: pip install pyodbc
Also, refer this Configure development environment for pyodbc Python development document.
Solution 2:
Also if you have already had the pyodbc module installed , and if you are trying to reference it from another environment.
Right click the Python Environments in the Solution Explorer window.
select add/remove
Select the Python interpreter you want to use.
Refer this MSFT document for more information.
Solution 3:
Also to solve your problem you may try simply uninstalling and reinstalling pyodbc.
Use pip uninstall pyodb and confirm by Y to uninstall and then pip install pyodbc to reinstall.
References:
1 .SO import pyodbc leads to No module named pyodbc
2. Github No module named 'pyodbc'
I have a .yml that installs all the necessary Azure ML packages.
Upon creating the environment with the YML, I test to make sure I can import the packages, and I can.
But when I open the Jupyter notebook I will be using and import the necessary packages, one is not found.
from azureml.train.automl import AutoMLConfig
ModuleNotFoundError: No module named 'azureml.train.automl.automlconfig'
But When I import it in the command prompt, it successfully imports
It seems like this is an issue with VS code, has anyone else encountered this?
I tried reproducing the issue while importing AutoMLConfig in VSCode as below:
Followed the below steps to fix it by installing its related Python packages.
Activate the virtual environment from below command
python -m venv .venv
.venv\Scripts\activate
Then install pip install azureml and “pip install azureml-core”
Pip install azureml-train
Pip install azureml-train-automl
Also, we have a Microsoft documentation where we have all the sub packages of azureml.
After I upgraded AML SDK within conda virtual environment I have started getting error in my MacOS as follows:
print(azureml.core.version)
1.0.76
from azureml.train.automl import AutoMLConfig
ImportError: cannot import name 'AutoMLConfig'
Could you please follow the below steps.
-
Completely uninstall conda and reinstall.
Build the azure_automl env using automl_setup_mac.
run from azureml.train.automl import AutoMLConfig to work.
Please follow the below document for automl setup using local conda environment.
https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/automated-machine-learning#localconda
I'm having issue with accessing Google Storage through Python 3.6.I'm installing with:
pip install --upgrade google-cloud-storage
Here's my Python script:
from google.cloud import storage
def main():
client = storage.Client()
bucket = client.get_bucket('my_bucket')
blob1 = bucket.blob('my_file.json')
blob1.upload_from_filename(filename='my_file.json')
if __name__ == "__main__":
main()
pip show google-cloud-storage gives me following output:
Name: google-cloud-storage
Version: 1.6.0
Summary: Python Client for Google Cloud Storage
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google Cloud Platform
Author-email: googleapis-publisher#google.com
License: Apache 2.0
Location: /usr/local/lib/python3.6/dist-packages
Requires: google-api-core, google-auth, google-cloud-core, requests, google-resumable-media
Any idea what's wrong here?
There is a chance you are installing it with one python version (E.g. python2) and running your code with another version (E.g. python3).
Try mentioning versions of pip and python in the command.
To be precise, use pip of the python version you wanna run the code with. Example:
python3.6 -m pip install --upgrade google-cloud-storage
There could be multiple versions of Python installed on your system and multiple versions of pip as well, the above will make sure you are using the correct version of both.
I met the same problem and solved by running my script as administrator.