Getting easy_install




















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.

The project will be placed in a subdirectory of the build directory. The subdirectory will have the same name as the project itself, but in all-lowercase. If a file or directory of that name already exists, EasyInstall will print an error message and exit. Also, when using --editable , you cannot use URLs or filenames as arguments. You must specify project names and optional version requirements so that EasyInstall knows what directory name s to create.

If you need to force EasyInstall to use a particular URL or filename, you should specify it as a --find-links item -f for short , and then also specify the project name, e. NOTE: As of 0. So, again, installing the newer version is the only upgrade step needed. If a package matching the requested name and version is not already installed in a directory on sys.

Uninstalling Packages If you have replaced a package with another version, then you can just delete the package s you don't need by deleting the PackageName-versioninfo. After you've done this, you can safely delete the. Asked 10 years ago. Active 1 month ago. Viewed k times. Here is the specific error: Traceback most recent call last : File "C Improve this question.

Ubuntu with File C:? On Ubuntu, there is also sudo apt install python3-setuptools — Serge Stroobandt. Add a comment. Active Oldest Votes. Improve this answer.

Anusha Rao Anusha Rao 6 6 silver badges 3 3 bronze badges. I wish it was but this version is so old things will not install properly like Buildout. After doing this, another install which depends on setuptools still tells me that setuptools isn't installed! For python3 on Ubuntu sudo apt-get install python3-setuptools. Ahmad Yoosofan Ahmad Yoosofan 12 12 silver badges 21 21 bronze badges. Wellington Wellington 1 1 gold badge 2 2 silver badges 17 17 bronze badges.

And see other links to help with pip install: makeuseof. Ryabchenko Alexander 6, 3 3 gold badges 44 44 silver badges 66 66 bronze badges. Boschko Boschko 5 5 silver badges 13 13 bronze badges. Let me know if you need more help.



0コメント

  • 1000 / 1000