I hope this question will make sense. I have a piece of code that should be run from the command line:
python download_tweets_api.py --dist=tweeti-a.dist.tsv --output=downloaded.tsv
When I run this, it gives me an import error:
ImportError: No module named twitter
To find out why, I opened the Python shell by typing python
. Then I checked sys.path
, and found that the directory containing the twitter module was not in sys.path. So, I appended that directory, and twitter
can now be imported.
However, it seems that
download_tweets_api.py --dist=tweeti-a.dist.tsv --output=downloaded.tsv
cannot be run from the Python shell, maybe because of the specific command line syntax? (I'm not so sure here)
So, I have to exit Python to return back to the 'normal' command line. However, then I lose my sys.path.append, and the twitter directory is no longer in sys.path.
What should I do?