streisand icon indicating copy to clipboard operation
streisand copied to clipboard

virtualenv failed to create directory './venv'

Open tadwhitaker opened this issue 6 years ago • 6 comments

Apologies if this is horribly basic. But I'm in the weeds here:

This command:

./util/venv-dependencies.sh ./venv

Returns:

Requirement already satisfied: virtualenv in /usr/local/lib/python2.7/site-packages (15.1.0) ./util/venv-dependencies.sh: /usr/local/bin/virtualenv: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

virtualenv failed to create directory './venv' using 'virtualenv --python=python2.7 ./venv'. Note that ./venv must not exist, but its parent (.) must exist.

The first argument, 'new-directory', must be somewhere you can write to. A good place is './venv'. If it already exists, please delete the directory, or use a different name.

...

I followed everything up to this point and see the . directory in root. I cd'd into ./util/venv-dependencies.sh and inspected the script just to make sure the directory worked. Running cd ./venv returns -bash: cd: ./venv: No such file or directory

Environment: Mac High Sierra 10.13.16 Python version 2.7.10 pip 18.1 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)

Thank you for your help. This project looks amazing.

tadwhitaker avatar Dec 30 '18 17:12 tadwhitaker

Are you using Homebrew? You may need to brew uninstall python@2 and brew install python@2.

nopdotcom avatar Feb 24 '19 19:02 nopdotcom

I had the same issue. Uninstalling virtualenv and then installing again fixed it for me. I think its because virtualenv when installed didnt do it for python2.7.

sam17 avatar Mar 11 '19 08:03 sam17

When we switch to Python 3, I expect to switch to python3 -m venv which should solve a lot of versioning problems.

nopdotcom avatar Mar 16 '19 22:03 nopdotcom

has the migration to python3 been completed? i am hitting this same error on fedora30

marafa avatar Jul 07 '19 16:07 marafa

No, no migration to Python 3 yet; it would be nice if somebody could port ./util/venv-dependencies.sh because that's the one that requires testing on a bunch of major platforms.

@marafa, could you start with a fresh checkout, then make a transcript of what happens when you try to follow the install directions?

nopdotcom avatar Jul 07 '19 22:07 nopdotcom

This issue actually happed with Azure instance if you ran any apt install package, you will get the issue with the locale environment

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

after adding

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

to ~/.bashrc, the Streisand script is happy to create and run ./venv

akha666 avatar Jun 21 '20 20:06 akha666