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

How to use my project's virtualenv? #172

Closed
Cheukyin opened this issue Aug 7, 2014 · 6 comments
Closed

How to use my project's virtualenv? #172

Cheukyin opened this issue Aug 7, 2014 · 6 comments

Comments

@Cheukyin
Copy link

Cheukyin commented Aug 7, 2014

Jedi by default uses the virtualenv in .emacs/
But what should I do if I want to use the virtualenv of my project instead of the default one?

@syohex
Copy link
Collaborator

syohex commented Aug 8, 2014

You can do it by setting jedi:environment-root or python-environment-directory.

Please see those docstrings

@Cheukyin
Copy link
Author

Cheukyin commented Aug 8, 2014

Setting the variables mentioned above needs to write in my configuration file.

It takes a lot of trouble. Because I have several virtualenvs for each project.

Is there a convenient way to switch the virtualenv on the fly?

@syohex
Copy link
Collaborator

syohex commented Aug 9, 2014

How about pyvenv.el or virtualenvwrapper.el ?

Sorry I don't know python programming well.

@Cheukyin
Copy link
Author

Cheukyin commented Aug 9, 2014

I still have no idea how to implement it

But I seem to have grasped something after reading the docs of virtualenvwrapper

Maybe I should begin to learn some basic elisp
then I can read the source code ,
and know how to make the plugins work together

Thanks anyway

@Cheukyin
Copy link
Author

Cheukyin commented Aug 9, 2014

OK, I find a solution

Use the virtualenvwrapper.el and M-x pyvenv-workon to switch the virtualenv,
then jedi:stop-server to restart jedi.

It works!

@syohex syohex closed this as completed Aug 10, 2014
@psihonavt
Copy link

@Cheukyin
Can you show your configuration for jedi? I faced with the same problem as you - #178
activating venv -> stopping jedi server (even killing it through kill -9) did not help jedi to recognize site packages from my project's venv.

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

3 participants