Knowledge Base/Canopy/Introduction to Canopy & FAQs

Installing packages into Canopy User Python from the OS command line

Jonathan March
posted this on March 19, 2013, 13:49

(updated October 23, 2014 )

You can install additional packages (either external or from the Canopy / EPD repository) into Canopy User Python in a Windows command prompt window or Mac/Linux terminal window.

The key point is that you must install into the Canopy User Python environment, not into Canopy's Core or System Python environments. 

1. Be sure that you have updated to Canopy 1.2 or higher (using the Canopy help menu). We recommend using the latest available version.

2. Ensure that Canopy User Python is on the shell PATH, i.e. that typing `python` at the prompt starts Canopy User Python, not another python.

The easiest way to ensure this is to work in a Canopy Command Prompt (Windows) or a Canopy Terminal (Mac or Linux), available from the Canopy Tools menu in Canopy 1.4 and above.

Otherwise, see this article for details on setting PATH, and see this article for more information about the difference between Canopy User Python and other Canopy Pythons, which you should not use directly.

3. If you are using Canopy 1.3 in Windows, please update to Canopy 1.4 or higher.

Otherwise, you will need to begin with the following command, in a Canopy Command Prompt opened from the Canopy Tools menu:

pip install --upgrade setuptools

4. To install a package which is not available in the Canopy / EPD repository, follow standard Python installation procedures from the OS command line.

Caution: Except as noted in (3) above, do not install setuptools in EPD or Canopy. Setuptools 0.6 is already supported, and higher versions are not yet compatible with Enthought installers. EPD / Canopy includes distribute 0.6.26, which simulates setuptools 0.6. If you install setuptools, then you will corrupt distribute and have problems. If you need to install a package which requires a version of setuptools greater than 0.6, please email us at support@enthought.com, explaining your needs and we will provide a solution if feasible. We will soon be building a new version of distribute which provides the necessary functionality.

5.  If you are not installing a new package, but updating one that is already in Canopy to a version that is not yet available in our repository, please note this article.

6. With the PATH set as just described, you may also use the EPD/Canopy `enpkg` utility from the OS command line, in lieu of the Canopy package manager.

7. (Windows only) - binary package installers such as Chris Gohlke's work, provided that you have made Canopy your default Python from the Canopy preferences menu.

Packages installed using these non-Enthought installers will not be listed in the Package Manager, but they will be fully installed into, and usable in, Enthought Canopy User Python. We are reviewing options for listing them in the Package Manager in future versions of Canopy.

Listing both Canopy-installed and externally-installed packages

To see a list of all the packages installed by normal means into Canopy User Python, whether by Package Manager, enpkg, egginst, pip, or easy_install, you can type the following at a Canopy Command Prompt / Terminal:

pip list

Windows only: using binary package installers such as those by Chris Gohlke

1. Make Canopy your default Python from the Canopy preferences dialog (in the Canopy Edit menu). Note that it is not sufficient to modify your PATH, or open a Canopy Command Prompt window.

2. Find and download the installer version which matches your Canopy install (32/64-bits), and is the package version that you want.
For Chris Gohlke's installers, the download page is http://www.lfd.uci.edu/~gohlke/pythonlibs/

3. Run the downloaded installer.

4. You should now be able to use that package in Canopy. 

Please do not enter support requests in article comments

Please use article comments for suggestions to improve the article. For individual support requests, please follow these guidelines.

 

Comments

User photo
Michael Roberge

As a new user(free canopy express) I found it a little strange that external installed pkgs where are not tracked and listed as having been installed in the canopy pkg manager. I needed pyVISA and it didn't come with canopy express, although it was listed as being part of canopy. But when I asked the canopy pkg manager to install, it wanted me to subscribe(pay) for next level of canopy. So I installed manual and was able to access and use it from inside python canopy. But I was dissapointed that pyVISA wasn't listed in canopy pkg manager as having been installed. It would be nice it canopy manager would at least acknowledge that it was installed. I would even be willing to tell the canopy pkg manager what had been installed if it would track it in the future. 

October 14, 2013, 22:51
User photo
Brett Murphy

Thank you for the input Michael. An update to the package manager is on our short list of things to do for Canopy.

October 15, 2013, 08:48
User photo
Ming Mao
Barclays

Regarding the incompatibility with setuptools, is it still true with Canopy 1.3?

February 10, 2014, 12:38
User photo
Jonathan March
Enthought

@mingmao: The setuptools situation has not changed in Canopy 1.3. To be reiterate, the incompatibility is not with setuptools per se, but with versions of setuptools newer than 0.6. Setuptools 0.6 is effectively included (via distribute).

February 10, 2014, 12:47
User photo
Ming Mao
Barclays

@Jonathan, thanks for the reply.

 

And does canopy have any plans to solve the issue, i.e., support higher version of setuptools?

February 10, 2014, 12:51
User photo
Abinaya Manimaran

I want patsy module to be installed. I downloaded it from https://pypi.python.org/pypi/patsy.

when i try to run the setup.py i get this error.

Warning (from warnings module):
File "C:\Program Files\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\distutils\dist.py", line 267
warnings.warn(msg)
UserWarning: Unknown distribution option: 'install_requires' 

 

please provide me the detailed step to install patsy. its urgent. I use enthought canopy (Version: 1.3.0.1715 ) for win 32

March 3, 2014, 22:31
User photo
M Szenk

Community packages are freely available online- why do I have to pay $200 to upgrade to be able install them through the package manager?

March 4, 2014, 15:10
User photo
Jonathan March
Enthought

@mszenk. Virtually all packages in the Canopy repo (not just community packages) are free and open source. What a Basic subscriber is paying for is the huge amount of time that went into building and packaging them (and testing, in the case of the main repo). Please feel free to build any package yourself in Canopy Python as described in this article.

March 4, 2014, 17:35
User photo
Apostolos Vergos

Hi,

I am trying to install a package using pip and I was following the instructions here:

I have canopy 1.3 and sys.prefix returns c:\\users\\myname\\appdata\\local\\enthought\\canopy\\user which seems correct but when I run easy_install pip I get the following error: invalid command 'easy_install'

I deleted a previous installation of pythonxy (or at least everything I could find) so I think this is not causing the problem.

The following are in my Pathvariable:

c:\users\myname\appdata\local\enthought\canopy\user\scripts;
c:\users\myname\appdata\local\enthought\canopy\user\scripts;
C:\Users\myname\AppData\Local\Enthought\Canopy32\User\Scripts;
C:\Users\myname\AppData\Local\Enthought\Canopy\User;
C:\Users\myname\AppData\Local\Enthought\Canopy\User\Scripts

Can you please help,

Thanks

 

March 20, 2014, 11:54
User photo
Jonathan March
Enthought

@Apostolos - Sorry for the trouble; we are investigating.

March 20, 2014, 11:59
User photo
Apostolos Vergos

Thanks for the reply Jonathan, no trouble at all.

I have the same problem at my laptop with a fresh windows 7 installation. Enthought Canopy is the only Python distribution I have installed.

The paths in this case are:

c:\users\myname\appdata\local\enthought\canopy\user\scripts

C:\Users\myname\AppData\Local\Enthought\Canopy\User

C:\Users\myname\AppData\Local\Enthought\Canopy\User\Scripts

Also some more details that apply in both cases that might help:

  • I installed Canopy for all users and I am the administrator of the system.
  • I am using Windows 7 x64

Thanks

 

March 22, 2014, 12:52
User photo
M Szenk

Thought it worth mentioning that I am using the same setup and have the same issue as Apostolos.

March 23, 2014, 23:44
User photo
Jon Moore
Barclays

I also have this problem.  Please reach out if help is needed with reproduction or testing fixes.  

March 24, 2014, 12:08
User photo
Jonathan March
Enthought

@mszenk, @Apostolos, @Jon: following up by individual support tickets

March 26, 2014, 13:41
User photo
Jonathan March
Enthought

The workaround, until Canopy 1.4 is released, is (from a Canopy Command Prompt window) to begin with:

pip install --upgrade setuptools
March 29, 2014, 23:14
User photo
Siva Aduri
U Michigan

Hi Jonathan, Canopy command prompt doesn't seem to recognize the command. can help me. Thanks

April 1, 2014, 20:15
User photo
Erick Litswa

On windows i run the command in the following format pip-script.py install --upgrade setuptools and it worked for me

April 2, 2014, 05:10
User photo
Jonathan March
Enthought

@Siva: The "Canopy Command Prompt" does not mean the Python prompt within Canopy. Rather, it is a terminal window opened from the Windows Start Menu. Sorry for the confusion, clarifying article now.

April 2, 2014, 10:49
User photo
Siva Aduri
U Michigan

Thanks Jonathan and Eric appreciate it.

April 4, 2014, 12:30
User photo
Sérgio Rodrigues

This post helped me install pytagcloud. I was getting an error after 'pip install -U pytagcloud'. But as soon as I updated setuptools as this posted shown, I could get pip running like a charm.

April 7, 2014, 17:58
User photo
Liora Braunstain

Hi,

I am rather new to the whole wold of edp,

I have installed canopy 1.4 on my 64 bit windows machine,

When i try to install a package (sparsesvd to be exact) with the following comnmand:

in C:\Users\liorab\AppData\Local\Enthought\Canopy\User\Scripts pip install -U sparsesvd , 

I get the error that he can't find the Microsoft visual studio,

Yet I have installed mingw and it is on my PATH variable.

Yet two weeks before i installed other packages that worked fine (numpy, gensim...)

Does someone know how to solve this?

 

Thank you!

July 24, 2014, 09:04
User photo
Jonathan March
Enthought

Hi Liora, Your question is an excellent one but is a general python build question (a huge subject), and as such is outside the scope of this article, which is about how to ensure that Canopy is set up so that you can do installations/builds. A question on Stack Overflow (tagged python and enthought) might be productive. I will add, though, that building C-based packages in Windows can be tricky. As a general rule, since CPythons 2.x (including Canopy Python) on Windows are usually build with Visual C++ 2008, then C-based packages should also be built with Visual C++ 2008. This related article may also help: https://support.enthought.com/entries/26864394-Windows-Unable-to-fi... . BTW, presumably you did not need to build numpy in Canopy, since Canopy provides numpy pre-built, so that installing it in Canopy is as simple as using the Package Manager or the enpkg utility to install from the already-built numpy "egg" file provided.

July 24, 2014, 09:55
User photo
Jonathan March
Enthought

Brief new section in article "Listing both Canopy-installed and externally-installed packages"

October 23, 2014, 13:43
User photo
Bennett Brown
Project Lead the Way

Open a Canopy Command prompt by selecting Tools>Canopy Command Prompt. At the prompt, cd to the directory containing the package to install. Use `pip help` to familiarize yourself with pip. Use `pip freeze` to list all packages. Use `pip install packagename` to install packages. (The packages thus installed might not be reflected in the Package Manager, noting Enthought is working on enhancing that in an upcoming release.)

November 8, 2014, 23:22
User photo
Chris Spidle

"follow standard Python installation procedures from the OS command line"

Where are these???  The FAQ's are sending me in an infinite loop.

February 5, 2015, 17:23
User photo
Jonathan March
Enthought

@Chris,  We assume that anyone who wishes to install a 3rd party package has access to the corresponding installation instructions. By far the most common technique is "pip install package_name", but it really depends on the instructions provided for a particular package (Python packaging is still something of a Wild West). If you have particular questions about how to install a particular package, please ask a question on Stack Overflow, as described at the end of this article (or for paid subscribers, submit a support ticket to us.)

February 7, 2015, 18:18