程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

ERROR: Command errored out with exit status 1: command: /bin/python -c ‘import sys, setuptools, toke

編輯:Python

pip install virtualenvwrapper stay Collecting virtualenv-clone Times wrong

  • The content of the error report is as follows
    • Solution

The content of the error report is as follows

[[email protected] Python-3.7.3]# pip install virtualenvwrapper
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting virtualenvwrapper
Using cached virtualenvwrapper-4.8.4.tar.gz (334 kB)
Requirement already satisfied: virtualenv in /usr/lib/python2.7/site-packages (from virtualenvwrapper) (20.14.1)
Collecting virtualenv-clone
Using cached virtualenv-clone-0.5.7.tar.gz (6.5 kB)
ERROR: Command errored out with exit status 1:
command: /bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gKdJeT/virtualenv-clone/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gKdJeT/virtualenv-clone/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-B9Q9yQ
cwd: /tmp/pip-install-gKdJeT/virtualenv-clone/
Complete output (19 lines):

Solution

1、 Upgrade first
pip install -U pip setuptools

2、 Look at the environment , In the use of pip install when , You should know which one is used pip, stay PATH、shell Configuration and operating system settings will affect pip Use

The best way is to use -m pipwhere Specify the installation path Python To call pip. for example , It's using python3, Then run python3 -m pip Package name

python3 -m pip install virtualenvwrapper

If running on the server python3 -m pip install Prompt permission error when , Sure -- user Add authorized users to install , for example ,python3 -m pip install --user …, Install the package to the specified user , And enable the current operating user to execute and use .
If the installation is successful, the following is true :

[[email protected] Python-3.7.3]# python3 -m pip install virtualenvwrapper
Collecting virtualenvwrapper
Using cached https://files.pythonhosted.org/packages/c1/6b/2f05d73b2d2f2410b48b90d3783a0034c26afa534a4a95ad5f1178d61191/virtualenvwrapper-4.8.4.tar.gz
Collecting virtualenv (from virtualenvwrapper)
Using cached https://files.pythonhosted.org/packages/9e/34/e86fc6a8f84329b49321a532b3c1fef103c67765df957fbb3852eea39d00/virtualenv-20.14.1-py2.py3-none-any.whl
Collecting virtualenv-clone (from virtualenvwrapper)
Downloading https://files.pythonhosted.org/packages/21/ac/e07058dc5a6c1b97f751d24f20d4b0ec14d735d77f4a1f78c471d6d13a43/virtualenv_clone-0.5.7-py3-none-any.whl
Collecting stevedore (from virtualenvwrapper)
Downloading https://files.pythonhosted.org/packages/7a/bc/fcce9e50da73ea23af6d236e05e15db8a02da1099a5e0a479451bcea3833/stevedore-3.5.0-py3-none-any.whl (49kB)
100% |████████████████████████████████| 51kB 9.1MB/s
Collecting platformdirs<3,>=2 (from virtualenv->virtualenvwrapper)
Downloading https://files.pythonhosted.org/packages/ed/22/967181c94c3a4063fe64e15331b4cb366bdd7dfbf46fcb8ad89650026fec/platformdirs-2.5.2-py3-none-any.whl
Collecting distlib<1,>=0.3.1 (from virtualenv->virtualenvwrapper)
Using cached https://files.pythonhosted.org/packages/ac/a3/8ee4f54d5f12e16eeeda6b7df3dfdbda24e6cc572c86ff959a4ce110391b/distlib-0.3.4-py2.py3-none-any.whl
Collecting six<2,>=1.9.0 (from virtualenv->virtualenvwrapper)
Downloading https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Collecting filelock<4,>=3.2 (from virtualenv->virtualenvwrapper)
Downloading https://files.pythonhosted.org/packages/a6/d5/17f02b379525d1ff9678bfa58eb9548f561c8826deb0b85797aa0eed582d/filelock-3.7.1-py3-none-any.whl
Collecting importlib-metadata>=0.12; python_version < "3.8" (from virtualenv->virtualenvwrapper)
Downloading https://files.pythonhosted.org/packages/ab/b5/1bd220dd470b0b912fc31499e0d9c652007a60caf137995867ccc4b98cb6/importlib_metadata-4.11.4-py3-none-any.whl
Collecting pbr!=2.1.0,>=2.0.0 (from stevedore->virtualenvwrapper)
Using cached https://files.pythonhosted.org/packages/1b/ef/0621aa0e422dda72dc89b61972e5a28d5a947c22fdff83a5d69fdbc1949a/pbr-5.9.0-py2.py3-none-any.whl
Collecting typing-extensions>=3.6.4; python_version < "3.8" (from importlib-metadata>=0.12; python_version < "3.8"->virtualenv->virtualenvwrapper)
Downloading https://files.pythonhosted.org/packages/75/e1/932e06004039dd670c9d5e1df0cd606bf46e29a28e65d5bb28e894ea29c9/typing_extensions-4.2.0-py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata>=0.12; python_version < "3.8"->virtualenv->virtualenvwrapper)
Downloading https://files.pythonhosted.org/packages/80/0e/16a7ee38617aab6a624e95948d314097cc2669edae9b02ded53309941cfc/zipp-3.8.0-py3-none-any.whl
Installing collected packages: platformdirs, distlib, six, filelock, typing-extensions, zipp, importlib-metadata, virtualenv, virtualenv-clone, pbr, stevedore, virtualenvwrapper
Running setup.py install for virtualenvwrapper ... done
Successfully installed distlib-0.3.4 filelock-3.7.1 importlib-metadata-4.11.4 pbr-5.9.0 platformdirs-2.5.2 six-1.16.0 stevedore-3.5.0 typing-extensions-4.2.0 virtualenv-20.14.1 virtualenv-clone-0.5.7 virtualenvwrapper-4.8.4 zipp-3.8.0
You are using pip version 19.0.3, however version 22.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved