Virtual environment is active, but nothing is actually affected in Python 3

72 views Asked by At

I'm coding in Python, and I'm trying to create a virtual environment for an educational project I'm about to start. As the tutorials said, I used venv for this:

python3 -m venv tutorial-env
source tutorial-env/bin/activate

After this command, I see the environment's name in my terminal

(tutorial-env) username@username:~path/to/my/folder$

which seems fine.

However, I'm told that after these commands, which python3 should output the new python3 interpreter that's used in this environment (somewhere in tutorials-env/), but it's still /usr/bin/python3.

Screenshot:

Screenshot Creating a virtual env and testing it

I also tried to install packages with pip3 to see if the installed packages are installed in the environment or system-wide, and I realized that pip3 is installing stuff system-wide (I tried switching between environments and install packages inside each of them independently, but it affects all environments).

I also tried using virtualenv but the same thing happened.

Am I doing something wrong? My python3's version is 3.8.2, and I'm on Ubuntu 20.04 LTS.

1

There are 1 answers

0
yedpodtrzitko On BEST ANSWER

I'm suspicious about the special characters in directory name :, which could be causing troubles.