GithubHelp home page GithubHelp logo

Comments (22)

yyuu avatar yyuu commented on May 28, 2024

Have you try the shell version (pyenv shell)? Something might be remaining your environment variable of PYENV_VERSION.

from pyenv-virtualenv.

matthieugrieger avatar matthieugrieger commented on May 28, 2024

No, I haven't. I will make sure to try that when I get home.

from pyenv-virtualenv.

matthieugrieger avatar matthieugrieger commented on May 28, 2024

Finally got around to testing it out again. The problem seems to have fixed itself somehow.

Thanks anyway!

from pyenv-virtualenv.

j-bennet avatar j-bennet commented on May 28, 2024

I have the same issue on OS X after rm -rf ~/.pyenv/versions/{my-env-name}.

from pyenv-virtualenv.

blueyed avatar blueyed commented on May 28, 2024

@j-bennet
See a64f194 - there might be dirs installed.

Are you using the latest pyenv-virtualenv?
Can you provide a test case / steps to reproduce it?
Is the env used somewhere as a local or shell version?

The ~/.pyenv/versions/{my-env-name} typically nowadays will be a symlink only to the real version.

from pyenv-virtualenv.

j-bennet avatar j-bennet commented on May 28, 2024

Latest. The env was used as local for a dir. I do not have ~/pyenv/versions/{version}/envs directory. Searched for it, but no.

from pyenv-virtualenv.

blueyed avatar blueyed commented on May 28, 2024

So what are your symptoms regarding this issue?
What errors do you get and when?

If it happens on shell startup, you could try from an existing shell to run env PYENV_DEBUG=1 $SHELL, which would open a subshell, probably with debug info. Then you can see where the error is coming from (search the output).

If that does not help, try export PYENV_DEBUG=1 in an existing shell and then trigger it.

from pyenv-virtualenv.

blueyed avatar blueyed commented on May 28, 2024

Steps to reproduce this would be very useful, because then it could be fixed and added to the test suite.

from pyenv-virtualenv.

blueyed avatar blueyed commented on May 28, 2024

I've tried to reproduce it:

% pyenv virtualenv test-foo
% pyenv local test-foo
% rm -rf ~/.pyenv/versions/test-foo

I do not get any errors after that, also for a new shell in this dir, but pyenv version says pyenv: version \test-foo' is not installed ...`, and the same error happens when trying to run any command managed by pyenv.

That's the expected behaviour somehow: pyenv tries to load/use the version you specified, and errors out because it does not exist anymore. There is no way pyenv could or should update all your .python-version files.

If you see this during shell startup it might be cause by using python etc in your startup scripts (likely a bad idea anyway performance-wise).

~/.pyenv/versions/test-foo is not a symlink for me currently however, too.

from pyenv-virtualenv.

blueyed avatar blueyed commented on May 28, 2024

Anyway, you can use pyenv version to see where it is coming from.

from pyenv-virtualenv.

blueyed avatar blueyed commented on May 28, 2024

In @matthieugrieger it was probably still set in the shell env (PYENV_VERSION), and fixed itself with a new shell (where it was not set to a non-existent version).

from pyenv-virtualenv.

j-bennet avatar j-bennet commented on May 28, 2024

The symptoms are:

  • when I try to execute any pyenv command, or
  • when I open a new shell

I see pyenv: {my-deleted-version}' is not installed, and command is not executed (the command was trying to create a new virtualenv; it was not created).

from pyenv-virtualenv.

matthieugrieger avatar matthieugrieger commented on May 28, 2024

@blueyed: Yes, I believe that is what happened.

from pyenv-virtualenv.

j-bennet avatar j-bennet commented on May 28, 2024

It's not set at all. echo $PYENV_VERSION: nothing is printed.

from pyenv-virtualenv.

blueyed avatar blueyed commented on May 28, 2024

@j-bennet
In your case it would be a .python-version file.
What does pyenv version give you?

from pyenv-virtualenv.

j-bennet avatar j-bennet commented on May 28, 2024

Steps to reproduce.

  1. mkdir ~/repos/boo
  2. cd ~/repos/boo

The following steps are all inside boo.

--- repos/boo » pyenv virtualenv boo
New python executable in /Users/irina/.pyenv/versions/boo/bin/python2.7
Also creating executable in /Users/irina/.pyenv/versions/boo/bin/python
Installing setuptools, pip, wheel...done.
Ignoring indexes: https://pypi.python.org/simple
Requirement already satisfied (use --upgrade to upgrade): setuptools in /Users/irina/.pyenv/versions/boo/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): pip in /Users/irina/.pyenv/versions/boo/lib/python2.7/site-packages

--- repos/boo » pyenv local boo
pyenv-virtualenv: activate boo

(boo)--- repos/boo » cat .python-version
boo

(boo)--- repos/boo » deactivate

--- repos/boo » pyenv version
boo (set by /Users/irina/repos/boo/.python-version)

--- repos/boo » rm -rf ~/.pyenv/versions/boo
pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)

--- repos/boo » pyenv version
pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)
pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)

--- repos/boo » pyenv uninstall boo                                                                                                                                                                         pyenv: version `boo' not installed
pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)

--- repos/boo » pyenv virtualenv foo                                                                                                                                                                        pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)
pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)

--- repos/boo » pyenv versions                                                                                                                                                                              pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)
  system
  2.7.10
pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)

from pyenv-virtualenv.

yyuu avatar yyuu commented on May 28, 2024

Umm. It seems I forgot to redirect stderr to /dev/null. Just doing so would stop pyenv-virtualenv to do spamming.

https://github.com/yyuu/pyenv-virtualenv/blob/b9951fa69c13b1dbde0708bd70d8f85d21fd9858/bin/pyenv-sh-activate#L64

from pyenv-virtualenv.

yyuu avatar yyuu commented on May 28, 2024

@matthieugrieger @j-bennet I believe that the spamming will be suppressed with 9414a6b. Please give it a try.

from pyenv-virtualenv.

j-bennet avatar j-bennet commented on May 28, 2024

@yyuu I installed pyenv with homebrew, how do I update it to get the fix?

from pyenv-virtualenv.

yyuu avatar yyuu commented on May 28, 2024

@j-bennet Just try upgrading in the standard manner of Homebrew. 'brew update && brew upgrade pyenv pyenv-virtualenv'.

from pyenv-virtualenv.

j-bennet avatar j-bennet commented on May 28, 2024

Does not seem to help.

--- ~/src » cd ~/repos/boo
--- repos/boo » ll
--- repos/boo » pyenv versions
pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)
  system
  2.7.10
  wharfee
--- repos/boo » pyenv uninstall boo
pyenv: version `boo' not installed
--- repos/boo » pyenv virtualenv foo                                                                                                                                                                    1 ↵
pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)
--- repos/boo » pyenv versions                                                                                                                                                                          1 ↵
pyenv: version `boo' is not installed (set by /Users/irina/repos/boo/.python-version)
  system
  2.7.10
  wharfee

from pyenv-virtualenv.

j-bennet avatar j-bennet commented on May 28, 2024

In fact, pyenv is even more chatty now:

(wharfee) --- src/wharfee ‹volume-commands› » ll
total 80
-rw-r--r--   1 irina  staff   2.7K Dec 20 12:21 README.md
pyenv-virtualenv: deactivate wharfee
pyenv-virtualenv: deactivate
pyenv-virtualenv: activate wharfee
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.

from pyenv-virtualenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.