Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

[QUESTION] 'Config' object has no attribute 'Tabs' [x] output._output #976

Closed
shubhamg2001 opened this issue Oct 20, 2020 · 7 comments
Closed

Comments

@shubhamg2001
Copy link

Issue Template

Please use this template!

Initial Check

If the issue is a request please specify that it is a request in the title (Example: [REQUEST] more features). If this is a question regarding 'twint' please specify that it's a question in the title (Example: [QUESTION] What is x?). Please only submit issues related to 'twint'. Thanks.

Make sure you've checked the following:

  • [Yes] Python version is 3.6;
  • [Yes] Updated Twint with pip3 install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint;
  • [Yes] I have searched the issues and there are no duplicates of this issue/question/request.

Command Ran

Please provide the exact command ran including the username/search/code so I may reproduce the issue.
Code I ran :
import twint
import pandas as pd
import os
import csv
import re
from os import listdir
from os.path import isfile, join

import nest_asyncio
nest_asyncio.apply()

c = twint.Config()
c.Lang='en'
c.Since='2020-08-01'
c.Until='2020-08-03'
c.Store_csv=True
c.Count=True
c.Search='vikramlander'
c.Output="tmp3214.csv"
#path='/Users/Desktop/'
#c.Output=path+'temp_Data.csv'
twint.run.Search(c)

Description of Issue

Please use as much detail as possible.
Screen Shot 2020-10-20 at 4 07 51 PM

The code pulls up 46 tweets however they are not getting written into the csv file. I have tried to specify the exact path and also to let it create a folder. I used the nest_asyncio to bypass the event loop is already running error. Please Help. Thanks

Environment Details

Using Windows, Linux? What OS version? Running this in Anaconda? Jupyter Notebook? Terminal?
I am using Jupyter Notebook

@robertmuster
Copy link

Same issue here ; what i did was to comment the line 56 from write.py
dialect = 'excel-tab' if config.Tabs else 'excel'
and remove the "dialect=dialect" form lines 60 & 64
60 writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
64 writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
Hope it helps :)

@shubhamg2001
Copy link
Author

My write.py seems to be somehow different. Can't find the dialect=dialect. thoughts?

Screen Shot 2020-10-20 at 10 13 20 PM

@amandaashleywoo
Copy link

Experiencing the same problem too - twint is working, but I can't export to a csv file!

@shubhamg2001
Copy link
Author

Screen Shot 2020-10-21 at 10 58 47 AM

Same issue here ; what i did was to comment the line 56 from write.py
dialect = 'excel-tab' if config.Tabs else 'excel'
and remove the "dialect=dialect" form lines 60 & 64
60 writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
64 writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
Hope it helps :)

Tried that. Didnt work. Any suggestions?

@robertmuster
Copy link

Make sure that you are changing in the right place (typically it it is the /usr/lib/pythonxxx/twint). What os are you using?

@shubhamg2001
Copy link
Author

shubhamg2001 commented Oct 21, 2020 via email

@AlyeskaBear
Copy link

After making the modification in write.py, you need to restart the script and import twint again. It should work.

himanshudabas added a commit to himanshudabas/twint that referenced this issue Oct 28, 2020
This patch fixes the issue caused by twintproject#967, which broke the functionality of saving the retrieved data into a csv file.
pielco11 pushed a commit that referenced this issue Oct 29, 2020
This patch fixes the issue caused by #967, which broke the functionality of saving the retrieved data into a csv file.
darvell pushed a commit to darvell/twint that referenced this issue Nov 16, 2020
* fix for deprecation of v1.1 endpoints

* fix for cashtags

* typo

* fix(datetime): _formatDateTime tries %d-%m-%y

* fix(pandas): use new str-format Tweet.datetime data rep

* fix(pandas datetime): use ms

* fix(cashtags unwind): undo PRs field removals

* Revert "fix(cashtags unwind): undo PRs field removals"

This reverts commit dfa57c2.

* fix(pandas): remove broken fields

* fix(cash): use provided field as suggested by pr review

* fix (cashtags): re enable cashtags in output

* fix(db): remove broken fields

* fix(datetime): Y-m-d and factored out

* fixes twintproject#947

* fix(get.py): json exception in User

* to-do: added to-do tasks

added to-do tasks for --profile-full feature

* chore(test): PEP8 formatting

* fix(profile): ported user profile to v2 API

fixed user profile feature which was broken since v1 endpoints were deprecated

* updated Readme

* fix: fixes twintproject#965 inconsistent timezones

* fix: handle tombstone tweets

tombstone tweets are those tweets which are flagged by Twitter for being inappropriate, misleading, graphic etc.

* fixes twintproject#976: saving tweets to csv

This patch fixes the issue caused by twintproject#967, which broke the functionality of saving the retrieved data into a csv file.

* feature: port Lookup to v2 endpoint

fixes twintproject#970, lookup is ported to v2 endpoint. this can now be used to lookup a certain profile.

Co-authored-by: SiegfriedWagner <mateus.chojnowski@gmail.com>
Co-authored-by: lmeyerov <leo@graphistry.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants