Giter Club home page Giter Club logo

Comments (10)

dyuri avatar dyuri commented on May 30, 2024 1

Hmm, I can't reproduce this, for me if pyenv-virtualenv is not installed then the result of $(pyenv virtualenv-init -) is an empty string, and nothing happens (no exceptions).
Using xonsh 0.9.18.
If you still have this issue, please enable $XONSH_SHOW_TRACEBACK and provide more details.

from xontrib-langenv.

mjmare avatar mjmare commented on May 30, 2024 1

When starting a XONSH shell (with xontrib load pyenv in .xonshrc) I get the message:

pyenv: no such command `virtualenv-init'

(I have $XONSH_SHOW_TRACEBACK set to True).

Then I brew installed pyenv-virtualenv. It makes the message/error go away.
However, it seems pyenv virtualenv myvenv + pyenv activate myvenv does NOT work properly the virtualenv is not activated.

from xontrib-langenv.

dyuri avatar dyuri commented on May 30, 2024

Sorry, I missed this issue completely. Checking.

from xontrib-langenv.

dyuri avatar dyuri commented on May 30, 2024

I've commited a change into master to suppress the "no such command" error while checking for pyenv-virtualenv, if you have a chance, please check.

The other issue is more interesting, for me it works as inteded:

❯ pyenv virtualenv test
Looking in links: /tmp/tmpahxyqpfz
Requirement already satisfied: setuptools in /home/dyuri/.pyenv/versions/test/lib/python3.9/site-packages (56.0.0)
Requirement already satisfied: pip in /home/dyuri/.pyenv/versions/test/lib/python3.9/site-packages (21.1.3)
❯ pyenv activate test
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
❯ which python
/home/dyuri/.pyenv/shims/python
❯ $VIRTUAL_ENV
'/home/dyuri/.pyenv/versions/test'
❯ pyenv deactivate cica
❯ $VIRTUAL_ENV
Traceback (Most recent call last):
1 <xonsh-code> <module> -->
KeyError: 'Unknown environment variable: $VIRTUAL_ENV'
❯ pyenv virtualenv-delete test
pyenv-virtualenv: remove /home/dyuri/.pyenv/versions/test? y

Is the pyenv alias working in your session? You can check that this way:

❯ which pyenv
<function create_alias.<locals>.pyenv at 0x7faefcbb58b0>

from xontrib-langenv.

mjmare avatar mjmare commented on May 30, 2024

I brew uninstalled pyenv-virtualenv.
I did a brew update+upgrade.
I brew uninstalled + installed pyenv.
I still get the error message. Maybe you haven't pushed to Home-brew (don't know how that works)?

from xontrib-langenv.

dyuri avatar dyuri commented on May 30, 2024

No, I did not, and no, pyenv-virtualenv is not my package, xontrib-pyenv is. A minute and I publish a new version to PyPI.

from xontrib-langenv.

mjmare avatar mjmare commented on May 30, 2024

I see. What is the best procedure to get your latest version?

from xontrib-langenv.

dyuri avatar dyuri commented on May 30, 2024

New version (1.0.6) released to PyPI (https://pypi.org/project/xontrib-pyenv/), I hope brew uses that.

from xontrib-langenv.

dyuri avatar dyuri commented on May 30, 2024

I'm using pip to install python packages, but I use Linux (I suppose you use Mac).

from xontrib-langenv.

mjmare avatar mjmare commented on May 30, 2024

Everything seems to work now, including the virtualenv stuff. Great! Thanks for the prompt action.

For others who may read this: xpip uninstall xontrib-pyenv, followed by a similar install.
If pyenv-virtualenv is not installed: no more error message. With pyenv-virtualenv installed, pyenv virtualenvs work.

BTW it would be useful if you could add to the contributing-pyenv docs that no other installation steps (as stipulated in the pyenv docs) are necessary.

from xontrib-langenv.

Related Issues (13)

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.