<i id='12ebK'><tr id='12ebK'><dt id='12ebK'><q id='12ebK'><span id='12ebK'><b id='12ebK'><form id='12ebK'><ins id='12ebK'></ins><ul id='12ebK'></ul><sub id='12ebK'></sub></form><legend id='12ebK'></legend><bdo id='12ebK'><pre id='12ebK'><center id='12ebK'></center></pre></bdo></b><th id='12ebK'></th></span></q></dt></tr></i><div id='12ebK'><tfoot id='12ebK'></tfoot><dl id='12ebK'><fieldset id='12ebK'></fieldset></dl></div>

    <bdo id='12ebK'></bdo><ul id='12ebK'></ul>

    1. <legend id='12ebK'><style id='12ebK'><dir id='12ebK'><q id='12ebK'></q></dir></style></legend>
      1. <tfoot id='12ebK'></tfoot>

        <small id='12ebK'></small><noframes id='12ebK'>

      2. 在 Mac 上安装 python 模块最兼容的方式是什么?

        时间:2023-09-14

              <tfoot id='ecE4g'></tfoot>
                <tbody id='ecE4g'></tbody>
                <i id='ecE4g'><tr id='ecE4g'><dt id='ecE4g'><q id='ecE4g'><span id='ecE4g'><b id='ecE4g'><form id='ecE4g'><ins id='ecE4g'></ins><ul id='ecE4g'></ul><sub id='ecE4g'></sub></form><legend id='ecE4g'></legend><bdo id='ecE4g'><pre id='ecE4g'><center id='ecE4g'></center></pre></bdo></b><th id='ecE4g'></th></span></q></dt></tr></i><div id='ecE4g'><tfoot id='ecE4g'></tfoot><dl id='ecE4g'><fieldset id='ecE4g'></fieldset></dl></div>
                <legend id='ecE4g'><style id='ecE4g'><dir id='ecE4g'><q id='ecE4g'></q></dir></style></legend>
                  <bdo id='ecE4g'></bdo><ul id='ecE4g'></ul>

                  <small id='ecE4g'></small><noframes id='ecE4g'>

                • 本文介绍了在 Mac 上安装 python 模块最兼容的方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我开始学习 python 并喜欢它.我主要在 Mac 和 Linux 上工作.当我使用 apt-get 安装 python 模块时,我发现在 Linux(主要是 Ubuntu 9.04)上它工作正常.我可以毫无问题地导入它.

                  I'm starting to learn python and loving it. I work on a Mac mainly as well as Linux. I'm finding that on Linux (Ubuntu 9.04 mostly) when I install a python module using apt-get it works fine. I can import it with no trouble.

                  在 Mac 上,我习惯于使用 Macports 来安装所有 Unixy 的东西.但是,我发现我安装的大多数 python 模块都没有被 python 看到.我花了一些时间玩 PATH 设置和使用 python_select .没有什么真正起作用,在这一点上我还没有真正理解,我只是在闲逛.

                  On the Mac, I'm used to using Macports to install all the Unixy stuff. However, I'm finding that most of the python modules I install with it are not being seen by python. I've spent some time playing around with PATH settings and using python_select . Nothing has really worked and at this point I'm not really understanding, instead I'm just poking around.

                  我的印象是 Macports 在管理 python 模块方面并不普遍.我想使用更被接受"(如果这是正确的话)的方法重新开始.

                  I get the impression that Macports isn't universally loved for managing python modules. I'd like to start fresh using a more "accepted" (if that's the right word) approach.

                  那么,我想知道,Mac python 开发人员使用什么方法来管理他们的模块?

                  额外问题:

                  你用的是苹果的python,还是其他版本?你是从源代码编译所有东西,还是有一个运行良好的包管理器(Fink?).

                  Do you use Apple's python, or some other version? Do you compile everything from source or is there a package manger that works well (Fink?).

                  推荐答案

                  最流行的管理 python 包的方法(如果你没有使用系统包管理器)是使用 setuptools 和 easy_install.它可能已经安装在您的系统上.像这样使用它:

                  The most popular way to manage python packages (if you're not using your system package manager) is to use setuptools and easy_install. It is probably already installed on your system. Use it like this:

                  easy_install django
                  

                  easy_install 使用 Python 包索引,这对于 python 开发人员来说是一个了不起的资源.看看周围有哪些可用的软件包.

                  easy_install uses the Python Package Index which is an amazing resource for python developers. Have a look around to see what packages are available.

                  更好的选择是 pip,因为它试图 修复很多与easy_install相关的问题.Pip 使用与 easy_install 相同的软件包存储库,它只是工作得更好.真正需要使用 easy_install 的唯一时间是这个命令:

                  A better option is pip, which is gaining traction, as it attempts to fix a lot of the problems associated with easy_install. Pip uses the same package repository as easy_install, it just works better. Really the only time use need to use easy_install is for this command:

                  easy_install pip
                  

                  之后,使用:

                  pip install django
                  

                  在某些时候,您可能想了解一点 virtualenv.如果你在包需求冲突的项目上进行大量 python 开发,virtualenv 是天赐之物.它将允许您拥有各种包的完全不同版本,并根据您的需要在它们之间轻松切换.

                  At some point you will probably want to learn a bit about virtualenv. If you do a lot of python development on projects with conflicting package requirements, virtualenv is a godsend. It will allow you to have completely different versions of various packages, and switch between them easily depending your needs.

                  关于使用哪个 python,坚持使用 Apple 的 python 将不会让您头疼,但如果您需要更新的版本(我相信 Leopard 是 2.5.1),我会选择 macports python 2.6.

                  Regarding which python to use, sticking with Apple's python will give you the least headaches, but If you need a newer version (Leopard is 2.5.1 I believe), I would go with the macports python 2.6.

                  这篇关于在 Mac 上安装 python 模块最兼容的方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:将版本嵌入 Python 包的标准方法? 下一篇:在 Cython 中制作可执行文件

                  相关文章

                  最新文章

                      <bdo id='itcZf'></bdo><ul id='itcZf'></ul>

                    <small id='itcZf'></small><noframes id='itcZf'>

                    1. <tfoot id='itcZf'></tfoot>
                      <i id='itcZf'><tr id='itcZf'><dt id='itcZf'><q id='itcZf'><span id='itcZf'><b id='itcZf'><form id='itcZf'><ins id='itcZf'></ins><ul id='itcZf'></ul><sub id='itcZf'></sub></form><legend id='itcZf'></legend><bdo id='itcZf'><pre id='itcZf'><center id='itcZf'></center></pre></bdo></b><th id='itcZf'></th></span></q></dt></tr></i><div id='itcZf'><tfoot id='itcZf'></tfoot><dl id='itcZf'><fieldset id='itcZf'></fieldset></dl></div>
                    2. <legend id='itcZf'><style id='itcZf'><dir id='itcZf'><q id='itcZf'></q></dir></style></legend>