Installing a package to Canopy

て烟熏妆下的殇ゞ 提交于 2019-12-07 14:18:08

问题


I'm really new to coding, programming, Python, and just computers in general, so I need some help with Canopy. I've been having pretty consistent troubles installing any packages to Canopy; some stuff is in the internal package manager,but whenever it isn't, it's really confusing. I guess I'll list a specific installation.

I'm trying to install "pywcs" (link provided below) to my Win7 64-bit machine. I have Cygwin if that helps at all. I do not know how to go about this; the stuff I found online is pretty confusing, and Cygwin easy_install (filename) never seems to work. Any step-by-step solutions?


回答1:


The way I installed astropy is as follows.

  1. Open Windows Terminal
  2. Change Directory to C:\Users\<USER NAME>\AppData\Local\Enthought\Canopy32\User\Scripts
  3. Type easy_install.exe astropy
  4. Wait until the download completes, and restart Enthought.




回答2:


sometimes installing packages can be hard for enthought canopy . You could install all python packages using pip install mrjob command on the its own canopy command prompt

  1. Go to tools tab on the canopy editor ,
  2. Left click on the canopy command prompt ,
  3. Finally pip install <package name> and hit Enter key



回答3:


The key point is that in order to install a package into any Python distribution (including Canopy Python), you should use that Python to perform the installation. You refer to Cygwin's "easy_install", but you should instead use Canopy's easy_install.

As described in this article, the easiest way to be sure that you are running Canopy's Python (and Canopy's easy_install) is to have Canopy Python on your PATH. This is done by default during Canopy installation, but if you uncheck this option then, or if your Cygwin installation doesn't use your Windows PATH, then you will need to adjust your Cygwin PATH accordingly.

Doing as Sukrit suggests, and running the installation from the Canopy Python Scripts directory, is also a reasonable approach.

Alternatively, depending on its compiler dependencies, you may be able to install astropy from a Windows Command Prompt rather than from Cygwin (of course Canopy must be on the PATH here too, as it would be by default.)




回答4:


In Linux you can do it as follows.

1) Make sure you are using the Canopy version of Python - check out https://support.enthought.com/entries/23389761-Installing-packages-into-Canopy-User-Python-from-the-command-line

2) At the command prompt use easy_install, for example:

$ easy_install pp==1.5.7 

to install version 1.5.7 of pp




回答5:


Just for information, Astropy is now included by default in Enthought Canopy:

https://www.enthought.com/products/canopy/package-index/



来源:https://stackoverflow.com/questions/17533094/installing-a-package-to-canopy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!