10

I'm having problems trying to create my virtualenv folders' since my terminal says that virtualenv seems not to be installed.

What did I do:

sudo pip install virtualenv

with this response:

The directory '/Users/ricardogonzales/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/ricardogonzales/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting virtualenv
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading virtualenv-13.1.0-py2.py3-none-any.whl (1.7MB)
    100% |████████████████████████████████| 1.7MB 59kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-13.1.0

After that I've run virtualenv venv and I'm getting this response: command not found

I've execute this command (brew info python) like other persons around here with the same problem but their responses from the terminal is not the same as my.

brew info response:

python: stable 2.7.10 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/python.rb
==> Dependencies
Build: pkg-config ✘
Required: openssl ✘
Recommended: readline ✘, sqlite ✘, gdbm ✘
Optional: homebrew/dupes/tcl-tk ✘, berkeley-db4 ✘
==> Options
--universal
    Build a universal binary
--with-berkeley-db4
    Build with berkeley-db4 support
--with-poll
    Enable select.poll, which is not fully implemented on OS X (https://bugs.python.org/issue5154)
--with-quicktest
    Run `make quicktest` after the build (for devs; may fail)
--with-tcl-tk
    Use Homebrew's Tk instead of OS X Tk (has optional Cocoa and threads support)
--without-gdbm
    Build without gdbm support
--without-readline
    Build without readline support
--without-sqlite
    Build without sqlite support
--HEAD
    Install HEAD version
==> Caveats
Pip and setuptools have been installed. To update them
  pip install --upgrade pip setuptools

You can install Python packages with
  pip install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Homebrew-and-Python.md

I don't know how it says "Not installed" but when I run python --version I'm getting Python 2.7.6 but if I go to usr/local/bin I can not see any python 2.7 or something what I see is a lot of python3.

Any help? or suggestion to try to resolve this will be very aprecciated.

ANSWER:

I've resolved this issue uninstalling the virtualenv and installing again without any extra configuration or something.

sudo pip uninstall virtualenv
sudo pip install virtualenv
9
  • 2
    sudo apt-get install virtualenv
    – kylieCatt
    Commented Jul 29, 2015 at 17:46
  • @IanAuld I forget to tell that I'm using Mac OS X
    – codebear22
    Commented Jul 29, 2015 at 18:05
  • You might need to log off/log in for it to work, and use mkvirtualenv and not virtualenv.
    – bufh
    Commented Jul 29, 2015 at 18:07
  • 1
    Is there something different called virtualvenv that I am not aware of? It is virtualenv like virtual environment. You have consistently spelled it with an extra 'v' throughout your question. Commented Jul 29, 2015 at 20:21
  • 1
    Can you post the output of which virtualenv and which pip after you've linked Python (see my answer)?
    – Bjorn
    Commented Jul 29, 2015 at 20:49

1 Answer 1

3

You've installed Python 2.7.10 according to brew info. python --version returns 2.7.6, so you're probably using the Python that's bundled with OS X. To fix that, run: brew link python, confirm that it is linked correctly by running which python. It should return /usr/local/bin/python (unless you've installed Homebrew in another directory than /usr/local).

After that, you probably need to reinstall virtualenv using the command you've used before, because brew link python will also update the path to pip (the version of pip which is linked to your Python install in /usr/local).

1
  • Arrived here because for hours I couldn't get autopep8 to work properly after installation viapip (I must have seriously screwed something up in the last 24 hours while trying to set things for AWS EC2 command line tool kit). I keep getting a -bash: command: not found error when trying to run autopep8 on a file. Anyway, things are running perfectly now, thanks! Commented Dec 31, 2015 at 3:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.