ImportError: No module named oauth_dance - python

I am using PyDev and Eclipse to create a project that uses Twitter Search API to collect data. When I try to run it I get the error saying
from twitter.oauth_dance import parse_oauth_tokens
ImportError: No module named oauth_dance
I have already installed twitter using pip install twitter, there is a module called oauth_dance.py and oauth_dance.pyc in the twitter folder in C:\Python27\Lib\site-packages which is in PYTHONPATH. I already tried uninstalling and then installing twitter again, restarted Eclipse and it still doesn't work.
Any suggestions on how to solve this?

Related

VSCode doesn't recognize ConfluentKafkaLibrary to use in Robot Framework

I need to do a test automation in Robot Framework using Kafka topics. I'm trying to use the ConfluentKafkaLibrary library, but VSCode doesn't recognize it.
I already installed the commands:
pip install robotframework-confluentkafkalibrary
pip install confluent-kafka
Still, it keeps giving the error:
Unresolved library: ConfluentKafkaLibrary. Error generating libspec: Importing library 'ConfluentKafkaLibrary' failed: ModuleNotFoundError: No module named '_bz2' Consider adding the needed paths to the "robot.pythonpath" setting and calling the "Robot Framework: Clear caches and restart" action.
Does anyone know how to solve this problem?
IMAGE - error message
I already tried to reinstall all libraries.
I already tried to configure the robot.pythonpath.
I've restarted VSCode several times, after each step.

ModuleNotFoundError with pyDataverse - API for Harvard Dataverse

I'm trying to use a Python API to access and download data the Harvard Dataverse. The FAQs page for using APIs to access the Dataverse suggests the dataverse package, and the .readme for that GitHub repo points towards an alternative pyDataverse package. When I try to run and import these modules in a Jupyter Notebook I get a ModuleNotFoundError - but I have all the dependencies for these modules installed (requests, jsonschema, urllib3), so I'm not sure what the problem is.
!pip install pyDataverse
import pyDataverse
Returns:
ModuleNotFoundError: No module named 'pyDataverse'
And the same issue when I try the dataverse module - this module isn't available through PyPI so I ran pip install -e git+https://github.com/IQSS/dataverse-client-python.git#egg=dataverse instead (see the readme) and then ran import dataverse - which produced the same error. Any idea what I'm doing wrong? Or alternative suggestions for APIs to access Dataverse repositories?

How to solve the No module named bootstrap_date_picker_plus error?

I am using Django 3.2.3 and I would like in my app to use date picker using the package bootstrap_datepicker_plus. I have installed it and added it following the steps in the link https://pypi.org/project/django-bootstrap-datepicker-plus/. However, when I run the app, I am getting the error ModuleNotFoundError: No module named 'bootstrap_datepicker_plus. When I checked in the installed packages, I noticed that the bootstrap_date_picker_plus package is installed as it is shown in the attached image

How to solve GraphQl ImportError - cannot import name 'gql' from 'gql' in Python?

I installed GraphQl on Windows 10 Laptop using the below command:
pip install --pre gql[all]
I tried using the Basic example available on Official Github Page. in my Python IDLE.
However, I am getting this ImportError in my IDLE.
ImportError: cannot import name 'gql' from 'gql'
Kindly help in resolving the issue.
Thanks
make sure the name of your file you're testing with isn't named something similar to a package you're importing. Just got me when I named my file ariadne.py
https://github.com/mirumee/ariadne/issues/400#issue-662473441

ImportError: No module named mechanize - XCode 6.1 is not seeing newly installed python libraries

Recently I installed Mac OS Yosemite. Until then I had no problem in installing libraries and have already installed beautiful soup, pydelicious, etc. After the installation of Yosemite, I tried to install Mechanize and Requests Libraries in mac. There was no problem in their installation. I could import them and use them from the Terminal. However, Xcode 6.1 doesn't load them/seeing them. I consistently get the
ImportError: No module named mechanize
ImportError: No module named requests
error messages.
I have already tried changing the file permissions with full access to the user but to no avail.
I also checked PYTHONPATH and .profile files, so far no luck.
I wonder, if any has encountered this problem or if any one know of some fix to this problem?
Apparently Xcode was referring to my default of Python.
After the comment from Droppy, I checked my python version by using
which python
I copy pasted the result in the Xcode Program scheme. Now it works...!
Thanks for all the help.

Categories