Error while importing NSWorkspace from AppKit in python - python

Even after installing AppKit, I am not able to import NSWorkspace from it.
This is the error I am receiving:
ImportError: cannot import name 'NSWorkspace' from 'AppKit'
I have tried installing pyobjc, but still it's not solving the problem

Related

ImportError in python: cannot import from a partially initialized module.. in python

I have python 3.10 code running from some time, and now, it started getting me errors while importing the libraries, without any modification in the code.
For example, from this line:
from azure.keyvault.secrets import SecretClient
I get this error;
from azure.keyvault.secrets import SecretClient
ImportError: cannot import name 'SecretClient' from partially initialized module 'azure.keyvault.secrets' (most likely due to a circular import) (C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\keyvault\secrets\__init__.py)
The library was installed using:
pip install azure-keyvault
Any idea what could be the problem? I tried uninstalling and installing the library again, but I still get the errors...
Thanks
Gus
azure-keyvault is deprecated.
Please uninstall azure-keyvault and use pip install azure-keyvault-secrets.
(I work in MS in the SDK team)

Encountering 'urlparse module not found' error while importing googleanalytics library in Jupyter notebook

I am working on a project where I need to use the Google Analytics API to extract data into a python notebook.
I installed the googleanalytics library using:
!pip install googleanalytics
and it successfully installed.
Then I tried importing the library using:
import googleanalytics as ga
but it gives me a ModuleNotFound error which shows:
ModuleNotFoundError: No module named 'urlparse'
I then checked which library urlparse belongs to and found that it is a part of urllib3 library. So I tried installing that library but I got a message that it is already installed.
So I separately tried importing urlparse to check if it works using:
from urllib.parse import urlparse
and it works.
In summary, the urlparse module is installed but when I import googleanalytics library, I get an error that says module is not found.
How can that be fixed?

from apiclient.discovery import build ModuleNotFoundError: No module named 'apiclient.discovery'

I'm trying to use the python google-api-python-client for a Youtube Data API project but when I run the following line:
from apiclient.discovery import build
I get the following eror:
from apiclient.discovery import build ModuleNotFoundError: No module named 'apiclient.discovery'
import apiclient runs fine but importing discovery returns an error.
I already checked the top answers from ImportError: No module named apiclient.discovery, but to no avail.
When I run python --version:
I get Python 3.7.6
I'm running MacOs Catalina
Nevermind I fixed the issue by switching apiclient with googleapiclient

Python-USDA client throwing package error. What is the right package name?

I'm trying to connect to the USDA API using python-usda, using the following process as mentioned in the PyPI docs.
Installing with pip install python-usda and then importing with from usda.client import UsdaClient.
This throws an error:
from usda.client import UsdaClient
ModuleNotFoundError: No module named 'usda.client'; 'usda' is not a package
What package should I be trying to import?

no module named disutils.core

I have installed the 64 bit version of the Anaconda python distribution on my Windows 64 bit machine. I am trying to cythonize a python script and I get an error at the following line:
from disutils.core import setup
ImportError: No module named disutils.core
I tried
import disutils
ImportError: No module named disutils
Based on the information at the following link :
https://pypi.python.org/pypi/setuptools#windows-7-or-graphical-install
I downloaded and ran ez_setup.py
I still get the same error. Can anyone help me solve my problem ?
from disutils.core import setup
should be:
from distutils.core import setup
You have spelled it disutils and distuils both missing a t
import distuils should be distutils

Categories