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
Post install package for every virtualenv created #56
Comments
There are |
Thanks for reply. I've setup them but i think something else is missing or i'm doing something wrong. The setup i done is:
However when i create a virtualenv i get the expected error
Any idea what am i missing? I've looked up at your test and i can't see how your tests succeed.
Have you loaded any other plugin apart from default Cheers, |
Here's an example. % mkdir -p "$(pyenv root)/pyenv.d/virtualenv"
% cat <<EOS > "$(pyenv root)/pyenv.d/virtualenv/after.bash"
after_virtualenv 'echo after: Dani'
EOS
% pyenv virtualenv foo
Ignoring indexes: https://pypi.python.org/simple/
Requirement already satisfied (use --upgrade to upgrade): setuptools in /home/yyuu/.pyenv/versions/foo/lib/python3.4/site-packages
Requirement already satisfied (use --upgrade to upgrade): pip in /home/yyuu/.pyenv/versions/foo/lib/python3.4/site-packages
Cleaning up...
after: Dani |
Okay however in this case the notes are not up to date, correct? Because i set it up for step 6).
|
Umm. Sorry for complication. By default, I don't think it's outdated. But complicated :( |
Fyi i confirm following your suggestion everything works as expected. Many thanks! P.S - will be good if we can can make the notes a bit more clear |
@DanyC97 I'd also like to install a standard set of packages in new virtualenvs. Any chance you could post your hook file? I'm having issues getting it to work (specifically, how do I reference pip in the newly created virtualenv from the script?). Cheers. |
I am trying to do the same thing. Doing an |
@robcowie @nayefc Are you looking for something similar to |
I'm unfamiliar with that project but it certainly looks like what I want. If you start the project, let me know. Cheers. |
@jawshooah Yup exactly. For example, I need pylint and Jedi and jediepcserver installed for each virtualenv and I was hoping to automate that as part of the pyenv mode hooks. |
Just forked |
@jawshooah That would be amazing please keep me posted! |
Boom. |
You're a legend. I'll give it a go shortly and report back. |
@jawshooah I'm trying to modify this to do it as I create a virtualenv, not when I install a version. I changed after_install to after_virtualenv but I still can't see the packages when I do pip freeze. Any ideas how to do such a modification? |
Ah, seems I misunderstood the problem. The plugin is meant to install default packages when you install a new Python version; I assumed that if you wanted default packages for virtualenvs, the simplest way to get them was to have default packages for the Python base. The reason |
Turns out |
@jawshooah That's fine I can do it myself. How do I create a plugin that runs after a virtualenv is created? I don't see where in your code you explicitly make an "after_install" package except for saying "after_install" in the bash script. |
Until I make the change upstream, you can just copy Edit: Sorry, change |
I created an issue for this on my repo if you'd like to continue the conversation over there. |
For those coming here from Google that want to install and/or upgrade packages after creation of a new virtualenv, you can do so as follows: Run the following commands:
In your newly opened editor add the following contents to after.bash:
And you're done! Now any time you create a new virtualenv, it will upgrade pip, setuptools and wheel and/or install them. |
Is it possible to have a post install hook so that every time a new virtualenv is created a package is installed too?
The use case is simple: i'd like - in the same way pip is installed - to have iPython installed automatically with every pyenv virtualenv created.
The text was updated successfully, but these errors were encountered: