简体   繁体   English

无法使用pip install安装ordereddict

[英]cannot install ordereddict using pip install

I am getting the following error when running my python script 运行python脚本时出现以下错误

    from collections import OrderedDict
ImportError: cannot import name OrderedDict

I tried to install ordereddict using sudo pip install OrderedDict but running into following error..can anyonehelp how to overcome below error? 我尝试使用sudo pip install OrderedDict安装ordersdict,但遇到以下错误..有人可以帮助您解决以下错误吗?

Downloading/unpacking OrderedDict
  Could not fetch URL http://pypi.python.org/simple/OrderedDict: HTTP Error 403: CoachingSessionExceededWithoutJS
  Will skip URL http://pypi.python.org/simple/OrderedDict when looking for download links for OrderedDict
  Could not fetch URL http://pypi.python.org/simple/: HTTP Error 403: CoachingSessionExceededWithoutJS
  Will skip URL http://pypi.python.org/simple/ when looking for download links for OrderedDict
  Cannot fetch index base URL http://pypi.python.org/simple/
Cannot find requirement OrderedDict, nor fetch index URL http://pypi.python.org/simple/
Storing complete log in ./pip-log.txt

The key is this error code: 关键是此错误代码:

HTTP Error 403: CoachingSessionExceededWithoutJS

403 is typically "Forbidden." 403通常是“禁止的”。 The CoachingSessionExceededWithoutJS is a custom error code returned from a WebSense proxy. CoachingSessionExceededWithoutJS是从WebSense代理返回的自定义错误代码。

You need to either go around the proxy server or get your administrators to whitelist pypi.python.org . 您需要四处走动代理服务器,或者让管理员将pypi.python.org列入白名单。

WebSense proxies (and Bluecoat proxies and and and - it's become a common feature in enterprise class web proxies) allow administrators to enable/disable sites according to the category of website. WebSense代理(以及Bluecoat代理和and和-和-和它已成为企业级Web代理的常见功能)使管理员可以根据网站的类别启用/禁用网站。 The website is looked up in a local database, WebSense cleverly calls it the Master Database : 该网站在本地数据库中查找,WebSense巧妙地将其称为“ 主数据库”

The Websense® Master Database contains the industry's most accurate, current and comprehensive classification of URLs. Websense®主数据库包含业界最准确,最新和最全面的URL分类。 We use proprietary classification software and human inspection techniques to categorize and maintain definitions of more than 95 URL categories in more than 50 languages. 我们使用专有的分类软件和人工检查技术,以超过50种语言对超过95种URL类别的定义进行分类和维护。

If a user visits a website that does not exist in the database, the behavior between proxy servers pretty wildly. 如果用户访问数据库中不存在的网站,则代理服务器之间的行为将非常疯狂。 Some "fail closed" and block the connection, others "fail open" and allow uncategorized sites to succeed. 一些“失败关闭”并阻止连接,另一些“失败打开”并允许未分类的站点成功。 Bluecoat dynamically categorizes the site . Bluecoat 对网站进行了动态分类

WebSense tries to take a middle ground and presents a webpage that "coaches" the user through making a connection. WebSense尝试采取中间立场,并提供一个通过建立连接来“指导”用户的网页。 If there is no user present (ie, if the HTTP request did not originate from a web browser with a human in front of it) - then it cannot present the UI to coach you through the connection - and fails with 403 CoachingSessionExceededWithoutJS . 如果没有用户在场(即,如果HTTP请求不是来自前面带有人的Web浏览器),那么它将无法显示UI来指导您通过连接进行操作,并失败并返回403 CoachingSessionExceededWithoutJS

pypi is not in the Websense Master Database and your admins have configured the device to "coach" users through the connection for uncategorized domains. pypi不在Websense主数据库中,并且您的管理员已将设备配置为通过连接“指导”用户以访问未分类的域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM