-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
Error - no module named virtualenv #360
Comments
Original comment by @hpk42 What happens if we just make Right now, tox kind of hard-depends on virtualenv and i think it's cleanest to express this. At the sprint in June we had talks about supporting venv and conda but it's some work obviously. |
It doesn't matter if the requirement comes as a test requirement or a dependency on a test requirement - it will only be available in the immediate Python environment and not any subprocesses. The same thing would happen to tox if somehow tox were to try to invoke tox through a subprocess. I'd like to avoid package maintainers having to communicate to their users that "tox" will install automatically but virtualenv needs to be more permanently installed. The more I think about this issue, though, the more I think it shouldn't be a tox issue. I'm going to opt for (3) for the near term and (6) in the long term (especially if pypa/pip#3971 lands). |
@hpk42 Note that, as documented in #330, setup(
# ...
tests_require=['tox', 'virtualenv']) |
Indeed, my report is a duplicate of #330. I've got a fix committed to setuptools and slated for a v27.3.0 release. |
As #330 has been closed with not recommending to use tox within "setup.py test" anymore, we can close this issue here as well. |
When using the advertised setuptools integration on a clean operating system that doesn't already have virtualenv installed, the tox run will fail when it attempts to invoke virtualenv:
I think the issue is obvious - tox is launching a subprocess to invoke virtualenv, but since virtualenv was loaded dynamically by the setuptools distutils command
test
, the subprocess doesn't have that library.I've worked around this issue in the past (when using pytest-runner to test libraries whose test suite would launch subprocesses) by adding all of the items in
sys.path
to the environment variable PYTHONPATH when launching the subprocess.I think there are a few options to address this issue.
test
commands, avoiding these issues in the general case.test
command.There may be other options as well. I've listed these approaches in order by my preference.
What are the thoughts and preferences of the tox maintainers?
The text was updated successfully, but these errors were encountered: