1. ホーム
  2. Python

仮想環境を作成するコマンドが見つからない virtualenv: コマンドが見つからない

2022-02-11 04:32:57

注)Ubuntu OSはvirtualenv Windows OSはmkvirtualenvです。


jhczz@vaio:~$ sudo apt-get install python-virtualenv


jhczz@vaio:~$ sudo apt-get install python-virtualenv
[sudo] password for jhczz: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  snap-confine
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  python3-virtualenv virtualenv
The following NEW packages will be installed:
  python-virtualenv python3-virtualenv virtualenv
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 94.1 kB of archives.
After this operation, 316 kB of additional disk space will be used.
Do you want to continue?
Get:1 http://hk.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-virtualenv all 15.0.1+ds-3ubuntu1 [46.6 kB]
Get:2 http://hk.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python3-virtualenv all 15.0.1+ds-3ubuntu1 [43.2 kB]
Get:3 http://hk.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 virtualenv all 15.0.1+ds-3ubuntu1 [4,342 B]
Fetched 94.1 kB in 1min 5s (1,439 B/s) 
Selecting previously unselected package python-virtualenv.
(Reading database ... 212557 files and directories currently installed.)
Preparing to unpack ... /python-virtualenv_15.0.1+ds-3ubuntu1_all.deb ...
Unpacking python-virtualenv (15.0.1+ds-3ubuntu1) ...
Selecting previously unselected package python3-virtualenv.
Preparing to unpack ... /python3-virtualenv_15.0.1+ds-3ubuntu1_all.deb ...
Unpacking python3-virtualenv (15.0.1+ds-3ubuntu1) ...
Selecting previously unselected package virtualenv.
Preparing to unpack ... /virtualenv_15.0.1+ds-3ubuntu1_all.deb ...
Unpacking virtualenv (15.0.1+ds-3ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up python-virtualenv (15.0.1+ds-3ubuntu1) ...
Setting up python3-virtualenv (15.0.1+ds-3ubuntu1) ...
Setting up virtualenv (15.0.1+ds-3ubuntu1) ...
jhczz@vaio:~$ cd work/Vietualenv/
jhczz@vaio:~/work/Vietualenv$ mkvirtualenv --python3=/usr/bin/python3.5 article_spider
mkvirtualenv: command not found
jhczz@vaio:~/work/Vietualenv$ virtualenv --python3=/usr/bin/python3.5 article_spider
Usage: virtualenv [OPTIONS] DEST_DIR

virtualenv: error: no such option: --python3
jhczz@vaio:~/work/Vietualenv$



インストールしたら、このコマンドを試してみましょう。