3
Last login: Wed Aug 15 18:31:40 on console
unknown68a86d4e0c2c:~ pessimisticoptimism$ curl -O http://python-distribute.org/distribute_setup.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16295  100 16295    0     0   3389      0  0:00:04  0:00:04 --:--:--  5813
unknown68a86d4e0c2c:~ pessimisticoptimism$ python distribute_setup.py
Downloading #
Extracting in /var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpqkrkH0
Now working in /var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpqkrkH0/distribute-0.6.28
Installing Distribute
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Non-egg installation
Removing elements out of the way...
Renaming /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools-0.6c12dev_r85381-py2.7.egg-info into /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools-0.6c12dev_r85381-py2.7.egg-info.OLD.1345081179.88
Traceback (most recent call last):
  File "setup.py", line 131, in <module>
    _before_install()
  File "/private/var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpqkrkH0/distribute-0.6.28/distribute_setup.py", line 363, in _before_install
    _fake_setuptools()
  File "/private/var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpqkrkH0/distribute-0.6.28/distribute_setup.py", line 420, in _fake_setuptools
    res = _remove_flat_installation(setuptools_location)
  File "/private/var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpqkrkH0/distribute-0.6.28/distribute_setup.py", line 224, in __no_sandbox
    return function(*args, **kw)
  File "/private/var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpqkrkH0/distribute-0.6.28/distribute_setup.py", line 279, in _remove_flat_installation
    patched = _patch_egg_dir(pkg_info)
  File "/private/var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpqkrkH0/distribute-0.6.28/distribute_setup.py", line 224, in __no_sandbox
    return function(*args, **kw)
  File "/private/var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpqkrkH0/distribute-0.6.28/distribute_setup.py", line 347, in _patch_egg_dir
    _rename_path(path)
  File "/private/var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpqkrkH0/distribute-0.6.28/distribute_setup.py", line 259, in _rename_path
    os.rename(path, new_name)
OSError: [Errno 13] Permission denied
Something went wrong during the installation.
See the error message above.
unknown68a86d4e0c2c:~ pessimisticoptimism$ python3 distribute_setup.py
Extracting in /var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpdpzzpn
Now working in /var/folders/nf/kkw6hklx1zd2kpcmq5xvrxqw0000gn/T/tmpdpzzpn/distribute-0.6.28
Installing Distribute
creating build
creating build/src
creating build/src/docs
creating build/src/docs/_templates
creating build/src/docs/_theme
creating build/src/docs/_theme/nature
creating build/src/docs/_theme/nature/static
creating build/src/docs/build
creating build/src/docs/build/html
creating build/src/docs/build/html/_sources
creating build/src/docs/build/html/_static
creating build/src/setuptools
creating build/src/setuptools/command
creating build/src/setuptools/tests
creating build/src/setuptools/tests/indexes
creating build/src/setuptools/tests/indexes/test_links_priority
creating build/src/setuptools/tests/indexes/test_links_priority/simple
creating build/src/setuptools/tests/indexes/test_links_priority/simple/foobar
creating build/src/tests
creating build/src/tests/python3.3_bdist_egg_test
creating build/src/tests/shlib_test
copying setuptools/__init__.py -> build/src/setuptools
copying setuptools/archive_util.py -> build/src/setuptools
copying setuptools/depends.py -> build/src/setuptools
copying setuptools/dist.py -> build/src/setuptools
copying setuptools/extension.py -> build/src/setuptools
copying setuptools/package_index.py -> build/src/setuptools
copying setuptools/sandbox.py -> build/src/setuptools
copying setuptools/script template (dev).py -> build/src/setuptools
copying setuptools/script template.py -> build/src/setuptools
copying setuptools/tests/__init__.py -> build/src/setuptools/tests
copying setuptools/tests/doctest.py -> build/src/setuptools/tests
copying setuptools/tests/py26compat.py -> build/src/setuptools/tests
copying setuptools/tests/server.py -> build/src/setuptools/tests
copying setuptools/tests/test_bdist_egg.py -> build/src/setuptools/tests
copying setuptools/tests/test_build_ext.py -> build/src/setuptools/tests
copying setuptools/tests/test_develop.py -> build/src/setuptools/tests
copying setuptools/tests/test_dist_info.py -> build/src/setuptools/tests
copying setuptools/tests/test_easy_install.py -> build/src/setuptools/tests
copying setuptools/tests/test_packageindex.py -> build/src/setuptools/tests
copying setuptools/tests/test_resources.py -> build/src/setuptools/tests
copying setuptools/tests/test_sandbox.py -> build/src/setuptools/tests
copying setuptools/tests/test_upload_docs.py -> build/src/setuptools/tests
copying setuptools/command/__init__.py -> build/src/setuptools/command
copying setuptools/command/alias.py -> build/src/setuptools/command
copying setuptools/command/bdist_egg.py -> build/src/setuptools/command
copying setuptools/command/bdist_rpm.py -> build/src/setuptools/command
copying setuptools/command/bdist_wininst.py -> build/src/setuptools/command
copying setuptools/command/build_ext.py -> build/src/setuptools/command
copying setuptools/command/build_py.py -> build/src/setuptools/command
copying setuptools/command/develop.py -> build/src/setuptools/command
copying setuptools/command/easy_install.py -> build/src/setuptools/command
copying setuptools/command/egg_info.py -> build/src/setuptools/command
copying setuptools/command/install.py -> build/src/setuptools/command
copying setuptools/command/install_egg_info.py -> build/src/setuptools/command
copying setuptools/command/install_lib.py -> build/src/setuptools/command
copying setuptools/command/install_scripts.py -> build/src/setuptools/command
copying setuptools/command/register.py -> build/src/setuptools/command
copying setuptools/command/rotate.py -> build/src/setuptools/command
copying setuptools/command/saveopts.py -> build/src/setuptools/command
copying setuptools/command/sdist.py -> build/src/setuptools/command
copying setuptools/command/setopt.py -> build/src/setuptools/command
copying setuptools/command/test.py -> build/src/setuptools/command
copying setuptools/command/upload.py -> build/src/setuptools/command
copying setuptools/command/upload_docs.py -> build/src/setuptools/command
copying setuptools/tests/win_script_wrapper.txt -> build/src/setuptools/tests
copying setuptools/cli-32.exe -> build/src/setuptools
copying setuptools/cli-64.exe -> build/src/setuptools
copying setuptools/cli.exe -> build/src/setuptools
copying setuptools/gui-32.exe -> build/src/setuptools
copying setuptools/gui-64.exe -> build/src/setuptools
copying setuptools/gui.exe -> build/src/setuptools
copying tests/install_test.py -> build/src/tests
copying tests/manual_test.py -> build/src/tests
copying tests/test_distribute_setup.py -> build/src/tests
copying tests/test_python33_bdist_egg.py -> build/src/tests
copying tests/shlib_test/setup.py -> build/src/tests/shlib_test
copying tests/shlib_test/test_hello.py -> build/src/tests/shlib_test
copying tests/python3.3_bdist_egg_test/module.py -> build/src/tests/python3.3_bdist_egg_test
copying tests/python3.3_bdist_egg_test/setup.py -> build/src/tests/python3.3_bdist_egg_test
copying tests/shlib_test/hello.c -> build/src/tests/shlib_test
copying tests/shlib_test/hellolib.c -> build/src/tests/shlib_test
copying tests/shlib_test/hello.pyx -> build/src/tests/shlib_test
copying tests/api_tests.txt -> build/src/tests
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: Refactored build/src/tests/api_tests.txt
--- build/src/tests/api_tests.txt   (original)
+++ build/src/tests/api_tests.txt   (refactored)
@@ -39,7 +39,7 @@
     >>> dist.py_version == sys.version[:3]
     True

-    >>> print dist.platform
+    >>> print(dist.platform)
     None

 Including various computed attributes::
@@ -199,7 +199,7 @@
 You can ask a WorkingSet to ``find()`` a distribution matching a requirement::

     >>> from pkg_resources import Requirement
-    >>> print ws.find(Requirement.parse("Foo==1.0"))    # no match, return None
+    >>> print(ws.find(Requirement.parse("Foo==1.0")))    # no match, return None
     None

     >>> ws.find(Requirement.parse("Bar==0.9"))  # match, return distribution
@@ -211,7 +211,7 @@
     >>> try:
     ...     ws.find(Requirement.parse("Bar==1.0"))
     ... except VersionConflict:
-    ...     print 'ok'
+    ...     print('ok')
     ok

 You can subscribe a callback function to receive notifications whenever a new
@@ -219,7 +219,7 @@
 once for each existing distribution in the working set, and then is called
 again for new distributions added thereafter::

-    >>> def added(dist): print "Added", dist
+    >>> def added(dist): print("Added", dist)
     >>> ws.subscribe(added)
     Added Bar 0.9
     >>> foo12 = Distribution(project_name="Foo", version="1.2", location="f12") 
RefactoringTool: Files that were modified:
RefactoringTool: build/src/tests/api_tests.txt
copying setuptools/tests/indexes/test_links_priority/external.html -> build/src/setuptools/tests/indexes/test_links_priority
copying setuptools/tests/indexes/test_links_priority/simple/foobar/index.html -> build/src/setuptools/tests/indexes/test_links_priority/simple/foobar
copying docs/conf.py -> build/src/docs
copying docs/easy_install.txt -> build/src/docs
copying docs/index.txt -> build/src/docs
copying docs/pkg_resources.txt -> build/src/docs
copying docs/python3.txt -> build/src/docs
copying docs/roadmap.txt -> build/src/docs
copying docs/setuptools.txt -> build/src/docs
copying docs/using.txt -> build/src/docs
copying docs/build/html/_sources/easy_install.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/index.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/pkg_resources.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/python3.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/roadmap.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/setuptools.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/using.txt -> build/src/docs/build/html/_sources
copying docs/_theme/nature/theme.conf -> build/src/docs/_theme/nature
copying docs/build/html/_static/basic.css -> build/src/docs/build/html/_static
copying docs/build/html/_static/nature.css -> build/src/docs/build/html/_static
copying docs/build/html/_static/pygments.css -> build/src/docs/build/html/_static
copying docs/_theme/nature/static/pygments.css -> build/src/docs/_theme/nature/static
copying docs/_theme/nature/static/nature.css_t -> build/src/docs/_theme/nature/static
copying docs/Makefile -> build/src/docs
copying docs/_templates/indexsidebar.html -> build/src/docs/_templates
copying distribute_setup.py -> build/src
copying easy_install.py -> build/src
copying pkg_resources.py -> build/src
copying release.py -> build/src
copying setup.py -> build/src
copying site.py -> build/src
copying CHANGES.txt -> build/src
copying CONTRIBUTORS.txt -> build/src
copying DEVGUIDE.txt -> build/src
copying README.txt -> build/src
copying MANIFEST.in -> build/src
copying launcher.c -> build/src
Skipping implicit fixer: buffer
Skipping implicit fixer: idioms
Skipping implicit fixer: set_literal
Skipping implicit fixer: ws_comma
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages
Non-egg installation
Removing elements out of the way...
Already patched.
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools-0.6c11-py3.2.egg-info already patched.
running install
running bdist_egg
running egg_info
writing distribute.egg-info/PKG-INFO
writing top-level names to distribute.egg-info/top_level.txt
writing dependency_links to distribute.egg-info/dependency_links.txt
writing entry points to distribute.egg-info/entry_points.txt
reading manifest file 'distribute.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'distribute.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
creating build/lib
copying build/src/pkg_resources.py -> build/lib
copying build/src/easy_install.py -> build/lib
copying build/src/site.py -> build/lib
creating build/lib/setuptools
#
copying build/lib/site.py -> build/bdist.macosx-10.6-intel/egg
byte-compiling build/bdist.macosx-10.6-intel/egg/easy_install.py to easy_install.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/pkg_resources.py to pkg_resources.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/__init__.py to __init__.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/archive_util.py to archive_util.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/__init__.py to __init__.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/alias.py to alias.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/bdist_egg.py to bdist_egg.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/bdist_rpm.py to bdist_rpm.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/bdist_wininst.py to bdist_wininst.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/build_ext.py to build_ext.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/build_py.py to build_py.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/develop.py to develop.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py to easy_install.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/egg_info.py to egg_info.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/install.py to install.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/install_egg_info.py to install_egg_info.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/install_lib.py to install_lib.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/install_scripts.py to install_scripts.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/register.py to register.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/rotate.py to rotate.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/saveopts.py to saveopts.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/sdist.py to sdist.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/setopt.py to setopt.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/test.py to test.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/upload.py to upload.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/command/upload_docs.py to upload_docs.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/depends.py to depends.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/dist.py to dist.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/extension.py to extension.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/package_index.py to package_index.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/sandbox.py to sandbox.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/script template (dev).py to script template (dev).cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/script template.py to script template.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/__init__.py to __init__.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/doctest.py to doctest.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/py26compat.py to py26compat.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/server.py to server.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/test_bdist_egg.py to test_bdist_egg.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/test_build_ext.py to test_build_ext.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/test_develop.py to test_develop.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/test_dist_info.py to test_dist_info.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/test_easy_install.py to test_easy_install.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/test_packageindex.py to test_packageindex.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/test_resources.py to test_resources.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/test_sandbox.py to test_sandbox.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/setuptools/tests/test_upload_docs.py to test_upload_docs.cpython-32.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/site.py to site.cpython-32.pyc
creating build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying distribute.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying distribute.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying distribute.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying distribute.egg-info/entry_points.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying distribute.egg-info/top_level.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying distribute.egg-info/zip-safe -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
creating dist
creating 'dist/distribute-0.6.28-py3.2.egg' and adding 'build/bdist.macosx-10.6-intel/egg' to it
removing 'build/bdist.macosx-10.6-intel/egg' (and everything under it)
Processing distribute-0.6.28-py3.2.egg
creating /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.28-py3.2.egg
Extracting distribute-0.6.28-py3.2.egg to /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages
Removing distribute 0.6.27 from easy-install.pth file
Adding distribute 0.6.28 to easy-install.pth file
Installing easy_install script to /Library/Frameworks/Python.framework/Versions/3.2/bin
Installing easy_install-3.2 script to /Library/Frameworks/Python.framework/Versions/3.2/bin

Installed /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/distribute-0.6.28-py3.2.egg
Processing dependencies for distribute==0.6.28
Finished processing dependencies for distribute==0.6.28
After install bootstrap.
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools-0.6c11-py3.2.egg-info already exists

unknown68a86d4e0c2c:~ pessimisticoptimism$ easy_install pip
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-414.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Library/Python/2.7/site-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  #

Please make the appropriate changes for your system and try again.

unknown68a86d4e0c2c:~ pessimisticoptimism$ pip install distribute
-bash: pip: command not found
unknown68a86d4e0c2c:~ pessimisticoptimism$ pip -U pyramid
-bash: pip: command not found
unknown68a86d4e0c2c:~ pessimisticoptimism$

上記は、Mac OSXLionにDistributeとPyramidをインストールするための私の試みです。それはうまくいきませんでしたので、どんな入力でもいただければ幸いです!

4

3 に答える 3

5

1 か月前、これは私にとって大きな謎でした。すべてを説明します。冗長になることをお許しください。

(または同様の) インストールを行う場合python setup.py、システム全体の (つまり、コンピュータ上のすべてのユーザーが利用できる) インストールにインストールします。アプリのインストールと同様に、(管理者) 権限が必要です。前に保留中のコマンドを使用しsudoて、管理者権限でコマンド ラインからインストールする方法です。

そうは言っても、D.Shawley(および他の多くの人)が指摘したように、現在、一般的な慣行はvirtualenvの使用を指示しています。これにより、システムとは別の python インストールが可能になります。システムを台無しにすることなく、あらゆる種類のものをインストール/変更できます。

(クリーンインストールされた) Mountain Lionで virtualenv を使用して Pyramid をセットアップする方法を次に示します。(最初にXCode Command Linen Tools
をインストールする必要があります- 開発者 ID が必要です)

george$ sudo easy_install pip
george$ sudo pip install virtualenv
george$ sudo pip install virtualenvwrapper

virtualenv を使用して、選択したディレクトリに virtualenv を作成します。以下では、Projects という名前のディレクトリを作成し、そこに移動してから、virtualenv を作成して、pyramid という名前を付けます。

george$ mkdir ~/Projects
george$ cd ~/Projects
george$ virtualenv myVirtualenv        -- this just creates the environment.
george$ cd myVirtualenv                -- change into the directory
george$ ls                        -- list contents of the direcotry

インストール後の ls の出力にはbin、 、include、およびの 3 つのフォルダーが表示されますlib。virtualenv は、必要なツールbinをこのディレクトリのフォルダー内に配置pipしますpython。したがって、このフォルダー内で作業するときは、常にそれらのディレクトリ内のバージョンを参照してください。

不正解: pip install pyramid
正解: bin/pip install pyramid

実行bin/pip install pyramidすると、仮想環境にピラミッドがインストールされます。pyramidインストールが必要なものに置き換えて、同じコマンドを再実行します。

于 2012-08-16T16:35:05.460 に答える
2

として実行することもsudo pip install distribute、最初にvirtualenvを作成してアクティブ化してから、それらのコマンドを実行することもできます。

于 2012-08-16T02:04:52.627 に答える
1

仮想環境にインストールすることをお勧めします。virtualenv最初に easy_installを使用してインストールします。これは、グローバル環境にインストールする必要がある唯一のものです。sudoただし、インストールする必要があります。

unknown68a86d4e0c2c:~ sudo easy_install virtualenv
Password:
.... lots of output here ....
Installing virtualenv script to /usr/local/bin
Installing virtualenv-2.7 script to /usr/local/bin

Using /Library/Python/2.7/site-packages/virtualenv-1.7.2-py2.7.egg
Processing dependencies for virtualenv
Finished processing dependencies for virtualenv
unknown68a86d4e0c2c:~ which virtualenv
/usr/local/bin/virtualenv
unknown68a86d4e0c2c:~ virtualenv --no-site-packages pyramid
The --no-site-packages flag is deprecated; it is now the default behavior.
New python executable in pyramid/bin/python
Installing setuptools............done
unknown68a86d4e0c2c:~ cd pyramid
unknown68a86d4e0c2c:pyramid source bin/activate
(pyramid)unknown68a86d4e0c2c:pyramid which pip
/Users/unknown68a86d4e0c2c/pyramid/bin/pip
(pyramid)unknown68a86d4e0c2c:pyramid pip install pyramid
Downloading/unpacking pyramid
  Downloading pyramid-1.3.3.tar.gz (2.4Mb): 2.4Mb downloaded
  Running setup.py egg_info for package pyramid
.... lots of output ....
Successfully installed pyramid Chameleon Mako WebOb repoze.lru zope.interface 
zope.deprecation venusian translationstring PasteDeploy MarkupSafe
Cleaning up...
(pyramid)unknown68a86d4e0c2c:pyramid which pserve
/Users/unknown68a86d4e0c2c/pyramid/bin/pserve

開発に慣れると、virtualenvそれなしで何をしたかを完全に理解することはできません. Pyramid チュートリアルは、私の最初の経験virtualenvでした。チュートリアルのセットアップ セクションで簡単に説明しています。

于 2012-08-16T02:28:32.740 に答える