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

Support multiple versions of python #399

Closed
anuraguniyal opened this issue Sep 22, 2017 · 5 comments
Closed

Support multiple versions of python #399

anuraguniyal opened this issue Sep 22, 2017 · 5 comments

Comments

@anuraguniyal
Copy link

How can I use a multiple topologies some of which use python2 and some python3. Easiest way I can think is that "virtualenv" command should be configurable so user can point it to correct path.

Also python3 doesn't have virtualenv command, so it would also help there if I can just say
"virtualenv": "python3 -m venv" in config

@anuraguniyal
Copy link
Author

Any updates on this, ability to set virtualenv command would be great.

@dan-blanchard
Copy link
Member

Currently there is no support for doing this. I would welcome a PR to add virtualenv command customization but that would be per config file and not per topology.

Figuring this out on a per topology basis is high on my list of priorities right now because I also need this functionality. I would also love to extend it to address #183 as well, but we'll see if I can do that on the first pass.

All that said, you can currently specify the path to the Python interpreter you want to use in your config file as shown here with the -p virtualenv flag. It works fine with Python 3 even without changing the command to use venv.

@codywilbourn
Copy link
Contributor

codywilbourn commented Oct 12, 2017

@anuraguniyal We merged a change into master that will be in the next release. You can override the virtualenv_flags in topology configs or via command line options to specify the version of python used during virtualenv creation. If the virtualenv name already exists on the machines you should delete it prior to deploying with this new setting.

class WordCount(Topology):
    # WordCount only will use python3, everything else will use virtualenv_flags in config.json
    config = {"virtualenv_flags": "-p /path/to/python3"}

@anuraguniyal
Copy link
Author

cool thanks.

@codywilbourn
Copy link
Contributor

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

No branches or pull requests

3 participants