Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setuptools nosetests command doesn't work within conda environment #873

Closed
anderspitman opened this issue Jan 19, 2015 · 8 comments
Closed

Comments

@anderspitman
Copy link

From within a conda environment, running the following command:

python setup.py nosetests

Gives this error:

error: invalid command 'nosetests'

Using my system python it seems to recognize the command, but I've been unable to get it to work within a conda environment. Nose is installed and I can run nosetests directly just fine, but setuptools integration isn't working.

@jszakmeister
Copy link
Contributor

Is this a Nose problem or a conda one? It seems like the latter to me as Nose works just fine outside that environment. What makes you think this is a Nose problem?

My apologies, but I don't really like to install random projects onto my machine--I find that it's often more complicated that folks admit to, and it does things to my machine that I don't want.

With that said, what are you hoping for with this bug report? Are you willing to look into the problem yourself and propose a patch? Are you hoping I'm going to install conda and debug the problem? I don't know what direction to take this. :-(

@anderspitman
Copy link
Author

Hey @jszakmeister, not expecting you to just fix this out of hand, so no worries. I suspect the problem may be somewhere in nose, since people have had similar issues with virtualenv, but it certainly may be some similarity between virtualenv and conda. I would be happy to help work on this, but I was hoping some of the nose people might have an idea what in the underlying architecture could possible cause this issue. Sounds like you're not aware of anything. I'll keeping poking around. Obviously feel free to close this if you're confident nose isn't the problem.

@jszakmeister
Copy link
Contributor

I'm not sure why other people have faced similar problems. All I can say is that I use this integration and it works under virtualenv. It could be some other thing getting in the way, but I've not had any issues with it. :-(

And yes, you are correct, I'm not sure what Nose would be doing that's causing that problem. Most of it is pretty standard distutils stuff.

@anderspitman
Copy link
Author

I tried using virtualenv and it works for me as well. No idea whats going on with conda, but I'll let you know if I find anything that might be useful.

@jszakmeister
Copy link
Contributor

No idea whats going on with conda, but I'll let you know if I find anything that might be useful.

Thanks! I hope you find the issue.

@mforbes
Copy link

mforbes commented Mar 7, 2015

Another solution is to replace the conda version of nose with the pip install:

conda remove nose
pip install nose

Somehow the conda install is not properly the entry point in setup.py:

...
        entry_points = {
        ...
        'distutils.commands': [
            ' nosetests = nose.commands:nosetests',
            ],
...

Not yet sure why.

P.S. It might also be a good idea to note in the documentation that one needs to use setuptools.setup rather than distutils.core.setup for this to work.

@mforbes
Copy link

mforbes commented Mar 7, 2015

I am not sure exactly what the issue is, but somehow the presence and contents of the file: lib/python2.7/site-packages/nose-1.3.4-py2.7.egg-info from the conda package breaks things. Removing this file and including instead the lib/python2.7/site-packages/nose-1.3.4.dist-info installed by pip fixes the problem. I have submitted a bug report to the conda maintainers.

MichaelTiemannOSC added a commit to MichaelTiemannOSC/uncertainties that referenced this issue Jul 11, 2023
Try running nosetests directly, rather than via setuptools, which trips up nose-1.3.7 for python >= 3.6.

See nose-devs/nose#873

Signed-off-by: Michael Tiemann <[email protected]>
@jtojnar
Copy link

jtojnar commented Aug 4, 2024

We have the same issue in Nixpkgs and I decided to work around it by creating the entry_points.txt manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants