setuptools: "No module named version"

1 view
Skip to first unread message

Gary Pajer

unread,
May 26, 2016, 11:56:45 AM5/26/16
to anac...@continuum.io
I'm trying to install a third-party (i.e., no conda  installation script exists AFAICT)

python setup.py build  

fails with "No module named version"

and in fact, "import setuptools" from the command line generates this:

ImportError                               Traceback (most recent call last)
<ipython-input-2-b6e7bae96787> in <module>()
----> 1 import setuptools
/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools/__init__.py in <module>()
      9 from fnmatch import fnmatchcase
     10
---> 11 import setuptools.version
     12 from setuptools.extension import Extension
     13 from setuptools.dist import Distribution, Feature, _get_unpatched

ImportError: No module named version


Here's what "conda search setuptools" reports:

                          *  21.2.1                   py27_0  defaults    


What's up with that?  Is this a conda issue?  The package I'm installing is about three years old ... could that be a problem?



~-~-~

Chris Barker

unread,
May 26, 2016, 12:55:32 PM5/26/16
to anaconda
On Thu, May 26, 2016 at 8:56 AM, Gary Pajer <gary....@gmail.com> wrote:
and in fact, "import setuptools" from the command line generates this:

ImportError                               Traceback (most recent call last)
<ipython-input-2-b6e7bae96787> in <module>()
----> 1 import setuptools
/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools/__init__.py in <module>()
      9 from fnmatch import fnmatchcase
     10
---> 11 import setuptools.version
     12 from setuptools.extension import Extension
     13 from setuptools.dist import Distribution, Feature, _get_unpatched

ImportError: No module named version

OK, that's weird.

Did you install setuptools with conda? what version is it? you probably  want the latest:

$ conda upgrade setuptools


Here's what "conda search setuptools" reports:

                          *  21.2.1                   py27_0  defaults    

that's almost the latest (I just got 21.2.2) -- but if you can't import setuptools, then something is hosed in your install. I"d try an upgrade and run it again.

 
What's up with that?  Is this a conda issue?  The package I'm installing is about three years old ... could that be a problem?

that could -- I suspect you may have to tweak the setup.py, but you'll need to get setuptools importable first!

-CHB



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

GaryP

unread,
May 26, 2016, 1:58:21 PM5/26/16
to Anaconda - Public


On Thursday, May 26, 2016 at 12:55:32 PM UTC-4, Chris Barker wrote:


On Thu, May 26, 2016 at 8:56 AM, Gary Pajer <gary....@gmail.com> wrote:
and in fact, "import setuptools" from the command line generates this:

ImportError                               Traceback (most recent call last)
<ipython-input-2-b6e7bae96787> in <module>()
----> 1 import setuptools
/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools/__init__.py in <module>()
      9 from fnmatch import fnmatchcase
     10
---> 11 import setuptools.version
     12 from setuptools.extension import Extension
     13 from setuptools.dist import Distribution, Feature, _get_unpatched

ImportError: No module named version

OK, that's weird.

Did you install setuptools with conda? what version is it? you probably  want the latest:

$ conda upgrade setuptools


Here's what "conda search setuptools" reports:

                          *  21.2.1                   py27_0  defaults    

that's almost the latest (I just got 21.2.2) -- but if you can't import setuptools, then something is hosed in your install. I"d try an upgrade and run it again.


That's the latest available to me.
I also tried "conda install -f setuptools"

GaryP

unread,
May 27, 2016, 10:28:21 AM5/27/16
to Anaconda - Public


On Thursday, May 26, 2016 at 11:56:45 AM UTC-4, GaryP wrote:
I'm trying to install a third-party (i.e., no conda  installation script exists AFAICT)

python setup.py build  

fails with "No module named version"

and in fact, "import setuptools" from the command line generates this:

ImportError                               Traceback (most recent call last)
<ipython-input-2-b6e7bae96787> in <module>()
----> 1 import setuptools
/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools/__init__.py in <module>()
      9 from fnmatch import fnmatchcase
     10
---> 11 import setuptools.version
     12 from setuptools.extension import Extension
     13 from setuptools.dist import Distribution, Feature, _get_unpatched

ImportError: No module named version


Any idea if this is a conda issue or a setuptools issue?    Google doesn't have much to say about this ... is there a place to ask the setuptools people?

Gary Pajer

unread,
May 27, 2016, 11:03:21 AM5/27/16
to anac...@continuum.io
On Fri, May 27, 2016 at 10:28 AM, GaryP <gary....@gmail.com> wrote:


On Thursday, May 26, 2016 at 11:56:45 AM UTC-4, GaryP wrote:
I'm trying to install a third-party (i.e., no conda  installation script exists AFAICT)

python setup.py build  

fails with "No module named version"

and in fact, "import setuptools" from the command line generates this:

ImportError                               Traceback (most recent call last)
<ipython-input-2-b6e7bae96787> in <module>()
----> 1 import setuptools
/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools/__init__.py in <module>()
      9 from fnmatch import fnmatchcase
     10
---> 11 import setuptools.version
     12 from setuptools.extension import Extension
     13 from setuptools.dist import Distribution, Feature, _get_unpatched

ImportError: No module named version


Any idea if this is a conda issue or a setuptools issue?    Google doesn't have much to say about this ... is there a place to ask the setuptools people?


should there not be a file  .../anaconda/lib/python2.7/site-packages/setuptools/version.py  ??

There is no such file

 

 


Here's what "conda search setuptools" reports:

                          *  21.2.1                   py27_0  defaults    


What's up with that?  Is this a conda issue?  The package I'm installing is about three years old ... could that be a problem?



~-~-~

--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+u...@continuum.io.
To post to this group, send email to anac...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/anaconda/.

Ilan Schnell

unread,
May 27, 2016, 11:18:31 AM5/27/16
to Anaconda
Setuptools is packages as an egg, ie. a zipfile whos path is added to sys.path, so there is no file "lib/python2.7/site-packages/setuptools/version.py".

- Ilan

Gary Pajer

unread,
May 27, 2016, 11:32:14 AM5/27/16
to anac...@continuum.io
On Fri, May 27, 2016 at 11:18 AM, Ilan Schnell <il...@continuum.io> wrote:
Setuptools is packages as an egg, ie. a zipfile whos path is added to sys.path, so there is no file "lib/python2.7/site-packages/setuptools/version.py".


Ok ... there is a version.py in the egg.   Why might it not be found?

Ilan Schnell

unread,
May 27, 2016, 12:04:55 PM5/27/16
to Anaconda
Setuptools is probably getting imported from somewhere else.
Have you looked at sys.path?

- Ilan

Gary Pajer

unread,
May 27, 2016, 12:33:07 PM5/27/16
to anac...@continuum.io
On Fri, May 27, 2016 at 12:04 PM, Ilan Schnell <il...@continuum.io> wrote:
Setuptools is probably getting imported from somewhere else.
Have you looked at sys.path?

Thanks.  Nothing in there except anaconda.   

I do note this:  in .../site-packages I have

setuptools-0.6c11-py2.7.egg-info
setuptools-21.2.1-py2.7.egg

Could that 0.6  egg-info file be the problem?   I temporarily moved it, but then I got an error "No module named extern"

Gary Pajer

unread,
May 27, 2016, 12:43:52 PM5/27/16
to anac...@continuum.io
On Fri, May 27, 2016 at 12:33 PM, Gary Pajer <gary....@gmail.com> wrote:


On Fri, May 27, 2016 at 12:04 PM, Ilan Schnell <il...@continuum.io> wrote:
Setuptools is probably getting imported from somewhere else.
Have you looked at sys.path?

Thanks.  Nothing in there except anaconda.   

I do note this:  in .../site-packages I have

setuptools-0.6c11-py2.7.egg-info
setuptools-21.2.1-py2.7.egg

Could that 0.6  egg-info file be the problem?   I temporarily moved it, but then I got an error "No module named extern"

"No module named extern" is not reproducible.    Don't know what I did there.  No change when I remove that file.  Same error "No module named version"

GaryP

unread,
May 27, 2016, 1:14:12 PM5/27/16
to Anaconda - Public


On Friday, May 27, 2016 at 12:43:52 PM UTC-4, GaryP wrote:

On Fri, May 27, 2016 at 12:33 PM, Gary Pajer <gary....@gmail.com> wrote:


On Fri, May 27, 2016 at 12:04 PM, Ilan Schnell <il...@continuum.io> wrote:
Setuptools is probably getting imported from somewhere else.
Have you looked at sys.path?

Thanks.  Nothing in there except anaconda.   

I do note this:  in .../site-packages I have

setuptools-0.6c11-py2.7.egg-info
setuptools-21.2.1-py2.7.egg

Could that 0.6  egg-info file be the problem?   I temporarily moved it, but then I got an error "No module named extern"

"No module named extern" is not reproducible.    Don't know what I did there.  No change when I remove that file.  Same error "No module named version"

I wanted to try to remove setuptools and re-install it.   I did "conda remove setuptools" and "conda uninstall setuptools" in case they are different.  But I still have a setuptools directory and a setuptools egg.   I then tried "conda clean --packages", but still that directory and egg remain.   I renamed them to get them out of the way, then did "conda install setuptools"

Result:  (You can see for sure where it's looking)

>>> import setuptools


Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools-21.2.1-py2.7.egg/setuptools/__init__.py", line 11, in <module>

     File "/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools-21.2.1-py2.7.egg/setuptools/extern/__init__.py", line 1, in <module>

   #

ImportError: No module named extern




 
 



 


- Ilan


 


- Ilan



To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+unsubscribe@continuum.io.

To post to this group, send email to anac...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/anaconda/.

--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+unsubscribe@continuum.io.

To post to this group, send email to anac...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/anaconda/.

--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+unsubscribe@continuum.io.

To post to this group, send email to anac...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/anaconda/.

--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+unsubscribe@continuum.io.

To post to this group, send email to anac...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/anaconda/.

--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+unsubscribe@continuum.io.

GaryP

unread,
May 27, 2016, 1:31:32 PM5/27/16
to Anaconda - Public


On Friday, May 27, 2016 at 1:14:12 PM UTC-4, GaryP wrote:


On Friday, May 27, 2016 at 12:43:52 PM UTC-4, GaryP wrote:

On Fri, May 27, 2016 at 12:33 PM, Gary Pajer <gary....@gmail.com> wrote:


On Fri, May 27, 2016 at 12:04 PM, Ilan Schnell <il...@continuum.io> wrote:
Setuptools is probably getting imported from somewhere else.
Have you looked at sys.path?

Thanks.  Nothing in there except anaconda.   

I do note this:  in .../site-packages I have

setuptools-0.6c11-py2.7.egg-info
setuptools-21.2.1-py2.7.egg

Could that 0.6  egg-info file be the problem?   I temporarily moved it, but then I got an error "No module named extern"

"No module named extern" is not reproducible.    Don't know what I did there.  No change when I remove that file.  Same error "No module named version"

I wanted to try to remove setuptools and re-install it.   I did "conda remove setuptools" and "conda uninstall setuptools" in case they are different.  But I still have a setuptools directory and a setuptools egg.   I then tried "conda clean --packages", but still that directory and egg remain.   I renamed them to get them out of the way, then did "conda install setuptools"

Result:  (You can see for sure where it's looking)

>>> import setuptools


Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools-21.2.1-py2.7.egg/setuptools/__init__.py", line 11, in <module>

     File "/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools-21.2.1-py2.7.egg/setuptools/extern/__init__.py", line 1, in <module>

   #

ImportError: No module named extern



Sorry for the stream of consciousness.  

If I rename the directory .../site-packages/setuptools  then the egg is searched with the result above.

If I rename the egg instead (or have both there at the same time) the directory is searched:
/Users/gpajer/anaconda/lib/python2.7/site-packages/setuptools/__init__.py in <module>()
and setuptools.version is not found.

What is supposed to happen?  What *should* be searched?  

I'd like to definitively remove all traces of setuptools and reinstall.     I'm not convinced that what I've tried in that respect has actually removed everything.  How can I make sure that all traces of setuptools is gone?

I'm thinking that I might have to trash ~/anaconda and start fresh.

Chris Barker

unread,
May 27, 2016, 5:10:15 PM5/27/16
to anaconda
On Fri, May 27, 2016 at 10:31 AM, GaryP <gary....@gmail.com> wrote:
I'd like to definitively remove all traces of setuptools and reinstall.     I'm not convinced that what I've tried in that respect has actually removed everything.  How can I make sure that all traces of setuptools is gone?

remove anyting with setuptool in the name in site-packages

edit:

site-packages/easy-install.pth

and remove all references there, too.

I'm thinking that I might have to trash ~/anaconda and start fresh.

That's a fine option -- the whole point of Anaconda is that it's easy to setup up a bunch of stuff -- so why mess around?

-CHB


 

Ian Stokes Rees

unread,
May 28, 2016, 12:27:39 AM5/28/16
to anac...@continuum.io

On 5/27/16 5:09 PM, Chris Barker wrote:


I'm thinking that I might have to trash ~/anaconda and start fresh.

Before you do that, I would suggest trying the following:

 conda create -n ana_clean anaconda=4.0 python=2.7
source activate ana_clean
python setup.py build

and see if that rectifies the situation — this will allow you to try building the package in question in a “clean” conda environment that consists exclusively of the virgin Anaconda 4.0 packages (Python 2.7 variant).

If that doesn’t do it for you, read on …


That's a fine option -- the whole point of Anaconda is that it's easy to setup up a bunch of stuff -- so why mess around?

An option “just to test” would be to install Anaconda in another location, check your path to make sure you’re only referring to that location, and then see if the problem persists (in theory this should be identical to the first strategy I suggested, of creating a virgin Anaconda 4.0 environment)

Before deleting your current Anaconda install, you can always do a conda list -e > root_env_snapshot.txt in your root environment (and in any named environments) to snapshot the list of packages and their versions. While it doesn’t guarantee an exact reproduction (e.g. because you may have used pip to install some things), but it should be pretty good. Then after you’ve reinstalled Anaconda you can re-create those with a conda install --file /path/to/environment/snapshot.txt.

Ian

Reply all
Reply to author
Forward
0 new messages