pbinkley / twarc-report

Data conversions and examples for generating reports from twarc collections using tools such as D3.js
Creative Commons Zero v1.0 Universal
55 stars 6 forks source link

Error when trying to run harvest.py #19

Open lkjonessoc opened 7 years ago

lkjonessoc commented 7 years ago

I receive the following error message on my fierst attempt to run harvest.py. I have tried several different solutions to ensure that twarc-archive.py is in my PATH, but continue to receive this error message.

vagelos-ve536-0866:twarc-report-master Research$ ./harvest.py projects/projectA /Users/Research/anaconda/bin/twarc-archive.py /Library/Frameworks/Python.framework/Versions/2.7/bin/twarc-archive.py /Library/Frameworks/Python.framework/Versions/3.4/bin/twarc-archive.py /opt/local/bin/twarc-archive.py /opt/local/sbin/twarc-archive.py /usr/local/bin/twarc-archive.py Cannot run twarc-archive.py

edsu commented 7 years ago

I haven't looked to see how harvest.py figures out how to run twarc-archive.py, but I wonder if this is due to a change in the twarc installer that no longer installs twarc-archive.py? Can you try to run twarc-archive.py on the command line and confirm that it's not found?

lkjonessoc commented 7 years ago

Ed,

I don't recall what arguments twarc-archive.py takes, but I assume that if I get the error "too few arguments" when attempting to execute twarc-archive.py, that indicates that it was found but not executed.

Here is how harvest.py calls twarc-archive.py:

'''

find twarc-archive.py on system path

for dirname in os.environ["PATH"].split(os.pathsep):

candidate = os.path.join(dirname, "twarc-archive.py")

print candidate

if os.path.isfile(candidate):

    break

else:

    candidate = ""

try:

execfile(candidate)

except:

sys.exit("Cannot run twarc-archive.py")

'''

On Mon, Jul 17, 2017 at 1:44 PM, Ed Summers notifications@github.com wrote:

I haven't looked to see how harvest.py figures out how to run twarc-archive.py, but I wonder if this is due to a change https://github.com/DocNow/twarc/commit/281888a6819d550987d8e33e31fbb32f53721570 in the twarc installer that no longer installs twarc-archive.py? Can you try to run twarc-archive.py on the command line and confirm that it's not found?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pbinkley/twarc-report/issues/19#issuecomment-315827798, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAnNHvYX1H-io0rhNMypDIB0K6rKx1-ks5sO51kgaJpZM4OaNUV .

edsu commented 7 years ago

Interesting! If you are on Unix or OS X what do you see if you type which twarc-archive.py ?

lkjonessoc commented 7 years ago

/usr/local/bin/twarc-archive.py

On Mon, Jul 17, 2017 at 2:12 PM, Ed Summers notifications@github.com wrote:

Interesting ok. If you are on Unix or OS X what do you see if you type which twarc-archive.py ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pbinkley/twarc-report/issues/19#issuecomment-315836033, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAnNPb4vmIOQ4KYvfelnYx0Z-1lEYl5ks5sO6QBgaJpZM4OaNUV .

lkjonessoc commented 7 years ago

Update: Was able to run twarc-archive.py on another Desktop. Ironically, I created a new desktop because the old one wasn't running some of the twarc utils, as I recall. But there's no need for you to spend additional effort troubleshooting this unless you want to! If so, I am happy to keep working on it.

Best,

Leslie

On Mon, Jul 17, 2017 at 3:09 PM, Leslie Jones lesjones@sas.upenn.edu wrote:

/usr/local/bin/twarc-archive.py

On Mon, Jul 17, 2017 at 2:12 PM, Ed Summers notifications@github.com wrote:

Interesting ok. If you are on Unix or OS X what do you see if you type which twarc-archive.py ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pbinkley/twarc-report/issues/19#issuecomment-315836033, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAnNPb4vmIOQ4KYvfelnYx0Z-1lEYl5ks5sO6QBgaJpZM4OaNUV .

edsu commented 7 years ago

Yeah, it should have found it there since I can see from your copy/paste above that it is looking in /usr/local/bin/. So I guess there's a problem with the way it is being run.

pbinkley commented 7 years ago

I started refactoring twarc-report to work with modern twarc under #14 ; I'll try to finish that off this week.

antongiac commented 6 years ago

I think I have the same problem C:\Program Files\WIDCOMM\Bluetooth Software\syswow64\twarc-archive.py C:\Program Files (x86)\Skype\Phone\twarc-archive.py C:\Program Files (x86)\QuickTime\QTSystem\twarc-archive.py C:\Users\Giacomo\AppData\Local\Microsoft\WindowsApps\twarc-archive.py C:\adb\twarc-archive.py C:\WINDOWS\system32\twarc-archive.py C:\WINDOWS\twarc-archive.py C:\WINDOWS\System32\Wbem\twarc-archive.py C:\WINDOWS\System32\WindowsPowerShell\v1.0\twarc-archive.py C:\Social Data Mining\bin\twarc-archive.py C:\Program Files\Git\cmd\twarc-archive.py C:\Users\Giacomo\AppData\Local\Microsoft\WindowsApps\C:\Python27\twarc-archive.py twarc-archive.py C:\Python27\twarc-archive.py Cannot run twarc-archive.py

For me as well when I run twarc-archive.py, the error is "too few arguments"

lxcode commented 4 years ago

Assuming the issue isn't actually the path settings, this breaks because execfile isn't present in python3. It should be:

exec(open(candidate).read())
cxyccc commented 4 years ago

I have the same problem when I try to run harvest.py: Cannot run twarc-archive.py

F:\twarc\twarc-report-master>python ./harvest.py projects/test C:\Program Files\MySQL\MySQL Server 8.0\bin\twarc-archive.py C:\Program Files (x86)\Common Files\Oracle\Java\javapath\twarc-archive.py C:\Program Files (x86)\Intel\iCLS Client\twarc-archive.py C:\Program Files\Intel\iCLS Client\twarc-archive.py C:\windows\system32\twarc-archive.py C:\windows\twarc-archive.py Cannot run twarc-archive.py

I also try to run twarc-archive.py using 'python twarc-archive.py ferguson f:\twarc\result', but it returns 'no such profile main in C:\Users\hp.twarc'. Please help. Thank you.