Error “virtualenv : command not found” but install location is in PYTHONPATH
This has been driving me crazy for the past 2 days.
I installed virtualenv on my Macbook using pip install virtualenv
.
But when I try to create a new virtualenv using virtualenv venv
, I get the error saying "virtualenv : command not found".
I used pip show virtualenv
and the location of the installation is "Location: /usr/local/lib/python2.7/site-packages" but I can't figure out where the executable is. I tried dozens other similar looking posts but those solutions do not work for me.
Any ideas what might be going wrong here?
python python-2.7 pip
|
show 5 more comments
This has been driving me crazy for the past 2 days.
I installed virtualenv on my Macbook using pip install virtualenv
.
But when I try to create a new virtualenv using virtualenv venv
, I get the error saying "virtualenv : command not found".
I used pip show virtualenv
and the location of the installation is "Location: /usr/local/lib/python2.7/site-packages" but I can't figure out where the executable is. I tried dozens other similar looking posts but those solutions do not work for me.
Any ideas what might be going wrong here?
python python-2.7 pip
Are you sure your python path is correct? Are you using the system installed python, or one you downloaded on your own?
– cricket_007
Oct 10 '16 at 18:38
Pythonpath wouldn't affect executing a program from the commandline...
– John Gordon
Oct 10 '16 at 18:39
3
Can you trypython -m venv
?
– sytech
Oct 10 '16 at 18:41
@cricket_007 : I've been using it for the past 2 years so I'm not sure but I think its the default installation. When I dowhich python
, I get "/usr/local/bin/python"
– Pravesh Jain
Oct 10 '16 at 18:42
1
I have python installed via homebrew. When I didpip install virtualenv
, it created it there.
– cricket_007
Oct 10 '16 at 19:39
|
show 5 more comments
This has been driving me crazy for the past 2 days.
I installed virtualenv on my Macbook using pip install virtualenv
.
But when I try to create a new virtualenv using virtualenv venv
, I get the error saying "virtualenv : command not found".
I used pip show virtualenv
and the location of the installation is "Location: /usr/local/lib/python2.7/site-packages" but I can't figure out where the executable is. I tried dozens other similar looking posts but those solutions do not work for me.
Any ideas what might be going wrong here?
python python-2.7 pip
This has been driving me crazy for the past 2 days.
I installed virtualenv on my Macbook using pip install virtualenv
.
But when I try to create a new virtualenv using virtualenv venv
, I get the error saying "virtualenv : command not found".
I used pip show virtualenv
and the location of the installation is "Location: /usr/local/lib/python2.7/site-packages" but I can't figure out where the executable is. I tried dozens other similar looking posts but those solutions do not work for me.
Any ideas what might be going wrong here?
python python-2.7 pip
python python-2.7 pip
edited Oct 11 '16 at 10:06
asked Oct 10 '16 at 18:35
Pravesh Jain
1,29731529
1,29731529
Are you sure your python path is correct? Are you using the system installed python, or one you downloaded on your own?
– cricket_007
Oct 10 '16 at 18:38
Pythonpath wouldn't affect executing a program from the commandline...
– John Gordon
Oct 10 '16 at 18:39
3
Can you trypython -m venv
?
– sytech
Oct 10 '16 at 18:41
@cricket_007 : I've been using it for the past 2 years so I'm not sure but I think its the default installation. When I dowhich python
, I get "/usr/local/bin/python"
– Pravesh Jain
Oct 10 '16 at 18:42
1
I have python installed via homebrew. When I didpip install virtualenv
, it created it there.
– cricket_007
Oct 10 '16 at 19:39
|
show 5 more comments
Are you sure your python path is correct? Are you using the system installed python, or one you downloaded on your own?
– cricket_007
Oct 10 '16 at 18:38
Pythonpath wouldn't affect executing a program from the commandline...
– John Gordon
Oct 10 '16 at 18:39
3
Can you trypython -m venv
?
– sytech
Oct 10 '16 at 18:41
@cricket_007 : I've been using it for the past 2 years so I'm not sure but I think its the default installation. When I dowhich python
, I get "/usr/local/bin/python"
– Pravesh Jain
Oct 10 '16 at 18:42
1
I have python installed via homebrew. When I didpip install virtualenv
, it created it there.
– cricket_007
Oct 10 '16 at 19:39
Are you sure your python path is correct? Are you using the system installed python, or one you downloaded on your own?
– cricket_007
Oct 10 '16 at 18:38
Are you sure your python path is correct? Are you using the system installed python, or one you downloaded on your own?
– cricket_007
Oct 10 '16 at 18:38
Pythonpath wouldn't affect executing a program from the commandline...
– John Gordon
Oct 10 '16 at 18:39
Pythonpath wouldn't affect executing a program from the commandline...
– John Gordon
Oct 10 '16 at 18:39
3
3
Can you try
python -m venv
?– sytech
Oct 10 '16 at 18:41
Can you try
python -m venv
?– sytech
Oct 10 '16 at 18:41
@cricket_007 : I've been using it for the past 2 years so I'm not sure but I think its the default installation. When I do
which python
, I get "/usr/local/bin/python"– Pravesh Jain
Oct 10 '16 at 18:42
@cricket_007 : I've been using it for the past 2 years so I'm not sure but I think its the default installation. When I do
which python
, I get "/usr/local/bin/python"– Pravesh Jain
Oct 10 '16 at 18:42
1
1
I have python installed via homebrew. When I did
pip install virtualenv
, it created it there.– cricket_007
Oct 10 '16 at 19:39
I have python installed via homebrew. When I did
pip install virtualenv
, it created it there.– cricket_007
Oct 10 '16 at 19:39
|
show 5 more comments
5 Answers
5
active
oldest
votes
The only workable approach I could figure out (with help from @Gator_Python was to do python -m virtualenv venv
. This creates the virtual environment and works as expected.
I have custom python installed and maybe that's why the default approach doesn't work for me.
Works with the official Python3 download on El Capitan. Thanks.
– marw
Jan 9 '17 at 20:34
add a comment |
As mentioned in the comments, you've got the virtualenv module installed properly in the expected environment since python -m venv
allows you to create virtualenv's.
The fact that virtualenv
is not a recognized command is a result of the virtualenv.py
not being in your system PATH and/or not being executable. The root cause could be outdated distutils or setuptools.
You should attempt to locate the virtualenv.py
file, ensure it is executable (chmod +x
) and that its location is in your system PATH. On my system, virtualenv.py
is in the ../Pythonx.x/Scripts
folder, but this may be different for you.
The first solution worked for me, but the second failed, despite locatingvirtualenv
in~/lib/python/site-packages
, adding this directory to thePATH
, and makingvirtualenv.py
executable. I am on macOS Mojave with Python 3.6.7 and pip3.
– mmorin
Dec 11 at 10:29
add a comment |
Could it be that you are using Anaconda package manager? If so, then it has it's own virtual environment system which you setup as follows:
conda create --name venv
add a comment |
I had the same issue (although on ubuntu), a simple solution is instead of doing pip install virtualenv
, you precede the commend with "sudo".
A little inspection reveals the reason behind this fix:
pip install virtualenv
tries to put an executable under /usr/local/bin
so that it can be invoked from command line, but it failed because only root has write permission to that directory
an alternative is pip install --user virtualenv
, here are some further readings 1,2
add a comment |
- Install python's package manager pip.
- Install virtual environment using pip3 install virtualenv or pip install virtualenv.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39964635%2ferror-virtualenv-command-not-found-but-install-location-is-in-pythonpath%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
The only workable approach I could figure out (with help from @Gator_Python was to do python -m virtualenv venv
. This creates the virtual environment and works as expected.
I have custom python installed and maybe that's why the default approach doesn't work for me.
Works with the official Python3 download on El Capitan. Thanks.
– marw
Jan 9 '17 at 20:34
add a comment |
The only workable approach I could figure out (with help from @Gator_Python was to do python -m virtualenv venv
. This creates the virtual environment and works as expected.
I have custom python installed and maybe that's why the default approach doesn't work for me.
Works with the official Python3 download on El Capitan. Thanks.
– marw
Jan 9 '17 at 20:34
add a comment |
The only workable approach I could figure out (with help from @Gator_Python was to do python -m virtualenv venv
. This creates the virtual environment and works as expected.
I have custom python installed and maybe that's why the default approach doesn't work for me.
The only workable approach I could figure out (with help from @Gator_Python was to do python -m virtualenv venv
. This creates the virtual environment and works as expected.
I have custom python installed and maybe that's why the default approach doesn't work for me.
answered Oct 11 '16 at 7:17
Pravesh Jain
1,29731529
1,29731529
Works with the official Python3 download on El Capitan. Thanks.
– marw
Jan 9 '17 at 20:34
add a comment |
Works with the official Python3 download on El Capitan. Thanks.
– marw
Jan 9 '17 at 20:34
Works with the official Python3 download on El Capitan. Thanks.
– marw
Jan 9 '17 at 20:34
Works with the official Python3 download on El Capitan. Thanks.
– marw
Jan 9 '17 at 20:34
add a comment |
As mentioned in the comments, you've got the virtualenv module installed properly in the expected environment since python -m venv
allows you to create virtualenv's.
The fact that virtualenv
is not a recognized command is a result of the virtualenv.py
not being in your system PATH and/or not being executable. The root cause could be outdated distutils or setuptools.
You should attempt to locate the virtualenv.py
file, ensure it is executable (chmod +x
) and that its location is in your system PATH. On my system, virtualenv.py
is in the ../Pythonx.x/Scripts
folder, but this may be different for you.
The first solution worked for me, but the second failed, despite locatingvirtualenv
in~/lib/python/site-packages
, adding this directory to thePATH
, and makingvirtualenv.py
executable. I am on macOS Mojave with Python 3.6.7 and pip3.
– mmorin
Dec 11 at 10:29
add a comment |
As mentioned in the comments, you've got the virtualenv module installed properly in the expected environment since python -m venv
allows you to create virtualenv's.
The fact that virtualenv
is not a recognized command is a result of the virtualenv.py
not being in your system PATH and/or not being executable. The root cause could be outdated distutils or setuptools.
You should attempt to locate the virtualenv.py
file, ensure it is executable (chmod +x
) and that its location is in your system PATH. On my system, virtualenv.py
is in the ../Pythonx.x/Scripts
folder, but this may be different for you.
The first solution worked for me, but the second failed, despite locatingvirtualenv
in~/lib/python/site-packages
, adding this directory to thePATH
, and makingvirtualenv.py
executable. I am on macOS Mojave with Python 3.6.7 and pip3.
– mmorin
Dec 11 at 10:29
add a comment |
As mentioned in the comments, you've got the virtualenv module installed properly in the expected environment since python -m venv
allows you to create virtualenv's.
The fact that virtualenv
is not a recognized command is a result of the virtualenv.py
not being in your system PATH and/or not being executable. The root cause could be outdated distutils or setuptools.
You should attempt to locate the virtualenv.py
file, ensure it is executable (chmod +x
) and that its location is in your system PATH. On my system, virtualenv.py
is in the ../Pythonx.x/Scripts
folder, but this may be different for you.
As mentioned in the comments, you've got the virtualenv module installed properly in the expected environment since python -m venv
allows you to create virtualenv's.
The fact that virtualenv
is not a recognized command is a result of the virtualenv.py
not being in your system PATH and/or not being executable. The root cause could be outdated distutils or setuptools.
You should attempt to locate the virtualenv.py
file, ensure it is executable (chmod +x
) and that its location is in your system PATH. On my system, virtualenv.py
is in the ../Pythonx.x/Scripts
folder, but this may be different for you.
answered Oct 11 '16 at 12:34
sytech
4,61311031
4,61311031
The first solution worked for me, but the second failed, despite locatingvirtualenv
in~/lib/python/site-packages
, adding this directory to thePATH
, and makingvirtualenv.py
executable. I am on macOS Mojave with Python 3.6.7 and pip3.
– mmorin
Dec 11 at 10:29
add a comment |
The first solution worked for me, but the second failed, despite locatingvirtualenv
in~/lib/python/site-packages
, adding this directory to thePATH
, and makingvirtualenv.py
executable. I am on macOS Mojave with Python 3.6.7 and pip3.
– mmorin
Dec 11 at 10:29
The first solution worked for me, but the second failed, despite locating
virtualenv
in ~/lib/python/site-packages
, adding this directory to the PATH
, and making virtualenv.py
executable. I am on macOS Mojave with Python 3.6.7 and pip3.– mmorin
Dec 11 at 10:29
The first solution worked for me, but the second failed, despite locating
virtualenv
in ~/lib/python/site-packages
, adding this directory to the PATH
, and making virtualenv.py
executable. I am on macOS Mojave with Python 3.6.7 and pip3.– mmorin
Dec 11 at 10:29
add a comment |
Could it be that you are using Anaconda package manager? If so, then it has it's own virtual environment system which you setup as follows:
conda create --name venv
add a comment |
Could it be that you are using Anaconda package manager? If so, then it has it's own virtual environment system which you setup as follows:
conda create --name venv
add a comment |
Could it be that you are using Anaconda package manager? If so, then it has it's own virtual environment system which you setup as follows:
conda create --name venv
Could it be that you are using Anaconda package manager? If so, then it has it's own virtual environment system which you setup as follows:
conda create --name venv
answered Aug 28 '17 at 0:53
Bill
2,09421929
2,09421929
add a comment |
add a comment |
I had the same issue (although on ubuntu), a simple solution is instead of doing pip install virtualenv
, you precede the commend with "sudo".
A little inspection reveals the reason behind this fix:
pip install virtualenv
tries to put an executable under /usr/local/bin
so that it can be invoked from command line, but it failed because only root has write permission to that directory
an alternative is pip install --user virtualenv
, here are some further readings 1,2
add a comment |
I had the same issue (although on ubuntu), a simple solution is instead of doing pip install virtualenv
, you precede the commend with "sudo".
A little inspection reveals the reason behind this fix:
pip install virtualenv
tries to put an executable under /usr/local/bin
so that it can be invoked from command line, but it failed because only root has write permission to that directory
an alternative is pip install --user virtualenv
, here are some further readings 1,2
add a comment |
I had the same issue (although on ubuntu), a simple solution is instead of doing pip install virtualenv
, you precede the commend with "sudo".
A little inspection reveals the reason behind this fix:
pip install virtualenv
tries to put an executable under /usr/local/bin
so that it can be invoked from command line, but it failed because only root has write permission to that directory
an alternative is pip install --user virtualenv
, here are some further readings 1,2
I had the same issue (although on ubuntu), a simple solution is instead of doing pip install virtualenv
, you precede the commend with "sudo".
A little inspection reveals the reason behind this fix:
pip install virtualenv
tries to put an executable under /usr/local/bin
so that it can be invoked from command line, but it failed because only root has write permission to that directory
an alternative is pip install --user virtualenv
, here are some further readings 1,2
edited Dec 2 at 6:28
answered Nov 12 at 4:14
watashiSHUN
3,39812134
3,39812134
add a comment |
add a comment |
- Install python's package manager pip.
- Install virtual environment using pip3 install virtualenv or pip install virtualenv.
add a comment |
- Install python's package manager pip.
- Install virtual environment using pip3 install virtualenv or pip install virtualenv.
add a comment |
- Install python's package manager pip.
- Install virtual environment using pip3 install virtualenv or pip install virtualenv.
- Install python's package manager pip.
- Install virtual environment using pip3 install virtualenv or pip install virtualenv.
answered Nov 12 at 5:40
SAHIL SINGH SODHI
121
121
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39964635%2ferror-virtualenv-command-not-found-but-install-location-is-in-pythonpath%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you sure your python path is correct? Are you using the system installed python, or one you downloaded on your own?
– cricket_007
Oct 10 '16 at 18:38
Pythonpath wouldn't affect executing a program from the commandline...
– John Gordon
Oct 10 '16 at 18:39
3
Can you try
python -m venv
?– sytech
Oct 10 '16 at 18:41
@cricket_007 : I've been using it for the past 2 years so I'm not sure but I think its the default installation. When I do
which python
, I get "/usr/local/bin/python"– Pravesh Jain
Oct 10 '16 at 18:42
1
I have python installed via homebrew. When I did
pip install virtualenv
, it created it there.– cricket_007
Oct 10 '16 at 19:39