I'm trying to do a personal project for my portfolio, I would like to scrape the tweets about the president Macron but I get this error with twitterscrapper.
from twitterscraper import query_tweets
import datetime as dt
import pandas as pd
begin_date=dt.date(2020,11,18)
end_date=dt.date(2020,11,19)
limit=1000
lang='English'
tweets=query_tweets("#macron",begindate=begin_date,enddate=end_date,limit=limit,lang=lang)
Error:
TypeError: query_tweets() got an unexpected keyword argument 'begindate'
May I know how to solve it?
The code is fine, the problem is that you installed the outdated version of twitterscraper.
You may update your package by using pip install twitterscraper --upgrade
or
pip install twitterscraper==1.6.1 to ensure it is the latest
Related
Hoping someone has some experience with the Alpaca API. I have installed using pip install alpaca-trade-api, and also pip3 install alpaca-trade-api.
What I do not understand is that I can install alpaca trade API, but not the specific module.
import alpaca_trade_api as tradeapi
This bit runs. But the below doesn't
from alpaca_trade_api import StreamConn
As it returns
cannot import name 'StreamConn' from 'alpaca_trade_api'
Thanks in advance! :)
I'm having this issue the past couple of days that is preventing me from getting into my project. So, I have installed statmodels and whenever I type "pip list" in the VS Code Terminal I can clearly see that statsmodels 0.12.2 is installed.
My issue is that on the line that I try to import the library.
from statsmodels.tsa.seasonal import seasonal_decompose
This error pops up:
Unable to import 'statsmodels.tsa.seasonal'pylint(import-error)
Any ideas on how to fix this are highly appreciated!
I'm using the gradio library with one of the basic examples, but am getting this error. I am running this in a Google Colab Notebook. Here is the relevant lines of code:
fare = gr.inputs.Slider(minimum=0, maximum=1000, default=100, label="Fare (british pounds)")
gr.Interface(predict_survival, [sex, age, fare], "label", live=True).launch();
The error is:
MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant http://None?
This error happens with older versions of Gradio. Please force upgrade to the latest version of Gradio (sometimes colab doesn't do this automatically):
pip install gradio --upgrade
Facing below issue: can anyone help? please..
Getting the below while trying to extract table data from PDF's..
import camelot
# PDF file to extract tables from
file = input_folder+file_name
tables = camelot.read_pdf(file)
# number of tables extracted
print("Total tables extracted:", tables.n)
# print the first table as Pandas DataFrame
print(tables[0].df)
Error: AttributeError: module 'camelot' has no attribute 'read_pdf'
This error most likely occured because you installed the wrong package.
When you installed the camelot module, you should have used this:
pip install camelot-py[cv]
If not, uninstall the package you installed and use the above command.
I encounted the same problem and tried many things, including install/uninstall various camelot packages, cloning git, etc. It didn't work for me. I found that the issue was related to CV2. Server (headless) environments do not have GUI packages installed so if you are using Camelot on the server with no GUI you should instal opencv-python-headless first:
pip install opencv-python-headless
and then import in along with camelot.io insteatd of camelot:
import camelot.io as camelot
import cv2
I'm trying to retrieve data using pandas datareader, but when I try to import it, it will not run generating the error below. I have installed the latest pandas and pandas-datareader through pip.
On a similar question they claimed they solved it by just downgrading to an older version of pandas and pandas-datareader, although when I try to reciprocate this result, it fails to downgrade the two and still continues to have these errors. I had more code earlier and thought that the problem lied within the code, but when I decided to comment out everything I realized that the error occurred during importing as shown below. There is also more to the error message below but I believe I included the important part, as the rest is just the traceback.
import pandas as pd
import pandas_datareader as web
ImportError: cannot import name 'StringIO' from 'pandas.compat' (/Users/roshanamir/Desktop/AI/Pycharm/ATM2/venv/lib/python3.7/site-packages/pandas/compat/__init__.py)
Any help would be appreciated, thank you in advance.
pandas.compat.StringIO was removed when pandas stopped supporting Python 2 in version 0.25.0.
This has been repaired in pandas datareader and will be released in 0.8.0. For now, download the latest development version where the changes are live.