[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Dustin Rodrigues


Change by Dustin Rodrigues :


--
pull_requests: +23317
pull_request: https://github.com/python/cpython/pull/24530

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Neel Gore


Neel Gore  added the comment:

Ah in hindsight I see why this was troublesome; the directory name was "Project 
4/5", and zsh was displaying the / with a :. Renaming the directory to "Project 
4_5" fixed the problem. Thanks everyone!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Dustin Rodrigues


Dustin Rodrigues  added the comment:

FWIW, it looks like spaces in directory names in macOS seem to be handled okay 
in both bash and zsh when working with venv's activate script. Colons do not 
and there doesn't appear to be a workaround other than not working in a 
directory with a colon in its name when you want to include that directory in 
your PATH.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Dustin Rodrigues


Dustin Rodrigues  added the comment:

What's the name of the current directory? Does it end with "Project 4:5"? It 
may be the colon in the directory name is interfering with the PATH parsing so 
that the shell thinks that the first two entries in your path after the venv 
activate are

/Users/neelgore/Documents/UC Irvine/Y1/Q2/ICS 32/Project 4
5/.venv/bin

instead of

"/Users/neelgore/Documents/UC Irvine/Y1/Q2/ICS 32/Project 4:5/.venv/bin"

being the first entry.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Eric V. Smith

Eric V. Smith  added the comment:

Thanks. I’m guessing the space in the path is causing a problem.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Neel Gore


Neel Gore  added the comment:

This is Python 3.9.1 from the normal python.org download.

Before venv activation, "echo $PATH" gives:

/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware
 Fusion.app/Contents/Public

After activation, "ls -l .venv/bin" gives:

total 88
-rw-rw-r--  1 neelgore  staff  8834 Feb 14 14:51 Activate.ps1
-rw-rw-r--  1 neelgore  staff  1942 Feb 14 14:51 activate
-rw-rw-r--  1 neelgore  staff   891 Feb 14 14:51 activate.csh
-rw-rw-r--  1 neelgore  staff  2031 Feb 14 14:51 activate.fish
-rwxr-xr-x  1 neelgore  staff   327 Feb 14 14:51 easy_install
-rwxr-xr-x  1 neelgore  staff   327 Feb 14 14:51 easy_install-3.9
-rwxr-xr-x  1 neelgore  staff   318 Feb 14 14:51 pip
-rwxr-xr-x  1 neelgore  staff   318 Feb 14 14:51 pip3
-rwxr-xr-x  1 neelgore  staff   318 Feb 14 14:51 pip3.9
lrwxr-xr-x  1 neelgore  staff 7 Feb 14 14:51 python -> python3
lrwxr-xr-x  1 neelgore  staff61 Feb 14 14:51 python3 -> 
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
lrwxr-xr-x  1 neelgore  staff 7 Feb 14 14:51 python3.9 -> python3

and "echo $PATH" gives:

/Users/neelgore/Documents/UC Irvine/Y1/Q2/ICS 32/Project 
4:5/.venv/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware
 Fusion.app/Contents/Public

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Ned Deily


Ned Deily  added the comment:

It could be that the activate is failing for some reason in that directory or 
terminal session.  Try it in a new terminal session after entering "set -x" so 
you can see the expanded commands.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

Where did you install Python from?

Before you've activated the virtual env, please run "echo $PATH".

After you've activated the virtual env, can you run "ls -l .venv/bin" and "echo 
$PATH"?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Neel Gore


Neel Gore  added the comment:

(sorry for double message)
update:

Just created a venv in Desktop and another in a directory in Documents and got 
the correct behavior both times. Seems like the issue is isolated to the 
certain directory?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Neel Gore


Neel Gore  added the comment:

Just ran:

neelgore@Neels-MacBook-Pro Project 4:5 % rm -r .venv
neelgore@Neels-MacBook-Pro Project 4:5 % which python3  
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
neelgore@Neels-MacBook-Pro Project 4:5 % python3 -m venv .venv
neelgore@Neels-MacBook-Pro Project 4:5 % source .venv/bin/activate
(.venv) neelgore@Neels-MacBook-Pro Project 4:5 % which python3
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
(.venv) neelgore@Neels-MacBook-Pro Project 4:5 %

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Ned Deily


Ned Deily  added the comment:

Are you sure there wasn't an existing virtual environment at .venv? By default, 
venv does not upgrade an existing environment. Try deleting the .venv directory 
first, assuming there is nothing in the environment you want to save. Otherwise 
you could try debugging the shell steps with the shell command:

set -x

and, if necessary, debugging the python environment with:

python3 -m test.pythoninfo

https://docs.python.org/3.9/library/venv.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Neel Gore


Neel Gore  added the comment:

zsh 5.8 (x86_64-apple-darwin20.0)
and
macOS Big Sur 11.2.1

This was the normal python dot org installation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Dustin Rodrigues


Dustin Rodrigues  added the comment:

I'm also unable to replicate this. Where did you install Python from? Which 
version of zsh are you running?

--
nosy: +dtrodrigues

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

Please do not post screen captures. It makes it difficult for users with 
accessibility software and it makes it hard for people trying to help you to 
copy and paste exactly what you've tried.

I'm unable to duplicate your problem.

[~]$ ps
  PID TTY   TIME CMD
27521 ttys0000:00.07 -zsh
[~]$ which python3
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
[~]$ python3 -m venv .venv
[~]$ source .venv/bin/activate
(.venv) [~]$ which python3
/Users/ericsmith/.venv/bin/python3

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43218] after venv activation "which python3" and sys.path both give base installation instead of venv

2021-02-13 Thread Neel Gore


New submission from Neel Gore :

Fresh python 3.9.1 installation on macOS, shell is zsh

activated a venv with "python3 -m venv .venv"
activated with "source .venv/bin./activate"

"which python3" and "which pip3" both show my base installation

--
components: macOS
files: Screen Shot 2021-02-13 at 8.31.20 PM.png
messages: 386931
nosy: ned.deily, neeltennis, ronaldoussoren
priority: normal
severity: normal
status: open
title: after venv activation "which python3" and sys.path both give base 
installation instead of venv
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49807/Screen Shot 2021-02-13 at 8.31.20 
PM.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com