Knowledge Base/Canopy/Introduction to Canopy

Installing packages into Canopy User Python from the OS command line

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

(updated April 2, 2014 )

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

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).

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. To check this, after you have started python from the OS command prompt / terminal window, type:

import sys
sys.prefix

 you should see a path which ends in something like "Canopy/User" (not "Canopy/System" or other paths).

Having confirmed this path, you can then exit from python and continue the installation from the OS command line.

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, you will need to begin with the following command, in a Canopy Command Prompt window, which can be opened from the Windows Start Menu (not the same as the Python command prompt inside of Canopy itself):

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) - starting with Canopy 1.0.3, binary package installers such as Chris Gohlke's work, provided that you have made Canopy your default Python as described in the article referenced in (2) above.

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.

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
Enthought

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 Capital

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 Capital

@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 03, 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 04, 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 04, 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 01, 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 02, 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 02, 2014 10:49
User photo
Siva Aduri
U Michigan

Thanks Jonathan and Eric appreciate it.

April 04, 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 07, 2014 17:58