Code Monkey home page Code Monkey logo

Comments (19)

nayefc avatar nayefc commented on June 27, 2024 117

You did the same mistake that I did. You also need eval "$(pyenv init -)" before the virtualenv-init

from pyenv-virtualenv.

edmarjsg avatar edmarjsg commented on June 27, 2024 30

I was having trouble activating virtual environments due to same error mentioned in the original post.
Adding the following to .zshrc worked for me.

eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

from pyenv-virtualenv.

silvansky avatar silvansky commented on June 27, 2024 6

I used the instructions from README, installed via brew and added eval "$(pyenv virtualenv-init -)" in .zshenv.

from pyenv-virtualenv.

bradleyhurley avatar bradleyhurley commented on June 27, 2024 6

@ankitjain87 and @Githeo If you haven't already given up I was able to get fish working by adding

status --is-interactive; and source (pyenv init -|psub)
status --is-interactive; and source (pyenv virtualenv-init -|psub)

If you installed pyenv-virtualenv using Homebrew.

To my fish config.
~/.config/fish/config.fish

from pyenv-virtualenv.

nayefc avatar nayefc commented on June 27, 2024 3

I figured it out. The issue is that I had the initialisation set in .bash_profile. It needs to be set in .bashrc in Mac OS X if it one maintains both configs separately. I'll add a pull request with changes to the README.

from pyenv-virtualenv.

geoidesic avatar geoidesic commented on June 27, 2024 1

I'm still getting this issue. Any fix / work-around?

from pyenv-virtualenv.

nayefc avatar nayefc commented on June 27, 2024

Not completely. Now I can create a virtualenv and list it. But I cannot activate one using pyenv. When activating, I get:

Failed to deactivate virtualenv.

Perhaps pyenv-virtualenv has not been loaded into your shell properly.
Please restart current shell and try again.

Any ideas how to fix/debug? I removed all instances of virtualenv that I had installed manually, I re-installed this package using brew. The output of declare -f pyenv is empty.

I still have a shell that somehow still works (declare -f shows virtualenvwrapper there which is what I had before). But the newer shells I started up and did this clean up and re-installation with don't work. The way I'm working now using that old shell but I need to be able to get it working from a fresh new shell.

from pyenv-virtualenv.

silvansky avatar silvansky commented on June 27, 2024

Have same here. Why did you close issue? Found a workaround?

from pyenv-virtualenv.

nayefc avatar nayefc commented on June 27, 2024

@silvansky Yes. How did you install pyenv and pyenv-virtualenv? Also paste anything you've added to your bash_profile related to the, here.

from pyenv-virtualenv.

silvansky avatar silvansky commented on June 27, 2024

Wow! I wish this info was in README... Thanks a lot!

from pyenv-virtualenv.

TimFletcher avatar TimFletcher commented on June 27, 2024

@nayefc Thanks so much for that comment! I'd been editing and removed eval "$(pyenv init -)"!

from pyenv-virtualenv.

tkhieu avatar tkhieu commented on June 27, 2024

Thanks @nayefc This bug take me 30m to solve

from pyenv-virtualenv.

aristide-n avatar aristide-n commented on June 27, 2024

My PR adds @nayefc's tip to README.

from pyenv-virtualenv.

ankitjain87 avatar ankitjain87 commented on June 27, 2024

I am getting the same error when I am trying to activate in fish shell, but working fine in bash.

Also, when I am trying to activate using direct command activate.fish, I am getting this error -

The file '.pyenv/versions/my_project/bin/activate.fish' is not executable by this user

How can I make it working in fish shell

from pyenv-virtualenv.

Githeo avatar Githeo commented on June 27, 2024

Same error as @ankitjain87 here.

from pyenv-virtualenv.

Githeo avatar Githeo commented on June 27, 2024

Thanks @bradleyhurley, it works!
I hope your trick will be included in the doc.

from pyenv-virtualenv.

bradleyhurley avatar bradleyhurley commented on June 27, 2024

I opened a PR - #280

from pyenv-virtualenv.

brianjuhl avatar brianjuhl commented on June 27, 2024

@imedmar -- THANK YOU!!

from pyenv-virtualenv.

btphan95 avatar btphan95 commented on June 27, 2024

@nayefc Thank you!!!

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.