Python package install using pip or easy_install from repos

后端 未结 4 871
深忆病人
深忆病人 2020-12-23 08:46

The simplest way to deal with python package installations, so far, to me, has been to check out the source from the source control system and then add a symbolic link in th

4条回答
  •  温柔的废话
    2020-12-23 09:07

    If you download or check out the source distribution of a package — the one that has its "setup.py" inside of it — then if the package is based on the "setuptools" (which also power easy_install), you can move into that directory and say:

    $ python setup.py develop
    

    and it will create the right symlinks in dist-packages so that the .py files in the source distribution are the ones that get imported, rather than copies installed separately (which is what "setup.py install" would do — create separate copies that don't change immediately when you edit the source code to try a change).

    As the other response indicates, you should try reading the "setuptools" documentation to learn more. "setup.py develop" is a really useful feature! Try using it in combination with a virtualenv, and you can "setup.py develop" painlessly and without messing up your system-wide Python with packages you are only developing on temporarily:

    http://pypi.python.org/pypi/virtualenv
    

提交回复
热议问题