Instead use pip. If you think you need Easy Install, please reach out to the PyPA team a ticket to pip or setuptools is fine , describing your use-case. Please share your experiences with us! If you encounter difficulty installing a package, please contact us via the distutils mailing list. The mailing list is a searchable archive of previously-asked and answered questions; you should begin your research there before reporting something as a bug — and then do so via list discussion first.
Please see the setuptools PyPI page for download links and basic installation instructions for each of the supported platforms. You will need at least Python 3. If this is not the case, you should consult the section below on Custom Installation Locations before installing.
And, on Windows, you should not use the. If you are behind an NTLM-based firewall that prevents Python programs from accessing the net directly, you may wish to first install and use the APS proxy server , which lets you get past such firewalls in the same way that your web browser s do. Please see that section and follow the steps to make sure that your custom location will work correctly. Then re-install. Again, see the section on Custom Installation Locations for more details.
Example 1. Install a package by name, searching PyPI for the latest version, and automatically downloading, building, and installing it:. Example 2. Example 3. Download a source distribution from a specified URL, automatically building and installing it:. Example 5. Upgrade an already-installed package to the latest version listed on PyPI:. Example 6. Example 7. New in 0. See Editing and Viewing Source Packages below for more info.
In each case, it will attempt to locate the latest available version that meets your criteria. When downloading or processing downloaded files, Easy Install recognizes distutils source distribution files with extensions of. And of course it handles already-built. See Configuration Files , below. However, if you specify an installation directory via the command line or a config file, then the default directory for installing scripts will be the same as the package installation directory, to ensure that the script will have access to the installed package.
You can override this using the -s or --script-dir option. Installed packages are added to an easy-install. If you would like to be able to select which version to use at runtime, you should use the -m or --multi-version option. So, installing a newer version is the only step needed to upgrade such packages. So, again, installing the newer version is the only upgrade step needed.
Where 1. If a package matching the requested name and version is not already installed in a directory on sys. This will activate the latest installed version. If you want to delete the currently installed version of a package or all versions of a package , you should first run:. Whenever you install, upgrade, or change versions of a package, EasyInstall automatically installs the scripts for the selected package version, unless you tell it not to with -x or --exclude-scripts.
If any scripts in the script directory have the same name, they are overwritten. Thus, you do not normally need to manually delete scripts for older versions of a package, unless the newer version of the package does not include a script of the same name.
However, if you are completely uninstalling a package, you may wish to manually delete its scripts. If you want to keep multiple versions of a script available, however, you can simply use the --multi-version or -m option, and rename the scripts that EasyInstall creates.
This works because EasyInstall installs scripts as short code stubs that require the matching version of the package the script came from, so renaming the script has no effect on what it executes. For example, suppose you want to use two versions of the rst2html tool provided by the docutils package.
You might first install one version:. This will create another rst2html. You now have two scripts, each using a different version of the package. Regardless of the technique used, the script s will be installed to a Scripts directory by default in the Python installation directory.
During installation, pass command line options such as --script-dir to control where scripts will be installed. These small. This behavior is currently default.
EasyInstall also supports deferring to an external launcher such as pylauncher for launching scripts. EasyInstall will then install scripts as simple scripts with a. If these extensions are associated with the pylauncher and listed in the PATHEXT environment variable, these scripts can then be invoked simply and directly just like any other executable.
This behavior may become default in a future version. EasyInstall uses the. This distinct extension is necessary to prevent Python from treating the scripts as importable modules where name conflicts exist.
Current releases of pylauncher do not yet associate with. N , where N. N is the Python version used to install it. Thus, if you install EasyInstall for both Python 3. You can use the --allow-hosts -H option to restrict what domains EasyInstall will look for links and downloads on. You can also use wildcards, for example to restrict downloading to hosts in your own intranet.
See the section below on Command-Line Options for more details on the --allow-hosts option. By default, there are no host restrictions in effect, but you can change this default by editing the appropriate configuration files and adding:. The above example would then allow downloads only from hosts in the python.
For example:. This will tell EasyInstall to put zipped eggs or source packages for SomePackage and all its dependencies into somedir , without creating any scripts or. You can then copy the contents of somedir to the target machine. You can also build the eggs from local development packages that were installed with the setup. You can use EasyInstall to build eggs for a project. By placing them in a directory that is published to the web, you can then make the eggs available for download, either in an intranet or to the internet at large.
If someone distributes a package in the form of a single. So, something like this:. In addition to local directories and the Python Package Index, EasyInstall can find download links on most any web page whose URL is given to the -f --find-links option.
In the simplest case, you can simply have a web page with links to eggs or Python source packages, even an automatically generated directory listing such as the Apache web server provides.
If you are setting up an intranet site for package downloads, you may want to configure the target machines to use your download site by default, adding something like this to their configuration files :. As you can see, you can list multiple URLs separated by whitespace, continuing on multiple lines if necessary as long as the subsequent lines are indented.
If you are more ambitious, you can also create an entirely custom package index or PyPI mirror. Teams maintaining a private repository of packages may already have defined access credentials for uploading packages according to the distutils documentation.
Refer to the distutils documentation for Python 2. EasyInstall respects standard distutils Configuration Files , so you can use them to configure build options for packages that it installs from source. For example, if you are on Windows using the MinGW compiler, you can configure the default compiler by putting something like this:.
In fact, since this is just normal distutils configuration, it will affect any builds using that config file, not just ones done by EasyInstall. For example, if you add those lines to distutils. See Configuration Files below for a list of the standard configuration file locations, and links to more documentation on using distutils configuration files.
If you want to be able to examine these files, you can use the --editable option to EasyInstall, and EasyInstall will look for a source distribution or Subversion URL for the package, then download and extract it or check it out as a subdirectory of the --build-directory you specify. If you then wish to install the package after editing or configuring it, you can do so by rerunning EasyInstall with that directory as the target.
Note that using --editable stops EasyInstall from actually building or installing the package; it just finds, obtains, and possibly unpacks it for you. This allows you to make changes to the package if necessary, and to either install it in development mode using setup. In order to use --editable -e for short , you must also supply a --build-directory -b for short.
How do I get a python script to import the development version of a module I'm working on in my home directory when that module is also defined in a system-wide easy-install. What is a viable-work around for the way that the easy-install. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more.
Work around easy-install. Asked 3 years, 8 months ago. Active 3 years, 8 months ago. Viewed 3k times. Improve this question. Dave Dave 6, 5 5 gold badges 34 34 silver badges 68 68 bronze badges. Add a comment. Active Oldest Votes. Use the -S option and an fully explicit path. Improve this answer.
0コメント