You are not logged in.

#1 2012-06-20 05:49:57

jlight2011
Member
From: Melbourne
Registered: 2011-06-15
Posts: 51

[SOLVED] Unable to import setuptools in Python2

Hi All
I am trying to install the python module 'openpyxl', I have successfully installed the version for Python 3.

However when I try building the version for Python 2. I get the error

$python2 setup.py build
Traceback (most recent call last):
  File "setup.py", line 22, in <module>
    from setuptools import setup, Extension, find_packages
ImportError: No module named setuptools

When I am in Python 3 running the following does not give any error

$ python
Python 3.2.3 (default, Apr 23 2012, 23:14:44) 
[GCC 4.7.0 20120414 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> 

However in Python 2 it fails

$ python2
Python 2.7.3 (default, Apr 24 2012, 00:00:54) 
[GCC 4.7.0 20120414 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named setuptools
>>> 

I have the package python-distribute installed. I have checked the package it is a split package for python 2 and 3. Any suggestion on how to overcome this?

Regards

J

Last edited by jlight2011 (2012-09-26 01:40:33)

Offline

#2 2012-06-20 06:40:29

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 716

Re: [SOLVED] Unable to import setuptools in Python2

pacman -S python2-distribute ( note the python2 )
Also use either PIP or the AUR/pacman for python packages instead of a  setup.py build

Offline

Board footer

Powered by FluxBB