Command "python setup.py egg_info" failed with error code 1 in...

2019-04-01 23:17:30   错误异常

本人环境Mac OS + pyenv + Python3.6.2

遇到问题的安装命令:

pip install google-cloud-translate

报错如下:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting google-cloud-translate
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9b/77/7007bf1ee38c98337cbf4e6cf5f619fb12b384cf7fb9503f4021911a7547/google_cloud_translate-1.3.3-py2.py3-none-any.whl
Collecting google-api-core<2.0.0dev,>=1.6.0 (from google-cloud-translate)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7d/73/e4877e921fe59307ec6b1b0b0c2ad9fde2d1c6bab8dd06ec913891a20dc6/google_api_core-1.8.2-py2.py3-none-any.whl
Collecting google-cloud-core<0.30dev,>=0.29.0 (from google-cloud-translate)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/0c/f2/3c225e7a69cb27d283b68bff867722bd066bc1858611180197f711815ea5/google_cloud_core-0.29.1-py2.py3-none-any.whl
Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in /Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-translate) (2.18.4)
Requirement already satisfied: six>=1.10.0 in /Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-translate) (1.10.0)
Collecting google-auth<2.0dev,>=0.4.0 (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-translate)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c5/9b/ed0516cc1f7609fb0217e3057ff4f0f9f3e3ce79a369c6af4a6c5ca25664/google_auth-1.6.3-py2.py3-none-any.whl
Requirement already satisfied: pytz in /Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-translate) (2017.3)
Collecting setuptools>=34.0.0 (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-translate)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d1/6a/4b2fcefd2ea0868810e92d519dacac1ddc64a2e53ba9e3422c3b62b378a6/setuptools-40.8.0-py2.py3-none-any.whl
Collecting googleapis-common-protos!=1.5.4,<2.0dev,>=1.5.3 (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-translate)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/76/a6/903a1c1c1fd676660174a9be4ec777c9b547392f640b16a326182b8fe484/googleapis-common-protos-1.5.9.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages/setuptools/__init__.py", line 10, in <module>
        from setuptools.extern.six.moves import filter, filterfalse, map
      File "/Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages/setuptools/extern/__init__.py", line 1, in <module>
        from pkg_resources.extern import VendorImporter
      File "/Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3017, in <module>
        @_call_aside
      File "/Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
        f(*args, **kwargs)
      File "/Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3045, in _initialize_master_working_set
        dist.activate(replace=False)
      File "/Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2577, in activate
        declare_namespace(pkg)
      File "/Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2151, in declare_namespace
        _handle_ns(packageName, path_item)
      File "/Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2091, in _handle_ns
        _rebuild_mod_path(path, packageName, module)
      File "/Users/vien/.pyenv/versions/3.6.2/envs/py3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2120, in _rebuild_mod_path
        orig_path.sort(key=position_in_sys_path)
    AttributeError: '_NamespacePath' object has no attribute 'sort'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/1c/3jlsrzg16hj2p4x9nxkdwwbw0000gn/T/pip-install-_shivf0v/googleapis-common-protos/

这是因为setuptools过期了,我们需要升级一下:

pip install --upgrade setuptools

至此便可以了,重新执行上面的安装命令即可。

viencoding.com版权所有,允许转载,但转载请注明出处和原文链接: https://viencoding.com/article/135
欢迎小伙伴们在下方评论区留言 ~ O(∩_∩)O
文章对我有帮助, 点此请博主吃包辣条 ~ O(∩_∩)O

猜你喜欢


评论

There are no comments yet.
未登录

登录后即可发表评论

登录或注册

标签

AdSense Anaconda Android apache API apt Auth AWS B-tree Bandwagon Blog bower brew bytes Caffe Catalina certbot Charles cloudcone Composer conda CoreML CPU crontab CSS csv Cuda cv2 datetime Digitalocean DNS Docker Docker-Compose Eloquent Excel export Flask FTP GET Git GitHub GitLab Gmail GoDaddy Google GTM hash Homebrew Homestead HTML http HTTPS IDEA image imagemagick imagick imgick import InnoDB ios iou iPhone ISO8601 iTerm2 Java JavaScript JPG JS Keras Laravel Laravel-Admin lazyload Linux list Livewire lnmp load logs Lravel Mac Markdown matplotlib md5 mix MobileNet Mojave mongo MongoDB MySQL Namesilo Nginx Node npm numpy Nvidia Nvidia-Docker onevps OpenCV Openpose openpyxl oss Outline parse PayPal PHP php-fpm PhpStorm PHP扩展 PIL Pillow pip PNG POST Protobuf PyCharm pyenv pymongo Python Python,人工智能,机器学习,VOC,xml Queue Redis requests RGB Sanctum save selenium SEO Shadowsock Shadowsocks ShadowsocksR simplemde Spring Boot SQLServer ssd SSH ssl SSL证书 SSR str Sublime sudo swap Swift Tensorflow TensorflowLite Terminal Terminator timestamp Ubuntu urllib UTC v2ray Valet Validation Validator VienBlog virtualenvs VPN VPS Vultr Web Windows WordPress Xcode xlsx yaml YAPI YUV zip zmq zsh 上网 下载图片 主从同步 云主机 云存储 云开发 云服务器 人工智能 优化 优惠码 伪原创 作弊与反作弊 免费ss账号 免费提现 切片 前端 加密 协议 博客 友链 双击事件 后台运行 后端 命令 国内镜像源 图标 图片操作 图片转换 域名 多身份认证 大小写转换 姿态检测 安卓模拟器 安装 定时任务 定时执行 密码 密钥 导出导入 小程序码 延迟加载 异常 微信 微信小程序 快捷方式 慢查询 懒加载 提现 搜索引擎 搬瓦工 搭梯子 教程 数据库 数据重复 文件上传 无法登录 日志 日期 时区 时间 时间戳 服务器 机器学习 权限 梯子 模拟浏览器 港版支付宝 漏洞 爬虫 生活服务 用户管理 病毒 登录 目标检测 科学上网 系统升级 索引 组件 组件开发 编辑器 自动付款 自定义组件 英文伪原创 计划任务 计算机视觉 订阅通知 认证 语法 读写分离 远程连接 配置文件 重定向 错误异常 错误提示 队列 阿里云 香港 香港手机号
亲情非友情链接