momo
momo

Reputation: 1122

Installing virtualenv

I installed Python 3.7.1 using home-brew, and on the command line typing python returns the default python 2.7.10 and python3 gives the home-brew installed version. Then using

python3 -m pip install --user numpy scipy matplotlib

I installed the required packages. Now what I understand is that to use the home-brew version python I have to always use python3and the required packages are installed inside python 3's lib folder.

I want to install virtual env correctly. I want to know what command should I use if I want it to be usable with python3?

Upvotes: 0

Views: 81

Answers (2)

antonio
antonio

Reputation: 11

From my understanding you want to create python3 environments. First install virtualenv using pip.
pip install virtualenv
Then you can create a python3 environment like this:
virtualenv -p python3 env_name

Upvotes: 1

wim
wim

Reputation: 362507

You don't need to install virtual env because venv module is included in Python 3 standard library.

To create a virtualenv under .venv subdirectory of the current working directory:

 python3 -m venv .venv

Upvotes: 2

Related Questions