Anonymous user
Philadelphia Python Workshop 9/Setup/Windows project dependencies: Difference between revisions
Philadelphia Python Workshop 9/Setup/Windows project dependencies (view source)
Revision as of 16:20, 27 July 2013
, 10 years ago→Install the Twitter project dependencies
imported>Geography76 No edit summary |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 44:
<ol>
<li>Click and save
* https://github.com/abatula/PythonWorkshop-Twitter/archive/master.zip
</li>
<li>
The ".zip" extension on the above files indicates that they are compressed Zip archives. We need to "extract" their contents. To do this, click on "Start", then "Computer", and navigate to your Desktop directory. Click on the file and click the "Extract all files" button to extract the contents. This will create a directory
</li>
</ol>
Line 55 ⟶ 56:
===Install the Twitter project dependencies===
Open a command prompt and navigate to the unzipped folder. For example, if you extracted the folder to C:\Users\myname\Desktop\PythonWorkshop-Twitter-master,
<pre>
cd C:\Users\
</pre>
Line 67 ⟶ 68:
</pre>
will show you the source code files in that directory.
Before we can install the dependencies, we must first install some setup tools using ez_setup.py. To do this, change directory into the ez_setup folder and type:
<pre>
python
</pre>
Now, we are ready to install the dependencies. Three of the dependency subfolders have an installer script that we'll need to run at a command prompt to install the software. For each dependency (in the order: simplejson-3.3.0 python-oauth2-master httplib2-0.8) navigate to the folder using cd. One of the files in this subfolder is "setup.py", which has a ".py" extension indicating that it is a Python script. Type:
Navigate to the 3 other dependency directories (in the order you downloaded them: simplejson-2.1.6, python-twitter, python-oauth2) and run▼
<pre>
Line 81 ⟶ 82:
</pre>
▲Navigate to the
<pre>
python setup.py install
</pre>
in all of them to install those dependencies as well. Now use cd to move into the python-twitter-1.0 folder. This time we will run the two following commands to install the dependency:
<pre>
python setup.py build
python setup.py install
</pre>
===Test the Twitter code===
<pre>
cd C:\Users\
</pre>
Line 105 ⟶ 110:
</pre>
will show you the source code files in that directory. One of the files is "
<pre>
CONSUMER_SECRET = 'We will give this to you in class :)'
</pre>
Change the string to the consumer secret string that we will give you in class. Save the file and go back to the command line. The file "twitter_api.py" is also a Python script. Type:
<pre>
|