GithubHelp home page GithubHelp logo

Comments (6)

yyuu avatar yyuu commented on May 28, 2024

The message of "Could not find an activated virtualenv (required)." must be displayed by pip during execution of pip install virtualenv in pyenv virtualenv. Do you set require-virtualenv or require-venv as a default option for pip in ~/.pip/pip.conf or somewhere?

from pyenv-virtualenv.

carolyn-idi avatar carolyn-idi commented on May 28, 2024

No I did not. I do not recall seeing anything in the documentation.

Is it something I should set? in `~/.pip I only have a 'cache' directory and 'pip.log'
I do not see pip.conf

from pyenv-virtualenv.

carolyn-idi avatar carolyn-idi commented on May 28, 2024

I do have this setting in .bashrc:

# PIP
# pip should only run if there is a virtualenv currently activated
export PIP_REQUIRE_VIRTUALENV=true

# cache pip-installed packages to avoid re-downloading
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache

It that causing the problem? This may of been added when the regular virualenv was added.

C.

from pyenv-virtualenv.

carolyn-idi avatar carolyn-idi commented on May 28, 2024

Looking at this a bit more I think the problem started with the pyenv install.

I had previously installed python with brew. Along with virtualenv and virtualenvwrapper.
I was trying to figure out how I could have a certain python version set to a specific project and stumbled across pyenv.

To use pyenv I uninstalled python brew uninstall python and then reinstalled with with the pyenv command: pyenv install 2.7.6

This option was set in .bash_profile:
export PYENV_ROOT=/usr/local/opt/pyenv

So I assume that pyenv used that directory as opposed to the ~/.pyenv directory
Could that be causing the problem? Should I comment that line out and reinstall the python versions?

Also the other virtual env variables in .bash_profile are:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Repo

export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'

Is pyenv virtualenv using the standard environment variables above?
I guess VIRTUALENVWRAPPER_PYTHON needs to be set to something different since python does not live in that area anymore, but I do now know what to set it to - or if I even need this variable.

Here are the PIP settings in .bashrc:

# PIP
# pip should only run if there is a virtualenv currently activated
#export PIP_REQUIRE_VIRTUALENV=true

# cache pip-installed packages to avoid re-downloading
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache

As I mentioned I'm pretty new at this and since I've not been able to find one good source of information, I've tried to piece this together from many sources. To be honest I'm still not 100% clear on how this is all supposed to work. Getting good documentation for a beginner seems hard. All the documentation seems to assume we already know how it is supposed to work.

I guess an other option it to just remove all this stuff and go back to using brew for the python installs?

Please advise,
Carolyn

from pyenv-virtualenv.

yyuu avatar yyuu commented on May 28, 2024

The pyenv-virtualenv uses vanilla virtualenv to manage virtual environments as a version of pyenv.

The following environment variables are not the standard of virtualenv in any senses. These environment variables are just for virtualenvwrapper, and have no effects for virtualenv. The pyenv-virtualenv just ignores them because it doesn't depend on virtualenvwrapper.

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Repo

export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'

from pyenv-virtualenv.

carolyn-idi avatar carolyn-idi commented on May 28, 2024

OK - thanks, I'll give this a try.

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.