0

私はPythonプログラミングにまったく慣れていないので、かなりエキサイティングに見えるIPython Notebookのようなものを実行できる機能ベースを手に入れようとしています。

これまでのところ、OS X 10.6 (Snow Leopard) にはPython 2.73.3fromの両方がインストールされています。これまでに試したほとんどすべてが期待どおりに機能します。私は学習に集中していますが、使用するオプションも必要です。Python パッケージ マネージャーを使用して PyPI パッケージへのアクセスを開始するために必要ないくつかのドキュメントを読みましたが、これは 3k に使用する必要があるものです。それで、見つけたドキュメントに従ってそれをインストールしましたが、うまくいくようでした。python.orgActiveTcl 8.5.133.32.7distribute

pipまた、指示どおりにインストールし、他の多くのものもインストールしました。

この時点で、私は持っています:

$ pip freeze
distribute==0.6.34
ipython==0.13.1
nose==1.2.1 (installed after IPython)
pexpect==2.4 (installed after IPython)
pyflakes3k==0.4.3
readline==6.2.4.1 (installed after IPython)

この時点で、私はipython.org ガイダンスからこれを行っています

そして、私がやったとき$ easy_install pexpect、私はたくさんのエラーを受け取りました:

$ easy_install pexpect
Searching for pexpect
Reading http://pypi.python.org/simple/pexpect/
Reading http://pexpect.sourceforge.net/
Reading http://sourceforge.net/project/showfiles.php?group_id=59762
Best match: pexpect 2.4
Downloading http://pypi.python.org/packages/source/p/pexpect/pexpect-2.4.tar.gz#md5=fe82d69be19ec96d3a6650af947d5665
Processing pexpect-2.4.tar.gz
Writing /var/folders/td/td0Sh8EfGFuMCnKex1v+q++++TI/-Tmp-/easy_install-s4dtyy/pexpect-2.4/setup.cfg
Running pexpect-2.4/setup.py -q bdist_egg --dist-dir /var/folders/td/td0Sh8EfGFuMCnKex1v+q++++TI/-Tmp-/easy_install-s4dtyy/pexpect-2.4/egg-dist-tmp-5h5cg4
File "build/bdist.macosx-10.6-intel/egg/fdpexpect.py", line 36
raise ExceptionPexpect, 'The fd argument is not a valid file descriptor.'
                      ^
SyntaxError: invalid syntax

File "build/bdist.macosx-10.6-intel/egg/FSM.py", line 77
return `self.value`
       ^
SyntaxError: invalid syntax

File "build/bdist.macosx-10.6-intel/egg/pexpect.py", line 82
except ImportError, e:
                  ^
SyntaxError: invalid syntax

zip_safe flag not set; analyzing archive contents...
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pexpect-2.4-py3.3.egg/fdpexpect.py", line 36
raise ExceptionPexpect, 'The fd argument is not a valid file descriptor.'
                      ^
SyntaxError: invalid syntax

File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pexpect-2.4-py3.3.egg/FSM.py", line 77
return `self.value`
       ^
SyntaxError: invalid syntax

File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pexpect-2.4-py3.3.egg/pexpect.py", line 82
except ImportError, e:
                  ^
SyntaxError: invalid syntax

Adding pexpect 2.4 to easy-install.pth file

Installed /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pexpect-2.4-py3.3.egg
Processing dependencies for pexpect
Finished processing dependencies for pexpect

それは私には悪いように見えます (ただし、私はまだそれを実際に解釈する専門知識を持っていません) pexpect

インストール後nose(pexpect上記の URL の前)、コマンド ラインから と を実行しようとしましたが、どちらもコマンドを見つけることができませんでしたが、もう一度実行した後iptest(後)、このインストールが追加されていることに気付きました(および他のいくつかのスクリプト) をパスに追加し、bash シェルで iptest3を検出できるようになりましたが、実行すると、見栄えの悪い出力が得られます。iptest3easy_install ipythonnoseiptest3ipcluster3

$ iptest3
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.3/bin/iptest3", line 9, in <module>
load_entry_point('ipython==0.13.1', 'console_scripts', 'iptest3')()
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/distribute-0.6.34-py3.3.egg/pkg_resources.py", line 343, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/distribute-0.6.34-py3.3.egg/pkg_resources.py", line 2308, in load_entry_point
return ep.load()
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/distribute-0.6.34-py3.3.egg/pkg_resources.py", line 2014, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/__init__.py", line 43, in <module>
from .config.loader import Config
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/__init__.py", line 16, in <module>
from .application import *
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/application.py", line 31, in <module>
from IPython.config.configurable import SingletonConfigurable
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/configurable.py", line 26, in <module>
from .loader import Config
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/loader.py", line 27, in <module>
from IPython.utils.path import filefind, get_ipython_dir
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/utils/path.py", line 25, in <module>
from IPython.utils.process import system
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/utils/process.py", line 27, in <module>
from ._process_posix import _find_cmd, system, getoutput, arg_split
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/utils/_process_posix.py", line 22, in <module>
from IPython.external import pexpect
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/external/pexpect/__init__.py", line 2, in <module>
import pexpect
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pexpect-2.4-py3.3.egg/pexpect.py", line 82
except ImportError, e:
                  ^
SyntaxError: invalid syntax

それをすべて行った後、私は を/Library/Frameworks/Python.framework/Versions/Current指していたことに気付き、2.7それが私の問題に関連している可能性があると推測し、シンボリックリンクを を指すように変更しました3.3が、iptest3それでも上記のエラーで失敗します。

これを修正するために何をすべきかについて他の考えはありますか? 私がやりたいことiptest(のような)をするのにかなり重要であることは明らかです。IPython Notebook

4

1 に答える 1

3

pexpect-uと呼ばれる pexpect の py3 互換フォークがあります(u は Unicode 用であり、2 つの主な違いです)。これは、Python 3 で IPython の pexpect ベースの部分を実行するために必要です。

pip install pexpect-u

補足: pexpect-u は IPython 開発者の Thomas Kluyver によるものです。彼は py3 との互換性を IPython にもたらすために多大な労力を費やしました。

于 2013-01-11T06:06:40.120 に答える