Problems Installing VirtualEnv (Mac)

204 views
Skip to first unread message

Jayden Wilhelm

unread,
Dec 14, 2015, 12:57:50 AM12/14/15
to Evennia
I'm an amateur programmer, and only know a little python, but I enjoy it. When I found Evennia I was so excited. But then I ran into a technical problem. Most of the time I just move on to something else, but this time it's worth it. So here's my problem:

I'm running OS X 11.2 on a mac computer. I have the default python installed, and also have downloaded the python package from it's website.
I had no problem using sudo to install pip, but when I try to use pip to install virtualenv, it doesn't work.

First I tried:

sudo pip install virtualenv


It would load, print (what I believe to be) the proper installing stuff, then print this:

The directory '/Users/jaydenwilhelm/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/jaydenwilhelm/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.


after trying a second time, I get the above message plus:


Requirement already satisfied (use --upgrade to upgrade): virtualenv in /Library/Python/2.7/site-packages


I have noticed that the directories mentioned in both of these are not showing up when I try to find them in Finder (I know how to get to the Library folder)

Is the second one mentioning some computer-wide Library that I can't access through my user?


I have also tried uninstalling and reinstalling with the h flag attached:


in which case it will give none of the yellow text errors, but still not allow me to use the virtualenv command.


Any help would be much appreciated!

Thanks!


Kelketek Rritaa

unread,
Dec 14, 2015, 1:03:01 AM12/14/15
to eve...@googlegroups.com
The first message is telling you that when you used pip to install virtualenv, it was putting cached items in a folder that did not belong to root (Since your environment variables belonged to the current user instead of root). Those folders were likely cleared when installation was finished. This does not sound like it prevented the installation from completed— it appears to only be a warning. Virtualenv appears to be installed. Have you tried to use it?

--
You received this message because you are subscribed to the Google Groups "Evennia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to evennia+u...@googlegroups.com.
To post to this group, send email to eve...@googlegroups.com.
Visit this group at https://groups.google.com/group/evennia.
To view this discussion on the web visit https://groups.google.com/d/msgid/evennia/925a3b95-d8e9-4aba-a2c8-b33d7b2cb758%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jayden Wilhelm

unread,
Dec 14, 2015, 5:51:30 PM12/14/15
to Evennia
Yes, I have. When using the virtualenv command, I get a missing command error.

Julianas-MBP:pydev jaydenwilhelm$ virtualenv pyenv

-bash: virtualenv: command not found

Message has been deleted

Griatch Art

unread,
Dec 14, 2015, 6:40:15 PM12/14/15
to Evennia
It may seem Mac's sudo or pip is not happy with how the Mac organizes its install folders (it tries to install to root's home dir which is not your normal user's dir). You could change to your root user or, better, follow the suggestion recommended by pip itself in your error, namely using sudo's -H flag, which forces the user's home dir to be used.

First it sounds like you should remove your (apparently failed and partially cached) virtualenv install with sudo pip uninstall virtualenv (use pip help to see all pip commands, you might also try the --upgrade switch mentioned in the error if this doesn't work). Then try again, using the suggested -H switch: sudo -H pip install virtualenv

You should then (hopefully) be able to continue with the install normally.
.
Griatch

Jayden Wilhelm

unread,
Dec 14, 2015, 6:45:34 PM12/14/15
to Evennia
Unfortunately, I have also already tried this.

Julianas-MBP:~ jaydenwilhelm$ sudo -H pip install virtualenv

Collecting virtualenv

  Using cached virtualenv-13.1.2-py2.py3-none-any.whl

Installing collected packages: virtualenv

Successfully installed virtualenv-13.1.2

Julianas-MBP:~ jaydenwilhelm$ cd Desktop/pydev

Julianas-MBP:pydev jaydenwilhelm$ virtualenv env

-bash: virtualenv: command not found

Julianas-MBP:pydev jaydenwilhelm$ 

Griatch Art

unread,
Dec 14, 2015, 7:04:59 PM12/14/15
to Evennia
Curious; it does look like it gets installed correctly. I presume the pip install --upgrade virtualenv option was not helping either.

Just to avoid silly errors, close your bash shell and start a new one, test the virtualenv again. If still not working,

it would appear bash is not finding the virtualenv program in the system $PATH (which is what is searched when you enter something like "virtualenv" without giving the path to the program). It might be a side-effect of using the -H flag, it's maybe putting the program in a folder not included among the $PATHs searched. The way to handle this is to locate just where virtualenv.py got installed to (Finder should tell you) and add that path to your $PATH variable (internet will tell you how). Alternatively, you could just execute that file directly with its absolute path. Or you could copy it up from there to your pyenv folder so you have it there and can easily find and call it when you need to initialize the virtualenv (it's just a single .py file).

Last resort, you can download virtualenv.py as a file, drop it in your pyenv folder (for example) and just run it from there with python virtualenv.py. The download is here: https://pypi.python.org/pypi/virtualenv#downloads
.
Griatch

Jayden Wilhelm

unread,
Dec 14, 2015, 8:18:15 PM12/14/15
to eve...@googlegroups.com
Hmm, I am not the Admin user, and I logged into the Adin user, and the install went fine and works. But I still can't get it on my account. On my account, the virtualenv.py does not exist. I did download it manually though. Where do I need to put it for it to work for my user?

Jayden Wilhelm

unread,
Dec 14, 2015, 8:30:46 PM12/14/15
to eve...@googlegroups.com
I have successfully been able to start the environment using the manual download, but at sudo pip install -e . it gave this:

(env)Julianas-MBP:evennia jaydenwilhelm$ sudo pip install -e .

The directory '/Users/jaydenwilhelm/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/jaydenwilhelm/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Obtaining file:///Users/jaydenwilhelm/Desktop/install/evennia

Collecting django<1.9,>=1.8 (from evennia==0.5.0)

/Users/jaydenwilhelm/Desktop/virtualenv/env/lib/python2.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


Then it installed a bunch of things, will this hinder anything?

Should I have installed with the -H flag? Do I need to reinstall?

Kelketek Rritaa

unread,
Dec 14, 2015, 8:32:37 PM12/14/15
to eve...@googlegroups.com
Don’t use sudo within the virtualenv. You’ll probably need to recursively chown your env directory to your current user.

Virtualenv prevents having to use sudo for installing Python packages by giving you a local installation you don’t need root’s permission to modify.

--
You received this message because you are subscribed to the Google Groups "Evennia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to evennia+u...@googlegroups.com.
To post to this group, send email to eve...@googlegroups.com.
Visit this group at https://groups.google.com/group/evennia.

Jayden Wilhelm

unread,
Dec 14, 2015, 8:36:08 PM12/14/15
to Evennia
Ok, does that mean I need to uninstall and reinstall it differently?

Kelketek Rritaa

unread,
Dec 14, 2015, 8:38:51 PM12/14/15
to eve...@googlegroups.com
Uninstall probably won’t be necessary. There’s a folder named 'env' you created when invoking virtualenv.

sudo chown -R yourusername. env

Replace yourusername with your username on the machine, and don’t forget the period.

Then, cd back into the evennia directory, and run, without sudo:

pip install -e .

It may or may not need to install anything, but it should make sure.

On Dec 14, 2015, at 7:36 PM, Jayden Wilhelm <kindle...@gmail.com> wrote:

Ok, does that mean I need to uninstall and reinstall it differently?

--
You received this message because you are subscribed to the Google Groups "Evennia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to evennia+u...@googlegroups.com.
To post to this group, send email to eve...@googlegroups.com.
Visit this group at https://groups.google.com/group/evennia.

Jayden Wilhelm

unread,
Dec 14, 2015, 8:42:08 PM12/14/15
to Evennia
I have successfully made a game environment and nothing seems to be going wrong.

Griatch Art

unread,
Dec 15, 2015, 2:24:39 AM12/15/15
to Evennia
Good, glad to hear it works. Remember that you need to initialize the virtualenv with evennia (source env/bin/activate) whenever you start a new terminal and want to access evennia commands.
.
Griatch

Jayden Wilhelm

unread,
Dec 15, 2015, 6:43:38 PM12/15/15
to Evennia
Ok thanks! The chown command isn't working, but if it stop working later I can come back and try to fix it.

Julianas-MBP:~ jaydenwilhelm$ sudo chown -R jaydenwilhelm env

chown: env: No such file or directory


Thanks!

Griatch Art

unread,
Dec 15, 2015, 7:15:40 PM12/15/15
to Evennia
If you got your virtualenv to work you don't need to use chown (which stands for "change owner" btw), but the error you get seems trivial: you are calling chown from the wrong location, where the env/ directory is not located.
If you are new to linux, it's probably a good idea to familiarize yourself with using the command line, it will make your life a lot easier. For example: https://help.ubuntu.com/community/UsingTheTerminal
.
Griatch

Jayden Wilhelm

unread,
Dec 16, 2015, 10:04:23 AM12/16/15
to Evennia
Ok I'll take a look at that, thanks!
Reply all
Reply to author
Forward
0 new messages