【问题标题】:Running python2.6 selftest.py gives me this error运行 python2.6 selftest.py 给我这个错误
【发布时间】:2011-05-27 21:06:30
【问题描述】:

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python:无法打开文件'selftest.py':[Errno 2]没有这样的文件或目录

当我执行 which python 时,我得到 /opt/local/bin/python

所以 selftest.py 找错了地方,但我该如何解决这个问题?

python manage.py shell 和所有其他 django 命令都可以工作。

我在安装 PIL 后运行这个 selftest.py

--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      darwin 2.6.5 (r265:79063, Aug  8 2010, 21:45:26)
          [GCC 4.2.1 (Apple Inc. build 5659)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

To check the build, run the selftest.py script.
running build_scripts
creating build/scripts-2.6
copying and adjusting Scripts/pilconvert.py -> build/scripts-2.6
copying and adjusting Scripts/pildriver.py -> build/scripts-2.6
copying and adjusting Scripts/pilfile.py -> build/scripts-2.6
copying Scripts/pilfont.py -> build/scripts-2.6
copying and adjusting Scripts/pilprint.py -> build/scripts-2.6
changing mode of build/scripts-2.6/pilconvert.py from 644 to 755
changing mode of build/scripts-2.6/pildriver.py from 644 to 755
changing mode of build/scripts-2.6/pilfile.py from 644 to 755
changing mode of build/scripts-2.6/pilfont.py from 644 to 755
changing mode of build/scripts-2.6/pilprint.py from 644 to 755

【问题讨论】:

    标签: python django macos python-imaging-library


    【解决方案1】:

    如果没有更多信息(例如您输入的确切内容以及selftest.py 文件的内容),很难判断发生了什么。但更重要的问题是:你为什么要从头开始安装 PIL?从您显示的路径 (/opt/local/) 来看,您显然已经在使用 MacPorts。您可以使用两个命令(一个,如果您保持 MacPorts 安装是最新的)来安装有效的、最新的 PIL:

    $ sudo port selfupdate
    $ sudo port py26-pil
    

    你也可以从MacPorts安装django:

    $ sudo port py26-django
    

    【讨论】:

      猜你喜欢
      • 2021-08-10
      • 1970-01-01
      • 2023-03-25
      • 2013-04-04
      • 1970-01-01
      • 2011-11-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-28
      相关资源
      最近更新 更多