No module named azure.cosmos.cosmos_client - python

I'm getting the next error while running the example python script of azure cosmos db:
Traceback (most recent call last):
File "CosmosGetStarted.py", line 1, in <module>
import azure.cosmos.cosmos_client as cosmos_client
ImportError: No module named azure.cosmos.cosmos_client
I was trying to do everything according to the next manual:
https://learn.microsoft.com/en-us/azure/cosmos-db/create-sql-api-python

Install the latest azure-cosmos package:
pip3 install --upgrade azure-cosmos
and then import the package like this:
from azure.cosmos import exceptions, CosmosClient, PartitionKey
there are more details in the official package page here

I was able to fix this issue:
Just call "python3.6 CosmosGetStarted.py" and not "python CosmosGetStarted.py"

Related

Can't import pymatgen.core "No module named 'pymatgen.core'"

I've used pip install pymatgen with Python 3.9.1 on Windows 10 to install pymatgen, but I'm getting the following error:
Traceback (most recent call last):
File "D:\code\pymatgen\pymatgen.py", line 1, in <module>
import pymatgen.core as mg
File "D:\code\pymatgen\pymatgen.py", line 1, in <module>
import pymatgen.core as mg
ModuleNotFoundError: No module named 'pymatgen.core'; 'pymatgen' is not a package
I have also tried to install the previous 2 versions but still getting the same error though I can already see it in the pip list
pymatgen 2022.3.22
What am I missing?
Maybe try using conda ? if this doesn't work then there is definitely some dependencies issue
https://pymatgen.org/installation.html

Requests module not found

I'm trying to run my python code with the the requests module.
This is the code I use:
import requests
res = requests.get("https://www.goodreads.com/book/review_counts.json", params={"key": "rhcFvMg9fxSBPoN4TCb7hQ", "isbns": "9781632168146"})
print(res.json())
The following is the error that shows up:
Traceback (most recent call last):
File "/Users/jonathankent/Downloads/project1/test.py", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
If anyone knows what could be causing this or what I could do to solve it I would be very appreciative.
requests module is not part of python built-in libraries so you have to install it yourself from the command line using pip:
pip install requests
if you are on MacOS try pip3 install requests

ImportError: No module named api_core.exceptions

I wanted to run a google.cloud.storage dependency to my project so I tried to install this dependency with
sudo pip install --upgrade google-api-python-client
Running the above command, we installed all the required packages in the apache airflow dist-packages directory ex:- /usr/local/python2.7/dist-packages/
When i imported libraries into my project using the below code.
from airflow.contrib.operators.mysql_to_gcs import MySqlToGoogleCloudStorageOperator
running the project on Python, i am getting the error ImportError: No module named api_core.exceptions
here is the trace
#python mysql_to_gcs.py
[2019-04-30 06:45:09,668] {settings.py:182} INFO - settings.configure_orm(): Using pool settings. pool_size=5, pool_recycle=1800, pid=15440
Traceback (most recent call last):
File "mysql_to_gcs.py", line 2, in <module>
from airflow.contrib.operators.mysql_to_gcs import MySqlToGoogleCloudStorageOperator
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/operators/mysql_to_gcs.py", line 25, in <module>
from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/hooks/gcs_hook.py", line 25, in <module>
from airflow.contrib.hooks.gcp_api_base_hook import GoogleCloudBaseHook
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/hooks/gcp_api_base_hook.py", line 30, in <module>
from google.api_core.exceptions import GoogleAPICallError, AlreadyExists, RetryError
ImportError: No module named api_core.exceptions
Instead of --upgrade google-api-python-client Just reinstall api-core using
pip install dialogflow
Upgrade has some weird problems which does not update api-core.

ModuleNotFoundError: No module named 'tornado'

RESTART:
C:\Users\alanp\AppData\Local\Programs\Python\Python37-32\FirstDayTornado.py
Traceback (most recent call last):
File
"C:\Users\alanp\AppData\Local\Programs\Python\Python37-32\FirstDayTornado.py",
line 1, in < module>
import tornado.ioloop ModuleNotFoundError: No module named 'tornado'
this is the error message i receive I am currently trying to run tornado's 'hello world' example
https://www.tornadoweb.org/en/stable/
I am currently up-to-date with my python idle being version 3.7.2
Seems like tornado isn't installed. Install it using the following command.
pip install tornado

ImportError: No module named extras

While trying to run (Ubuntu) the Zuul tool: http://ci.openstack.org/zuul/zuul.html
I see the following error:
zuul#master:~/zuul/zuul$ python cmd/server.py
Traceback (most recent call last):
File "cmd/server.py", line 20, in <module>
import extras
ImportError: No module named extras
zuul#master:~/zuul/zuul$
Uncle Google didn't help.
How to find the missing dependency?
Open your command prompt and install extras using :
$ pip install extras
or
$ easy_install extras
The "extras" library suggested in the deleted answer:
https://pypi.python.org/pypi/extras/
did the job!

Categories

Resources