简体   繁体   English

pip在OSX上安装websocket-client时出错

[英]Errors when pip install websocket-client on OSX

I can successfully connect my websockets client to a websockets server, but when I try to send it some message, it gives me this error: 我可以将我的websockets客户端成功连接到一个websockets服务器,但是当我尝试向它发送一些消息时,它给了我这个错误:

error =  'NoneType' object has no attribute 'connected'

It appears that I need to be using websockets-client instead of just websockets, so I try pip installing it and get lots of errors. 看来我需要使用websockets-client而不是websockets,所以我尝试通过pip安装它,并得到很多错误。 How do I resolve these errors so I can use websockets-client on python? 如何解决这些错误,以便可以在python上使用websockets-client?

$ pip uninstall websocket
Skipping websocket as it is not installed.
$ pip install websocket-client
Requirement already satisfied: websocket-client in /usr/local/lib/python2.7/site-packages (0.44.0)
Requirement already satisfied: six in /usr/local/lib/python2.7/site-packages (from websocket-client) (1.10.0)
pyobjc-framework-mapkit 3.1.1 requires pyobjc-framework-CoreLocation>=3.1.1, which is not installed.
pyobjc-framework-syncservices 3.1.1 requires pyobjc-framework-CoreData>=3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-Accounts==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-AddressBook==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-AppleScriptKit==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-AppleScriptObjC==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-ApplicationServices==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-Automator==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-AVFoundation==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-AVKit==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-CalendarStore==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-CFNetwork==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-CloudKit==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-Collaboration==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-Contacts==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-ContactsUI==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-CoreBluetooth==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-CoreData==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-CoreLocation==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-CoreText==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-CoreWLAN==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-CryptoTokenKit==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-DictionaryServices==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-DiskArbitration==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-EventKit==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-ExceptionHandling==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-FinderSync==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-FSEvents==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-GameCenter==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-GameController==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-ImageCaptureCore==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-IMServicePlugIn==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-InputMethodKit==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-InstallerPlugins==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-InstantMessage==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-LatentSemanticMapping==3.1.1, which is not installed.
pyobjc 3.1.1 requires pyobjc_framework-LaunchServices==3.1.1, which is not installed.
mitmproxy 0.18.3 has requirement requests<2.12,>=2.9.1, but you'll have requests 2.18.4 which is incompatible.
viper 0.0.1 has requirement ethereum==2.0.4, but you'll have ethereum 1.6.1 which is incompatible.

pip should be able to resolve your missing dependencies for you, but the two errors that you encountered are on the last two lines. pip应该能够为您解决缺少的依赖关系,但是您遇到的两个错误在最后两行。 Namely, you have incompatible version requirements for requests and ethereum . 也就是说,您对requestsethereum版本要求不兼容。 You could trying changing the versions of those packages, but it could end up breaking other applications on your system. 您可以尝试更改这些软件包的版本,但最终可能会破坏系统上的其他应用程序。

I recommend using a Python virtual environment in this case, which will ensure that your program's dependencies do not introduce dependency incompatibilities with other programs on the system. 我建议在这种情况下使用Python虚拟环境,这将确保您程序的依赖项不会与系统上的其他程序引入依赖项不兼容性。

A nice reference guide for managing packages with a virtual environment is located here: http://docs.python-guide.org/en/latest/dev/virtualenvs/ 此处提供了一个用于在虚拟环境中管理软件包的参考指南: http : //docs.python-guide.org/en/latest/dev/virtualenvs/

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

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