位置twitter.pyMac OS X 10.6.7和Python 2.6.7中的文件(pythontwitter库)

2024-04-28 21:39:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我的mac上安装了Python2.6.7(/usr/local/bin/python)。 之前,我安装了pythontwitter库。安装时,我遵循以下步骤:

  1. tar-xvf python-twitter-0.8.3。焦油gz在
  2. cd python-twitter-0.8.3
  3. Python设置.py建造
  4. Python设置.py安装

但是,现在,我想修改twitter.py安装模块时生成的文件。我曾试图在python的site packages目录中找到它,但找不到。在

以下是PYTHONPATH:
/usr/local/lib/python2.6/site packages/setuptools-0.6c11-py2.6.egg
/usr/local/lib/python2.6/site packages/oauth2-1.5.170-py2.6.egg
/usr/local/lib/python2.6/site packages/simplejson-2.1.6-py2.6-macosx-10.4-x86_64.egg
/usr/local/lib/python2.6/site packages/lxml-2.3-py2.6-macosx-10.4-x86_64.egg
/usr/local/lib/python2.6/site packages/python_twitter-0.8.2-py2.6.egg
/usr/local/lib/python26.zip
/usr/local/lib/python2.6
/usr/local/lib/python2.6/plat达尔文
/usr/local/lib/python2.6/plat mac
/usr/local/lib/python2.6/plat mac/lib脚本包
/usr/local/lib/python2.6/lib tk
/usr/local/lib/python2.6/lib旧版
/usr/local/lib/python2.6/lib dynload
/Users/用户名/.local/lib/python2.6/site包
/usr/local/lib/python2.6/site包

我已使用“定位”命令在所有文件夹中找到它,但仍然找不到它。在

有人知道在哪里可以找到twitter.py文件?在


Tags: 文件pybineggmaclibpackagesusr
2条回答

一个简单的

import twitter
print(twitter.__path__)

找出它在哪里?另外,repr(twitter)应该类似于

^{pr2}$

您可能还需要使用virtualenv来设置一个很好的沙盒,以便在系统范围内应用修改之前测试您的修改。在

它在.egg文件中,实际上是一个zip存档。在

/Library/Python/2.6/site-packages-> zipinfo python_twitter-0.8.2-py2.6.egg
Archive:  python_twitter-0.8.2-py2.6.egg   60381 bytes   8 files
-rw-r r   2.0 unx   122153 b- defN 16-Apr-11 16:57 twitter.py
-rw-r r   2.0 unx   128307 b- defN 28-Jun-11 09:14 twitter.pyc
-rw-r r   2.0 unx        1 b- defN 28-Jun-11 09:14 EGG-INFO/dependency_links.txt
-rw-r r   2.0 unx    25334 b- defN 28-Jun-11 09:14 EGG-INFO/PKG-INFO
-rw-r r   2.0 unx       28 b- defN 28-Jun-11 09:14 EGG-INFO/requires.txt
-rw-r r   2.0 unx      397 b- defN 28-Jun-11 09:14 EGG-INFO/SOURCES.txt
-rw-r r   2.0 unx        8 b- defN 28-Jun-11 09:14 EGG-INFO/top_level.txt
-rw-r r   2.0 unx        1 b- defN 28-Jun-11 09:14 EGG-INFO/zip-safe
8 files, 276229 bytes uncompressed, 59457 bytes compressed:  78.5%

如果要进行更改,最简单的操作是在运行之前编辑文件设置.py. 在您的情况下,只需进行更改并重新运行设置.py再一次。在

相关问题 更多 >