easy_install: command not found 的解决办法

因为

hellopython@ubuntu:~$ mkvirtualenv -p /user/local/bin/python3 dm
mkvirtualenv: command not found

所以参照了 https://blog.csdn.net/liu_xzhen/article/details/79293373 ,结果:

hellopython@ubuntu:~$ sudo easy_install virtualenvwrapper
sudo: easy_install: command not found

解决办法(第一个sudo python2 -m easy_install virtualenvwrapper 说找不到某个包是因为网络太慢,后来连上手机热点,网速快了后,同样的命令就成功了。
)

hellopython@ubuntu:~$ sudo python2 -m easy_install virtualenvwrapper
[sudo] password for hellopython: 
Searching for virtualenvwrapper
Reading https://pypi.org/simple/virtualenvwrapper/
Download error on https://pypi.org/simple/virtualenvwrapper/: [Errno -2] Name or service not known -- Some packages may not be found!
Couldn't find index page for 'virtualenvwrapper' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.org/simple/
Download error on https://pypi.org/simple/: [Errno -2] Name or service not known -- Some packages may not be found!
No local packages or working download links found for virtualenvwrapper
error: Could not find suitable distribution for Requirement.parse('virtualenvwrapper')
hellopython@ubuntu:~$ sudo python2 easy_install virtualenvwrapper
[sudo] password for hellopython: 
python2: can't open file 'easy_install': [Errno 2] No such file or directory
hellopython@ubuntu:~$ sudo python2 -m easy_install virtualenvwrapper
Searching for virtualenvwrapper
Reading https://pypi.org/simple/virtualenvwrapper/
Downloading https://files.pythonhosted.org/packages/c1/6b/2f05d73b2d2f2410b48b90d3783a0034c26afa534a4a95ad5f1178d61191/virtualenvwrapper-4.8.4.tar.gz#sha256=51a1a934e7ed0ff221bdd91bf9d3b604d875afbb3aa2367133503fee168f5bfa
Best match: virtualenvwrapper 4.8.4
Processing virtualenvwrapper-4.8.4.tar.gz
Writing /tmp/easy_install-gfG3cV/virtualenvwrapper-4.8.4/setup.cfg
Running virtualenvwrapper-4.8.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gfG3cV/virtualenvwrapper-4.8.4/egg-dist-tmp-AqWCvm
Moving virtualenvwrapper-4.8.4-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding virtualenvwrapper 4.8.4 to easy-install.pth file
Installing virtualenvwrapper_lazy.sh script to /usr/local/bin
Installing virtualenvwrapper.sh script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/virtualenvwrapper-4.8.4-py2.7.egg
Processing dependencies for virtualenvwrapper
Searching for stevedore
Reading https://pypi.org/simple/stevedore/
Downloading https://files.pythonhosted.org/packages/b1/e1/f5ddbd83f60b03f522f173c03e406c1bff8343f0232a292ac96aa633b47a/stevedore-1.31.0-py2.py3-none-any.whl#sha256=01d9f4beecf0fbd070ddb18e5efb10567801ba7ef3ddab0074f54e3cd4e91730
Best match: stevedore 1.31.0
Processing stevedore-1.31.0-py2.py3-none-any.whl
Installing stevedore-1.31.0-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages
writing requirements to /usr/local/lib/python2.7/dist-packages/stevedore-1.31.0-py2.7.egg/EGG-INFO/requires.txt
Adding stevedore 1.31.0 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/stevedore-1.31.0-py2.7.egg
Searching for virtualenv-clone
Reading https://pypi.org/simple/virtualenv-clone/
Downloading https://files.pythonhosted.org/packages/ba/f8/50c2b7dbc99e05fce5e5b9d9a31f37c988c99acd4e8dedd720b7b8d4011d/virtualenv_clone-0.5.3-py2.py3-none-any.whl#sha256=532f789a5c88adf339506e3ca03326f20ee82fd08ee5586b44dc859b5b4468c5
Best match: virtualenv-clone 0.5.3
Processing virtualenv_clone-0.5.3-py2.py3-none-any.whl
Installing virtualenv_clone-0.5.3-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages
Adding virtualenv-clone 0.5.3 to easy-install.pth file
Installing virtualenv-clone script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/virtualenv_clone-0.5.3-py2.7.egg
Searching for pbr!=2.1.0,>=2.0.0
Reading https://pypi.org/simple/pbr/
Downloading https://files.pythonhosted.org/packages/46/a4/d5c83831a3452713e4b4f126149bc4fbda170f7cb16a86a00ce57ce0e9ad/pbr-5.4.3-py2.py3-none-any.whl#sha256=b32c8ccaac7b1a20c0ce00ce317642e6cf231cf038f9875e0280e28af5bf7ac9
Best match: pbr 5.4.3
Processing pbr-5.4.3-py2.py3-none-any.whl
Installing pbr-5.4.3-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages
Adding pbr 5.4.3 to easy-install.pth file
Installing pbr script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/pbr-5.4.3-py2.7.egg
Finished processing dependencies for virtualenvwrapper

hellopython@ubuntu:~$ cd /usr/local/bin
hellopython@ubuntu:/usr/local/bin$ ls
pbr  virtualenv-clone  virtualenvwrapper_lazy.sh  virtualenvwrapper.sh

补充:
python2 -m easy_install virtualenvwrapper 大概意思是:指定导入python2解释器下的easy_install模块后运行来安装virtualenvwrapper 。如果有错还请指正
所以如果你的python2没有easy_install.py 这样的工具包,还是另寻其它方法吧。

hellopython@ubuntu:~$ easy_install --version
setuptools 41.6.0 from /home/hellopython/.local/lib/python2.7/site-packages (Python 2.7)
hellopython@ubuntu:~$ sudo easy_install virtualenvwrapper
sudo: easy_install: command not found
hellopython@ubuntu:~$ cd /home/hellopython/.local/lib/python2.7/site-packages 
hellopython@ubuntu:~/.local/lib/python2.7/site-packages$ ls

decorator-4.4.1.dist-info                       retry
decorator.py                                    retry-0.9.2.dist-info
decorator.pyc                                   scrapy
easy_install.py                                 Scrapy-1.8.0.dist-info
easy_install.pyc                                selenium
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值