python - Pip default behavior conflicts with virtualenv? -


i following tutorial http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world/page/5

when got virtualenv flask command, received error message:

can not perform '--user' install. user site-packages not visible in virtualenv. 

this makes sense point of virtualenv create new environment can control, , --user command places in specific location, defeating objective of separation of dev environment.

it seems pip defaults --user installations though, can change default behavior? and, better, can pip play nice virtualenv @ times?

to clarify, here terminal looks like.

melchior:miguelgrinberg-microblog megablanc$ virtualenv flask new python executable in flask/bin/python installing setuptools, pip, wheel...   complete output command /users/megablanc/dev...log/flask/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:   can not perform '--user' install. user site-packages not visible in virtualenv. ---------------------------------------- ...installing setuptools, pip, wheel...done. traceback (most recent call last):   file "/users/megablanc/library/python/2.7/bin/virtualenv", line 11, in <module>     sys.exit(main())   file "/users/megablanc/library/python/2.7/lib/python/site-packages/virtualenv.py", line 832, in main     symlink=options.symlink)   file "/users/megablanc/library/python/2.7/lib/python/site-packages/virtualenv.py", line 1004, in create_environment     install_wheel(to_install, py_executable, search_dirs)   file "/users/megablanc/library/python/2.7/lib/python/site-packages/virtualenv.py", line 969, in install_wheel     'pip_no_index': '1'   file "/users/megablanc/library/python/2.7/lib/python/site-packages/virtualenv.py", line 910, in call_subprocess     % (cmd_desc, proc.returncode)) oserror: command /users/megablanc/dev...log/flask/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed error code 1 

you don't need set --user flag. after create virtualenv (virtualenv flask), activate it: source flask/bin/activate. shell should (flask) ~>.

once virtualenv activated, should able pip install packages without issue. example, pip install numpy. they'll installed in: lib/python2.6/site-packages/ (for whatever version of python using)


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -