Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python setuptools pip wheel失败,错误代码为2_Python_Google App Engine_Google Cloud Platform - Fatal编程技术网

Python setuptools pip wheel失败,错误代码为2

Python setuptools pip wheel失败,错误代码为2,python,google-app-engine,google-cloud-platform,Python,Google App Engine,Google Cloud Platform,我正在通过谷歌云平台的,我是在我卡住的步骤 运行virtualenv-p python3 env会产生以下错误: ⇒ virtualenv -p python3 env Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 Using base prefix '/Library/Frameworks/Python.framework/Versions/3

我正在通过谷歌云平台的,我是在我卡住的步骤

运行
virtualenv-p python3 env
会产生以下错误:

⇒  virtualenv -p python3 env
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/puoygae/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python3
Also creating executable in /Users/puoygae/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python
Please make sure you remove any previous custom paths from your /Users/puoygae/.pydistutils.cfg file.
Installing setuptools, pip, wheel...
  Complete output from command /Users/puoygae/Lab/ga...data/env/bin/python3 - setuptools pip wheel:
  Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/75/b3/0a106dfaf7f48aef638da80b32608617cc8de4b24a22c8cd3759c32e5d30/setuptools-41.1.0-py2.py3-none-any.whl
Collecting pip
  Using cached https://files.pythonhosted.org/packages/8d/07/f7d7ced2f97ca3098c16565efbe6b15fafcba53e8d9bdb431e09140514b0/pip-19.2.2-py2.py3-none-any.whl
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whl
Installing collected packages: setuptools, pip, wheel
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_set.py", line 731, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 841, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 1040, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/wheel.py", line 343, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/wheel.py", line 321, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/Users/puoygae/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/lib/python3.6/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/lib/python3.6/site-packages/easy_install.py'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 2327, in <module>
    main()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 711, in main
    symlink=options.symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 944, in create_environment
    download=download,
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 900, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 795, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/puoygae/Lab/ga...data/env/bin/python3 - setuptools pip wheel failed with error code 2
⇒  virtualenv-p python3环境
使用解释器/Library/Frameworks/Python.framework/Versions/3.6/bin/python3运行virtualenv
使用基本前缀“/Library/Frameworks/Python.framework/Versions/3.6”
新的python可执行文件位于/Users/puoygae/Lab/gae bookshelf app python flexible experiment/getting started python/2-structured-data/env/bin/python3
还在/Users/puoygae/Lab/gae bookshelf app python flexible experiment/getting started python/2-structured-data/env/bin/python中创建可执行文件
请确保从/Users/puoygae/.pydistutils.cfg文件中删除以前的任何自定义路径。
安装安装工具、pip、控制盘。。。
从command/Users/puoygae/Lab/ga…data/env/bin/python3-setuptools pip wheel完成输出:
收集设置工具
使用缓存https://files.pythonhosted.org/packages/75/b3/0a106dfaf7f48aef638da80b32608617cc8de4b24a22c8cd3759c32e5d30/setuptools-41.1.0-py2.py3-none-any.whl
收集点
使用缓存https://files.pythonhosted.org/packages/8d/07/f7d7ced2f97ca3098c16565efbe6b15fafcba53e8d9bdb431e09140514b0/pip-19.2.2-py2.py3-none-any.whl
集电轮
使用缓存https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whl
安装收集的软件包:setuptools、pip、wheel
例外情况:
回溯(最近一次呼叫最后一次):
文件“/Library/Python/2.7/site packages/virtualenv_support/pip-8.0.2-py2.py3 none any.whl/pip/basecommand.py”,第209行,在main中
status=self.run(选项、参数)
文件“/Library/Python/2.7/site packages/virtualenv_support/pip-8.0.2-py2.py3 none any.whl/pip/commands/install.py”,第317行,正在运行
prefix=options.prefix\u路径,
文件“/Library/Python/2.7/site packages/virtualenv_support/pip-8.0.2-py2.py3 none any.whl/pip/req/req_set.py”,第731行,正在安装中
**夸尔斯
文件“/Library/Python/2.7/site packages/virtualenv_support/pip-8.0.2-py2.py3 none any.whl/pip/req/req_install.py”,安装中第841行
self.move\u wheel\u文件(self.source\u dir,root=root,prefix=prefix)
文件“/Library/Python/2.7/site packages/virtualenv_support/pip-8.0.2-py2.py3 none any.whl/pip/req/req_install.py”,第1040行,在move_文件中
孤立的,
文件“/Library/Python/2.7/site packages/virtualenv_support/pip-8.0.2-py2.py3 none any.whl/pip/wheel.py”,第343行,在move_wheel_文件中
clobber(源代码,lib_dir,True)
文件“/Library/Python/2.7/site packages/virtualenv_support/pip-8.0.2-py2.py3 none any.whl/pip/wheel.py”,第321行,在clobber中
copyfile(srcfile,destfile)
文件“/Users/puoygae/Lab/gae bookshelf app python flexible experiment/getting started python/2-structured-data/env/lib/python3.6/shutil.py”,第121行,在copyfile中
开放式(dst,“wb”)作为fdst:
PermissionError:[Errno 13]权限被拒绝:'/lib/python3.6/site packages/easy_install.py'
----------------------------------------
…安装安装工具、pip、控制盘…完成。
回溯(最近一次呼叫最后一次):
文件“/Library/Python/2.7/site packages/virtualenv.py”,第2327行,在
main()
文件“/Library/Python/2.7/site packages/virtualenv.py”,第711行,在main中
symlink=options.symlink)
文件“/Library/Python/2.7/site packages/virtualenv.py”,第944行,在create_环境中
下载,
文件“/Library/Python/2.7/site-packages/virtualenv.py”,第900行,安装轮中
调用子进程(cmd,show_stdout=False,extra_env=env,stdin=SCRIPT)
call_子流程中的文件“/Library/Python/2.7/site packages/virtualenv.py”,第795行
%(指令描述,程序返回代码))
OSError:Command/Users/puoygae/Lab/ga…data/env/bin/python3-setuptools pip wheel失败,错误代码为2
我随后设置了python开发环境。我在互联网上搜索了一个解决方案,但我没有幸运地通过这一步

问题的原因是什么?如何解决

编辑:使用sudo运行它会产生以下错误:

⇒  sudo virtualenv -p python3 env
Password:
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/myUserName/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python3
Not overwriting existing python script /Users/myUserName/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python (you must use /Users/myUserName/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python3)
Please make sure you remove any previous custom paths from your /Users/myUserName/.pydistutils.cfg file.
Installing setuptools, pip, wheel...
  Complete output from command /Users/myUserName/Lab/ga...data/env/bin/python3 - setuptools pip wheel:
  The directory '/Users/myUserName/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/myUserName/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/75/b3/0a106dfaf7f48aef638da80b32608617cc8de4b24a22c8cd3759c32e5d30/setuptools-41.1.0-py2.py3-none-any.whl (576kB)
Collecting pip
  Downloading https://files.pythonhosted.org/packages/8d/07/f7d7ced2f97ca3098c16565efbe6b15fafcba53e8d9bdb431e09140514b0/pip-19.2.2-py2.py3-none-any.whl (1.4MB)
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whl
Installing collected packages: setuptools, pip, wheel
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_set.py", line 731, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 841, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 1040, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/wheel.py", line 476, in move_wheel_files
    generated.extend(maker.make(spec))
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 353, in make
    self._make_script(entry, filenames, options=options)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 257, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 231, in _write_script
    self._fileop.write_binary_file(outname, script_bytes)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/util.py", line 388, in write_binary_file
    with open(path, 'wb') as f:
PermissionError: [Errno 1] Operation not permitted: '/bin/easy_install'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 2327, in <module>
    main()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 711, in main
    symlink=options.symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 944, in create_environment
    download=download,
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 900, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 795, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/myUserName/Lab/ga...data/env/bin/python3 - setuptools pip wheel failed with error code 2
⇒  sudo virtualenv-p python3环境
密码:
使用解释器/Library/Frameworks/Python.framework/Versions/3.6/bin/python3运行virtualenv
使用基本前缀“/Library/Frameworks/Python.framework/Versions/3.6”
/Users/myUserName/Lab/gae bookshelf app python flexible experiment/getting started python/2-structured-data/env/bin/python3中的新python可执行文件
不覆盖现有python脚本/Users/myUserName/Lab/gae bookshelf app python flexible experiment/getting started python/2-structured-data/env/bin/python(必须使用/Users/myUserName/Lab/gae bookshelf app python flexible experiment/getting started python/2-structured-data/env/bin/python3)
请确保从/Users/myUserName/.pydistutils.cfg文件中删除以前的任何自定义路径。
安装安装工具、pip、控制盘。。。
从命令/Users/myUserName/Lab/ga…data/env/bin/python3-setuptools pip wheel完成输出:
当前用户不拥有目录“/Users/myUserName/Library/Caches/pip/http”或其父目录,缓存已被禁用。请检查该目录的权限和所有者。如果使用sudo执行pip,您可能需要sudo的-H标志。
当前用户不拥有目录“/Users/myUserName/Library/Caches/pip”或其父目录,并且已禁用缓存控制盘。检查该目录的权限和所有者。如果使用sudo执行pip,您可能需要sudo的-H标志。
收集设置工具
正在下载https://files.pythonhosted.org/packages/75/b3/0a106dfaf7f48aef638da80b32608617cc8de4b24a22c8cd3759c32e5d30/setuptools-41.1.0-py2.py3-none-any.whl (576kB)
收集点
正在下载https://files.pythonhosted.org/packages/8d/07/f7d7ced2f97ca3098c16565efbe6b15fafcba53e8d9bdb431e09140514b0/pip-19.2.2-py2.py3-none-any.whl (1.4MB)
科莱