I have installed google-api-python-client library using pip3.4 Iam following tutorial from google authenicating client library so every time i run the python code provided by google to authenticate client library throws error as
import clientsecrets ImportError: No module named 'clientsecrets'
I have only python3.4 running on my pc and no other python. it might be similar thread to one here Python can't find module 'clientsecrets' when trying to set up oauth2 in Django using the Google Python API
but i found no solution there.
The python code i got from google is here
https://developers.google.com/maps/documentation/tracks/auth#authenticating_using_a_client_library
The library doesn't support Python 3. As of PEP 404:
In Python 3, implicit relative imports within packages are no longer available - only absolute imports and explicit relative imports are supported.
The oauth2client library uses import clientsecrets, which for Python 3 would need to be rewritten as from . import clientsecrets. Even if you changed those, the rest of the library would still be incompatible with Python 3.
There's at least one fork for Python 3 development, but it doesn't seem to be a big priority for the project. Until then, you'll have to find another library or write a wrapper yourself with requests for the functionality you need.
Related
I am new to Cloud SDK, and I tried to invoke the following action, but I get error : " stderr: ModuleNotFoundError: No module named 'cloudant'",.
NOTE:
Console ==> IBM cloudant python 3.9 SDK: No module named 'cloudant'"
CLI ==> Python 3.86 : accepted the module without error
Question :==> I need to know how to do it using the CLI.
If you have a solution please let me know in time. Thank You!!.
from cloudant.client import Cloudant
import requests
import json
dict = {"COUCH_USERNAME": "--bluemix",
"IAM_API_KEY": "---bluemix"}
def main(dict):
client = Cloudant.iam(user_name=dict["COUCH_USERNAME"],
api_key=dict["IAM_API_KEY"],
connect=True)
my_database=client['reviews']
return my_database.json```
Yes I did. I have used Python 3.7 and it works. However, it is depreciated on IBM cloud
The Python cloudant module is EOL and is replaced by the ibmcloudant module.
As per the Functions documentation the 3.9 runtime contains the new ibmcloudant module.
You should migrate your action code to use ibmcloudant instead of cloudant. If you can't want to migrate your code then you could force it to use the 3.7 runtime with --kind python:3.7 or create a custom 3.9 runtime with the cloudant module installed.
I'm just started to search Aliexpress-API documentation. In there: Developers.aliexpress , Im coding in python and need to import AliexpressSolutionProductPostRequest from top.api but it fails.
I installed top lib on Windows like that: python -m pip install top
Reinstalled twice but it fails. Its official website and fails. I can't figure it out.
AttributeError: module 'top.api' has no attribute 'AliexpressSolutionProductPostRequest'
This library has diffrent functions for Alibaba , not for aliexpres. Any suggestion for fix that ? Actually i can't find top library's offical documentation too.Thank you..
Okey. I found this library for fix that error. We need to install aliexpress-sdk:
pip install aliexpress-sdk
or (for pre-release):
pip install git+https://github.com/bayborodin/aliexpress-sdk
Now I can import Aliexpress modules which are in Aliexpress API Documentation.
Example module import for aliexpress:
from aliexpress.api import AliexpressSolutionProductPostRequest
I just learned offical way to do that.
After create an app on Aliexpress Console, you can generate API SDK for Python. In there you can find top library's functions which are in Aliexpress API Documentation. So we need to create App first, once accepted , we can do all these stuff.
I am working on fusion360 python API and face some library issue. Actually, I import PIL python library in my code and it give the error that ModuleNotFoundError: No module named 'PIL'. Can anyone knows how to add the external python libraries in Fusion360 environment that allows me to use the PIL python library for fusion360 API ?
There is no easy way to do that to my knowledge. Fusion 360 uses a separate Python version which only has standard libraries. There are some workarounds mentioned here:
https://forums.autodesk.com/t5/fusion-360-api-and-scripts/to-install-python-modules/td-p/5777176
But overall it is better to stick to standard libraries as making other libraries work will be tedious work. And most likely will stop working after Fusion 360 makes an update
I'm running StreamSets in a docker on CentOS. Trying to import a python package in Jython, it returns the following error:
SCRIPTING_05 - Script error while processing record: javax.script.ScriptException: ImportError: No module named pandas in <script> at line number
Here is the code within Jython module to import my package:
import sys
sys.path.append('/path_to_my/python2.7/site-packages')
import pandas
note: Since I'm running StreamSets in a docker, I already made sure my docker has access to /path_to_my/python2.7/site-packages
Quoting u/metadaddy from ask.streamsets/168
The problem with pandas and other Python packages such as NumPy is that, even if you import the Python modules, you will not be able to use them, since they include C extensions, which cannot be loaded by Jython. There are initiatives such as JyNI that aim to bridge the gap between Jython and C extensions; SDC-7313 tracks inclusion of JyNI with the SDC Jython Evaluator.
So, I guess you will have to work around this by using a C-independent library.
I'm working to build a app to upload image to imgur on GAE with python27, I have downloaded some extra modules from github (pyimgur), which require some modules to be in the app directory which I have installed & placed it under LIB directory & I was able to eliminate each error one by one until till last one turned up, I'm not sure how to fix it, as I couldn't find any pip module for it. The error I am getting is
ImportError: No module named termios
So I do I install it? or Include it?
other module required {which I've them installed & placed it under my app directory are}
1.auth
2.decorator
3.httplib2
4.oauth2
5.pyimgur
6.requests
here's :gae error log it's on line 30
It looks like there are a number of pyimgur libraries available. I would make sure that you are using the correct one.
It looks like you are trying to use this library based on the other dependencies you have installed (decorator, oauth2, requests) https://github.com/Damgaard/PyImgur
However, there is no auth module in that library, so line 28 of your uploadimage.py file doesn't make any sense because there is no auth to import.
from pyimgur import auth
Try out the library I linked instead.